Skip to content

Hibernate / JPA / Postgres with simple servlets + JSTL web application demo.

Notifications You must be signed in to change notification settings

sroysf/webapp-jpa-hibernate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

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.

Technologies

  • Maven
  • Hibernate
  • JPA annotations
  • PostgreSQL
  • JSTL
  • Servlets
  • Log4J via SLF4J
  • JUnit
  • Hibernate maven plugin

Setup and run

Assuming you have setup your postgres database separately and have updated persistence.xml to point at it...

  1. mvn clean package -DskipTests
  2. Use target/hibernate3/sql/schema.ddl to create your database schema
  3. mvn install
  4. mvn -e exec:java -Dexec.mainClass=com.force.samples.util.DataLoadUtil (adds some data to the database)
  5. mvn tomcat:run
  6. Point browser at http://localhost:8080/webapp-jsp-jpa-hibernate/listbooks
  7. Or try http://localhost:8080/webapp-jsp-jpa-hibernate/

About

Hibernate / JPA / Postgres with simple servlets + JSTL web application demo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages