Chapter 2. Starting a project
In this chapter
- Overview of Hibernate projects
- “Hello World” with Hibernate and Java Persistence
- Configuration and integration options
In this chapter, you’ll start with Hibernate and Java Persistence using a step-by-step example. You’ll see both persistence APIs and how to benefit from using either native Hibernate or standardized JPA. We first offer you a tour through Hibernate with a straightforward “Hello World” application. Before you start coding, you must decide which Hibernate modules to use in your project.
Hibernate is an ambitious project that aims to provide a complete solution to the problem of managing persistent data in Java. Today, Hibernate is not only an ORM service, but also a collection of data management tools extending well beyond ORM.
The Hibernate project suite includes the following:
Path: /model/src/main/resources/META-INF/persistence.xml
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/021fig01_alt.jpg)
Path: /model/src/main/java/org/jpwh/model/helloworld/Message.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/023fig01_alt.jpg)
Path: /examples/src/est/java/org/jpwh/helloworld/HelloWorldJPA.java
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldJPA.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/024fig01_alt.jpg)
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldJPA.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/025fig01_alt.jpg)
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldHibernate.java
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldHibernate.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/027fig01_alt.jpg)
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldHibernate.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/027fig02_alt.jpg)
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldHibernate.java
Path: /examples/src/ test/java/org/jpwh/helloworld/HelloWorldHibernate.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/028fig01_alt.jpg)
Path: /examples/src/test/java/org/jpwh/helloworld/HelloWorldHibernate.java
![](https://drek4537l1klr.cloudfront.net/bauer2/Figures/029fig01_alt.jpg)