This project demonstrates how to use spring beans with hibernate session, hql, Criteria, etc
The beauty is:
@Transactional annotation instead of
Transaction tx = null;
try {
tx = session.beginTransaction();
session.flush();
tx.commit();
} catch (HibernateException he) {
if(tx != null){
tx.rollback();
}
throw new HibernateException(he);
}
Source: http://www.devglan.com/spring-boot/spring-boot-hibernate-5-example
https://github.com/roncoo/spring-boot-demo
mvn -Pweb package
mvn -Pconsole package
java -jar target/spring-boot-hibernate-example-0.0.jar
https://github.com/appcoreopc/app/tree/master/appCore.Scripting
e