├── .gitignore ├── src ├── main │ ├── webapp │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ ├── resources │ │ │ └── images │ │ │ │ └── puppy.jpg │ │ └── WEB-INF │ │ │ ├── views │ │ │ ├── uploadSuccess.jsp │ │ │ ├── home.jsp │ │ │ └── listResults.jsp │ │ │ ├── web.xml │ │ │ └── spring │ │ │ └── servlet-context.xml │ ├── java │ │ └── com │ │ │ └── force │ │ │ └── samples │ │ │ ├── dao │ │ │ ├── BookDAO.java │ │ │ └── BookDAOImpl.java │ │ │ ├── entity │ │ │ ├── Author.java │ │ │ └── Book.java │ │ │ ├── controllers │ │ │ ├── RestController.java │ │ │ └── HomeController.java │ │ │ └── util │ │ │ └── DataLoadUtil.java │ └── resources │ │ ├── META-INF │ │ └── persistence.xml │ │ ├── log4j.xml │ │ └── hibernate.cfg.xml └── test │ └── java │ └── com │ └── force │ └── samples │ └── test │ └── PersistenceTest.java ├── README.md └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .* 3 | -------------------------------------------------------------------------------- /src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /src/main/webapp/resources/images/puppy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sroysf/webapp-springmvc-jpa-hibernate/HEAD/src/main/webapp/resources/images/puppy.jpg -------------------------------------------------------------------------------- /src/main/java/com/force/samples/dao/BookDAO.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.force.samples.entity.Book; 6 | 7 | public interface BookDAO { 8 | 9 | List getAllBooks(); 10 | 11 | List getBooksByTitle(String title); 12 | 13 | Book getBookById(Long id); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/uploadSuccess.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 2 | 3 | 4 | 5 | File upload success 6 | 7 | 8 | 9 |

File successfully uploaded

10 | 11 | File description =
12 | Bytes received = 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/force/samples/dao/BookDAOImpl.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.orm.jpa.support.JpaDaoSupport; 6 | 7 | import com.force.samples.entity.Book; 8 | 9 | public class BookDAOImpl extends JpaDaoSupport implements BookDAO { 10 | 11 | public List getAllBooks() { 12 | return getJpaTemplate().find("select b from Book b"); 13 | } 14 | 15 | public List getBooksByTitle(String title) { 16 | return getJpaTemplate().find("select b from Book b where b.title=?1", title); 17 | } 18 | 19 | public Book getBookById(Long id) { 20 | return getJpaTemplate().find(Book.class, id); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 2 | 3 | 4 | 5 | Home 6 | 7 | 8 | 9 |

This is the home page

10 | 11 | 12 | 13 |

Try retrieving some data...

14 | 17 | 18 |

Or upload a file...

19 |
20 | Description :
21 | File :
22 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | org.hibernate.dialect.PostgreSQLDialect 8 | org.postgresql.Driver 9 | jdbc:postgresql://localhost/devdb 10 | devdbuser 11 | postgres 12 | true 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/listResults.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 2 | 3 | 4 | 5 | Books 6 | 7 | 8 | 9 |

List of books

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
Param linkRest Link
26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/force/samples/entity/Author.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.Id; 6 | 7 | @Entity 8 | public class Author { 9 | 10 | @Id 11 | @GeneratedValue 12 | private long id; 13 | 14 | private String firstName; 15 | 16 | private String lastName; 17 | 18 | public long getId() { 19 | return id; 20 | } 21 | 22 | public void setId(long id) { 23 | this.id = id; 24 | } 25 | 26 | public String getFirstName() { 27 | return firstName; 28 | } 29 | 30 | public void setFirstName(String firstName) { 31 | this.firstName = firstName; 32 | } 33 | 34 | public String getLastName() { 35 | return lastName; 36 | } 37 | 38 | public void setLastName(String lastName) { 39 | this.lastName = lastName; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | appServlet 9 | org.springframework.web.servlet.DispatcherServlet 10 | 11 | contextConfigLocation 12 | /WEB-INF/spring/servlet-context.xml 13 | 14 | 1 15 | 16 | 17 | appServlet 18 | / 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/force/samples/controllers/RestController.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.controllers; 2 | 3 | import javax.inject.Inject; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.force.samples.dao.BookDAO; 15 | import com.force.samples.entity.Book; 16 | 17 | @Controller 18 | @RequestMapping(value="/rest") 19 | public class RestController { 20 | 21 | private static Logger log = LoggerFactory.getLogger(RestController.class); 22 | 23 | @Inject 24 | private BookDAO bookDAO; 25 | 26 | @RequestMapping(method=RequestMethod.GET, value="/book/{bookId}") 27 | public @ResponseBody Book getBook (@PathVariable(value="bookId") long bookId, Model model) { 28 | 29 | log.info("Searching for book with id = " + bookId); 30 | 31 | Book book = bookDAO.getBookById(bookId); 32 | return book; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/force/samples/entity/Book.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.entity; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.Id; 9 | import javax.persistence.ManyToOne; 10 | 11 | @Entity 12 | public class Book { 13 | 14 | @Id 15 | @GeneratedValue 16 | private long id; 17 | 18 | private String title; 19 | 20 | @ManyToOne(cascade={CascadeType.PERSIST}) 21 | private Author author; 22 | 23 | private Date publicationDate; 24 | 25 | public long getId() { 26 | return id; 27 | } 28 | 29 | public void setId(long id) { 30 | this.id = id; 31 | } 32 | 33 | public String getTitle() { 34 | return title; 35 | } 36 | 37 | public void setTitle(String title) { 38 | this.title = title; 39 | } 40 | 41 | public Author getAuthor() { 42 | return author; 43 | } 44 | 45 | public void setAuthor(Author author) { 46 | this.author = author; 47 | } 48 | 49 | public Date getPublicationDate() { 50 | return publicationDate; 51 | } 52 | 53 | public void setPublicationDate(Date publicationDate) { 54 | this.publicationDate = publicationDate; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Purpose ## 2 | 3 | Provide an integrated starter project for SpringMVC + Spring ORM, backed by Hibernate and PostgreSQL. 4 | 5 | This project demonstrates a variety of useful functions right out of the box, and can be used as a starting point for a real web application. 6 | It makes extensive use of SpringMVC for the web tier. It also uses Spring to replace the direct access to the JPA entity manager API and 7 | instead uses Spring dependency injection patterns to access data. 8 | 9 | ## Technologies ## 10 | 11 | * Maven 12 | * Hibernate 13 | * JPA annotations 14 | * PostgreSQL 15 | * JSTL 16 | * Servlets 17 | * Log4J via SLF4J 18 | * JUnit 19 | * Hibernate maven plugin 20 | * Spring MVC 21 | * Spring ORM 22 | 23 | ## Features demonstrated ## 24 | 25 | * JSTL page rendering 26 | * Implementation of REST API, automatically returning JSON serialization. 27 | * Parsing and controller routing in Spring MVC 28 | * File upload 29 | * Database access via injected DAO objects 30 | 31 | ## Setup and run ## 32 | 33 | Assuming you have setup your postgres database separately and have updated persistence.xml to point at it... 34 | 35 | 1. mvn clean install -DskipTests 36 | 2. mvn hibernate3:hbm2ddl 37 | 3. Use target/hibernate3/sql/schema.ddl to create your database schema 38 | 4. mvn -e exec:java -Dexec.mainClass=com.force.samples.util.DataLoadUtil (adds some data to the database) 39 | 5. mvn tomcat:run 40 | 6. Point browser at [http://localhost:8080/webapp-springmvc-jpa-hibernate](http://localhost:8080/webapp-springmvc-jpa-hibernate) 41 | -------------------------------------------------------------------------------- /src/main/java/com/force/samples/controllers/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.controllers; 2 | 3 | import java.util.List; 4 | 5 | import javax.inject.Inject; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.multipart.MultipartFile; 15 | import org.springframework.web.servlet.ModelAndView; 16 | 17 | import com.force.samples.dao.BookDAO; 18 | import com.force.samples.entity.Book; 19 | 20 | @Controller 21 | public class HomeController { 22 | 23 | private static Logger log = LoggerFactory.getLogger(HomeController.class); 24 | 25 | @Inject 26 | private BookDAO bookDAO; 27 | 28 | @RequestMapping(method=RequestMethod.GET, value={"/", "/home"}) 29 | public String showHomePage (ModelAndView mv) { 30 | log.info("Hit controller"); 31 | 32 | return "home"; 33 | } 34 | 35 | @RequestMapping(method=RequestMethod.GET, value="/listbooks") 36 | public String listBooks (Model model) { 37 | List books = bookDAO.getAllBooks(); 38 | 39 | model.addAttribute("books", books); 40 | 41 | return "listResults"; 42 | } 43 | 44 | @RequestMapping(method=RequestMethod.GET, value="/getbook") 45 | public String getBook (String title, Model model) { 46 | List books = bookDAO.getBooksByTitle(title); 47 | 48 | model.addAttribute("books", books); 49 | 50 | return "listResults"; 51 | } 52 | 53 | @RequestMapping(method=RequestMethod.POST, value="/upload") 54 | public String uploadFile(String description, @RequestParam(value="myFile")MultipartFile uploadedFile, Model model) { 55 | 56 | Long fileSize = uploadedFile.getSize(); 57 | log.info("File size received = " + fileSize); 58 | log.info("Description = " + description); 59 | 60 | model.addAttribute("desc", description); 61 | model.addAttribute("fileSize", fileSize); 62 | return "uploadSuccess"; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/test/java/com/force/samples/test/PersistenceTest.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.test; 2 | 3 | import java.util.Date; 4 | import java.util.GregorianCalendar; 5 | 6 | import javax.persistence.EntityManager; 7 | import javax.persistence.EntityManagerFactory; 8 | import javax.persistence.EntityTransaction; 9 | import javax.persistence.Persistence; 10 | 11 | import junit.framework.Assert; 12 | 13 | import org.junit.BeforeClass; 14 | import org.junit.Test; 15 | import org.slf4j.Logger; 16 | import org.slf4j.LoggerFactory; 17 | 18 | import com.force.samples.entity.Author; 19 | import com.force.samples.entity.Book; 20 | 21 | 22 | public class PersistenceTest { 23 | 24 | private static Logger log = null; 25 | 26 | @BeforeClass 27 | public static void testClassSetup() { 28 | log = LoggerFactory.getLogger(PersistenceTest.class); 29 | 30 | log.warn("Be sure to create the schema before running these tests!"); 31 | } 32 | 33 | @Test 34 | public void testDatabaseSaveAndRetrieve() { 35 | log.info("Running testDatabaseSaveAndRetrieve"); 36 | 37 | EntityManagerFactory emf = Persistence.createEntityManagerFactory("exampleHibernateJPA"); 38 | 39 | EntityManager em = emf.createEntityManager(); 40 | 41 | log.info("Creating and persisting entity..."); 42 | EntityTransaction tx = em.getTransaction(); 43 | tx.begin(); 44 | 45 | Author author = new Author(); 46 | author.setFirstName("JRR"); 47 | author.setLastName("Tolkein"); 48 | 49 | Book book = new Book(); 50 | book.setAuthor(author); 51 | book.setTitle("Fellowship of the Ring"); 52 | book.setPublicationDate(new GregorianCalendar(1954, 06, 24).getTime()); 53 | 54 | em.persist(book); 55 | 56 | tx.commit(); 57 | 58 | // Now read it back and verify 59 | log.info("Reading back from database and verifying..."); 60 | EntityTransaction readTx = em.getTransaction(); 61 | readTx.begin(); 62 | 63 | Book fellowship = em.find(Book.class, book.getId()); 64 | Assert.assertNotNull(fellowship); 65 | Assert.assertEquals("Fellowship of the Ring", fellowship.getTitle()); 66 | Assert.assertEquals("JRR", fellowship.getAuthor().getFirstName()); 67 | Assert.assertEquals("Tolkein", fellowship.getAuthor().getLastName()); 68 | 69 | readTx.commit(); 70 | 71 | // Cleanup the entities 72 | log.info("Cleaning up created entity..."); 73 | EntityTransaction delTx = em.getTransaction(); 74 | delTx.begin(); 75 | 76 | em.remove(fellowship); 77 | em.remove(fellowship.getAuthor()); 78 | 79 | delTx.commit(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/spring/servlet-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/java/com/force/samples/util/DataLoadUtil.java: -------------------------------------------------------------------------------- 1 | package com.force.samples.util; 2 | 3 | import java.util.GregorianCalendar; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.EntityManagerFactory; 7 | import javax.persistence.EntityTransaction; 8 | import javax.persistence.Persistence; 9 | import javax.persistence.Query; 10 | 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | import com.force.samples.entity.Author; 15 | import com.force.samples.entity.Book; 16 | 17 | /** 18 | * Use this class to reset the database state for the test entities. 19 | * Execute from command line using : mvnnt -e exec:java -Dexec.mainClass=com.force.samples.util.DataLoadUtil 20 | * 21 | */ 22 | public class DataLoadUtil { 23 | 24 | private static Logger log = null; 25 | 26 | public static void main(String[] args) { 27 | log = LoggerFactory.getLogger(DataLoadUtil.class); 28 | 29 | log.info("Resetting database state"); 30 | resetDatabaseState(); 31 | } 32 | 33 | private static void resetDatabaseState() { 34 | EntityManagerFactory emf = Persistence.createEntityManagerFactory("exampleHibernateJPA"); 35 | 36 | EntityManager em = emf.createEntityManager(); 37 | 38 | log.info("Creating and persisting entity..."); 39 | EntityTransaction tx = em.getTransaction(); 40 | tx.begin(); 41 | 42 | deleteAllExistingData(em); 43 | 44 | populateCannedData(em); 45 | 46 | tx.commit(); 47 | } 48 | 49 | private static void populateCannedData(EntityManager em) { 50 | 51 | Author author = new Author(); 52 | author.setFirstName("JRR"); 53 | author.setLastName("Tolkein"); 54 | 55 | Book hobbit = new Book(); 56 | hobbit.setAuthor(author); 57 | hobbit.setTitle("The Hobbit"); 58 | hobbit.setPublicationDate(new GregorianCalendar(1937, 11, 1).getTime()); 59 | em.persist(hobbit); 60 | 61 | Book fotr = new Book(); 62 | fotr.setAuthor(author); 63 | fotr.setTitle("Fellowship of the Ring"); 64 | fotr.setPublicationDate(new GregorianCalendar(1954, 06, 24).getTime()); 65 | em.persist(fotr); 66 | 67 | Book twoTowers = new Book(); 68 | twoTowers.setAuthor(author); 69 | twoTowers.setTitle("The Two Towers"); 70 | twoTowers.setPublicationDate(new GregorianCalendar(1954, 10, 11).getTime()); 71 | em.persist(twoTowers); 72 | 73 | Book rotk = new Book(); 74 | rotk.setAuthor(author); 75 | rotk.setTitle("Return of the King"); 76 | rotk.setPublicationDate(new GregorianCalendar(1955, 9, 20).getTime()); 77 | em.persist(rotk); 78 | 79 | Author rowling = new Author(); 80 | rowling.setFirstName("J.K"); 81 | rowling.setLastName("Rowling"); 82 | 83 | Book hpps = new Book(); 84 | hpps.setAuthor(rowling); 85 | hpps.setTitle("Harry Potter and the Philosophers Stone"); 86 | hpps.setPublicationDate(new GregorianCalendar(1997, 5, 30).getTime()); 87 | em.persist(hpps); 88 | 89 | Book hpcs = new Book(); 90 | hpcs.setAuthor(rowling); 91 | hpcs.setTitle("Harry Potter and the Chamber of Secrets"); 92 | hpcs.setPublicationDate(new GregorianCalendar(1998, 6, 2).getTime()); 93 | em.persist(hpcs); 94 | 95 | Book hppa = new Book(); 96 | hppa.setAuthor(rowling); 97 | hppa.setTitle("Harry Potter and the Prisoner of Azkaban"); 98 | hppa.setPublicationDate(new GregorianCalendar(1999, 6, 8).getTime()); 99 | em.persist(hppa); 100 | } 101 | 102 | private static void deleteAllExistingData(EntityManager em) { 103 | log.info("Deleting existing books"); 104 | Query bookQuery = em.createQuery("delete from Book"); 105 | bookQuery.executeUpdate(); 106 | 107 | Query authorQuery = em.createQuery("delete from Author"); 108 | authorQuery.executeUpdate(); 109 | 110 | log.info("Deleting existing authors"); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.javacloud.samples 5 | webapp-springmvc-jpa-hibernate 6 | Spring MVC with Hibernate 7 | 0.0.1-SNAPSHOT 8 | war 9 | Demonstrates an end to end starter spring mvc project, with hibernate + jpa persistence. 10 | 11 | 12 | 1.5 13 | 1.5.10 14 | 3.0.5.RELEASE 15 | 16 | 17 | 18 | 19 | postgresql 20 | postgresql 21 | 8.4-702.jdbc4 22 | 23 | 24 | org.hibernate 25 | hibernate-entitymanager 26 | 3.4.0.GA 27 | 28 | 29 | 30 | 31 | javax.servlet 32 | jstl 33 | 1.2 34 | 35 | 36 | 37 | 38 | org.springframework 39 | spring-webmvc 40 | ${org.springframework-version} 41 | 42 | 43 | org.springframework 44 | spring-tx 45 | ${org.springframework-version} 46 | 47 | 48 | org.springframework 49 | spring-orm 50 | ${org.springframework-version} 51 | 52 | 53 | 54 | javax.inject 55 | javax.inject 56 | 1 57 | 58 | 59 | 60 | 61 | commons-io 62 | commons-io 63 | 2.0 64 | 65 | 66 | org.codehaus.jackson 67 | jackson-core-lgpl 68 | 1.6.2 69 | 70 | 71 | org.codehaus.jackson 72 | jackson-mapper-lgpl 73 | 1.6.2 74 | 75 | 76 | commons-fileupload 77 | commons-fileupload 78 | 1.2 79 | 80 | 81 | 82 | 83 | org.slf4j 84 | slf4j-api 85 | ${org.slf4j-version} 86 | 87 | 88 | org.slf4j 89 | jcl-over-slf4j 90 | ${org.slf4j-version} 91 | runtime 92 | 93 | 94 | org.slf4j 95 | slf4j-log4j12 96 | ${org.slf4j-version} 97 | runtime 98 | 99 | 100 | log4j 101 | log4j 102 | 1.2.15 103 | 104 | 105 | javax.mail 106 | mail 107 | 108 | 109 | javax.jms 110 | jms 111 | 112 | 113 | com.sun.jdmk 114 | jmxtools 115 | 116 | 117 | com.sun.jmx 118 | jmxri 119 | 120 | 121 | runtime 122 | 123 | 124 | org.apache.tomcat 125 | servlet-api 126 | 6.0.32 127 | provided 128 | 129 | 130 | 131 | 132 | junit 133 | junit 134 | 4.5 135 | test 136 | 137 | 138 | 139 | 140 | 141 | org.apache.maven.plugins 142 | maven-compiler-plugin 143 | 144 | ${java-version} 145 | ${java-version} 146 | 147 | 148 | 149 | org.codehaus.mojo 150 | hibernate3-maven-plugin 151 | 2.2 152 | 153 | 154 | 155 | 156 | hbm2ddl 157 | jpaconfiguration 158 | 159 | 160 | 161 | exampleHibernateJPA 162 | schema.ddl 163 | false 164 | true 165 | false 166 | true 167 | 168 | 169 | 170 | 171 | postgresql 172 | postgresql 173 | 8.4-702.jdbc4 174 | 175 | 176 | 177 | 178 | 179 | --------------------------------------------------------------------------------