Java Persistence and Hibernate book

I publish a continuously updated English ebook on Hibernate and Java Persistence for more than 4 years by now.
Extensive, easy-to-follow introduction to Hibernate. It starts from the beginning and
will still be a great help when you deal with performance tuning or Hibernate architecture.
It covers the current Hibernate version 3.6 and JPA 2 and is constantly updated.
It is full of examples showing you how things look like in real code.
The first two parts including more than 10 chapters are available http://www.laliluna.de/jpa-hibernate-guide/
What do you get?
- eBook in PDF Format
- You can choose the number of updates of the book.
- The book has more than 240 pages. The format is Din A4.
- More than 20 sample projects
- More than 26 samples showing either mappings, Hibernate filter, named queries or other things
- About 60 mapping variants (1:1, 1:n, m:n, ternary, uni/bidirectional, components, entity associations, inheritance, …)
- Mappings are explained for Annotations and XML including query examples
- Taking care of the developer and explain problem zones in detail
- Focus on best practices
- Real projects showing how to integrate Hibernate with other technologies and craft propper architectures
The book is provided as PDF and is lizenzed to a single person only.
Ordering can be done in my Online Shop. The table of content can be found below.
Any questions? “Please contact me.”contact.html
Explanations with complete working examples
Whenever something is explained you will find a complete sample application. If a specific mapping is demonstrated you can find a sample application, too. It shows how to insert, update, delete or query the classes included in this mapping.
Larger sample applications show the implementation of real applications using Hibernate in detail. Each application has an increasing complexity.
Cache configurations, deployment configurations for particular application server rounds off the examples.
Altogether the book provides about 20 mapping examples + variations, 4 real projects and some smaller projects showing a specific configurations.
Hibernate Project Setup
Examples to set up Hibernate projects with Eclipse and MyEclipse. Automatic generation of Hibernate mappings from existing databases.
Potential problems are investigated in detail
Hibernate has some problem zones where you can easily make mistakes. These are covered in detail to help you to avoid these problems. Some topics are LazyLoading, Session and transaction handling, optimistic concurrency and version handling.
Best Practices
One chapter is completely focussing on how to implement well designed Hibernate applications. DAO patterns and business layers are discussed. Pros and cons and the logic behind this structure are explained.
Focus on important features
Deliberately, I did not explain some rare concepts which I consider to be either not stable or very rarely used. Instead I referred to the corresponding chapters of the Hibernate reference – the documentation available with Hibernate. In my opinion the Hibernate reference is far too complex for people learning Hibernate. However, it is a valuable resource for people who already know Hibernate.
What this book is not?
The texts are short and frequently you are referred to parts of sample applications. If you prefer larger narrative parts you should not read this book.
Feel free to contact me and to comment on the book in the forum at http://www.laliluna.de
Sebastian Hennebrueder
Table of Content
1. Revision Oktober 2011
About the author, book and versions
ii 1. The author
ii 2. The book
ii 3. Library Versions
2. Introduction to Hibernate
2.1. A first Hibernate example
2.2. Hibernate basics
3. Hibernate Concepts – State of Objects
3.1. The three states of objects
3.2. Lazy initialization, a Hibernate problem
4. Working with Objects
4.1. Java Persistence versus Hibernate
4.2. Hibernate API
4.3. EntityManager API
5. A more complex example – web application
5.1. Summary
6. Basic Mappings
6.1. Annotation versus XML
6.2. Annotation mapping
6.3. XML Mapping
7. Primary key mapping
7.1. Natural versus Surrogate Ids
7.2. Assigned Id
7.3. Generated with Auto Strategy
7.4. Other Annotation Strategies
7.5. Composite Id
7.6. Equals and Hashcode
7.7. Other XML Id tags
8. Relation mapping
8.1. Selecting between List, Set, Map or array to hold many side
8.2. Cascading
8.3. 1:1 relation
8.4. 1:n
8.5. m:n
8.6. 1:n:1
8.7. Recursive relation
8.8. Typed relation (XML only)
8.9. Typed relation (annotation workaround)
9. Components = Composition mapping
9.1. Composition versus entity relations
9.2. Composed class in one table
9.3. Composition as set of many classes
9.4. Composition as list of many classes
9.5. Advanced details
9.6. Composition 1:n:1
9.7. Not included mappings
10. Inheritance
10.1. Use Case
10.2. Overview on mapping approaches
10.3. Single Table
10.4. Joined Inheritance
10.5. Joined Inheritance with Discriminator
10.6. Union Inheritance
10.7. XML Includes
10.8. Mapped Super Class
11. Lob with Oracle and PostgreSQL
11.1. PostgreSQL
11.2. Oracle
12. Querying data
12.1. Useful tools
12.2. HQL
12.3. Criteria Queries
12.4. Native SQL
III. Building applications and Architecture
13. Data Access Objects
13.1. Best practices and DAO
13.2. Data Access Objects DAO
13.3. Weaving the application structure
14. Session and Transaction Handling
14.1. Hibernate Session
14.2. JTA versus JDBC Transactions
14.3. Transaction handling – default pattern
14.4. JDBC transactions with ThreadLocal
14.5. JTA transaction with a single database
14.6. JDBC or JTA with the Spring framework
14.7. Conversations and Session Lifetime
14.8. Concurrent Access
15. Integration with other technologies
15.1. Hibernate and Spring
15.2. Hibernate and Struts
15.3. JBoss integration with Hibernate Service Bean
IV. Configuration, Performance, Validation and Full Text Search
16. Hibernate Full Text Search
17. Performance Tuning
17.1. Analysing performance problem
17.2. Iterating through relations – batches
17.3. Iterating through relations – subqueries
17.4. Iterating through relations – single query
17.5. Reporting queries
17.6. Iterating through large resultsets
17.7. Caches
18. Configuration
18.1. Connection Pools
A. Appendix
A.1. Annotation Reference
Index