- First step setup for the pom.xml with hibernate dependency ,
hibernate dependency need to before the struts2,because the javassist dependency
com.google.guava
guava
RELEASE
javax.servlet
javax.servlet-api
${servlet.version}
provided
javax.servlet.jsp
jsp-api
${servlet.jsp.version}
jar
test
log4j
log4j
${log4j.version}
junit
junit
${junit.version}
test
org.hibernate
hibernate-core
${hibernate.version}
org.jboss.spec.javax.transaction
jboss-transaction-api_1.2_spec
${jboss.api.version}
org.springframework
spring-core
${spring.version}
org.springframework
spring-context
${spring.version}
org.springframework
spring-jdbc
${spring.version}
org.springframework
spring-tx
${spring.version}
org.springframework
spring-beans
${spring.version}
org.springframework
spring-web
${spring.version}
org.springframework
spring-expression
${spring.version}
org.springframework
spring-orm
${spring.version}
commons-dbcp
commons-dbcp
${spring.dbcp.version}
xml-apis
xml-apis
${spring.xmapis.version}
org.apache.struts
struts2-core
${struts2.version}
org.apache.struts
struts2-convention-plugin
${struts2.version}
org.apache.struts
struts2-json-plugin
${struts2.version}
org.apache.struts
struts2-config-browser-plugin
${struts2.version}
org.apache.struts
struts2-junit-plugin
${struts2.version}
test
org.apache.struts
struts2-spring-plugin
${struts2.version}
2. ApplicationContext.xml for hibernate :
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
${hibernate.hbm2ddl.auto}
${hibernate.dialect}
${hibernate.show_sql}
${hibernate.format_sql}
3. Install the hibernate tool to generate the entity class automatically:
choose the “hibernate tool” and “hibernate maven integration” and follow the step to install it .
4.using the hibernate reverse engineering(reveng.xml) to generate the reveng.xml file
5.using the hibernate code generate tool to generate the hibernate entities
6.create a new hibernate.cfg.xml file and then create the hibernate console
7.then you can use the HQL editor and hibernate criteria editor .