Provide an integrated Hello World application demonstrating JPA persistence using Hibernate and PostgreSQL, in the context of a very simple web application. This demo does not use any real frameworks except for JSTL for a little bit of JSP processing.
This pattern should not be used for all but the simplest possible use cases. However, it's useful to have as a skeleton starting point for a java web application when you don't want to incorporate the complexities of an actual web framework.
- Maven
- Hibernate
- JPA annotations
- PostgreSQL
- JSTL
- Servlets
- Log4J via SLF4J
- JUnit
- Hibernate maven plugin
Assuming you have setup your postgres database separately and have updated persistence.xml to point at it...
- mvn clean package -DskipTests
- Use target/hibernate3/sql/schema.ddl to create your database schema
- mvn install
- mvn -e exec:java -Dexec.mainClass=com.force.samples.util.DataLoadUtil (adds some data to the database)
- mvn tomcat:run
- Point browser at http://localhost:8080/webapp-jsp-jpa-hibernate/listbooks
- Or try http://localhost:8080/webapp-jsp-jpa-hibernate/