Guide to Hibernate Annotations
Is there light at the end of the tunnel?
So I’m sure I’m not alone here, when I say that Hibernate can be frustrating, difficult to learn, and may even feel like to use it means to give up on some design principles that have been proven by many.
When you first begin, it feels like there are holes, inconsistencies, and problems that send you running home to the familiar behavior of plain SQL. But, I don’t think it’s time to give up on Hibernate yet.
Keep in mind that I am a relatively new Hibernate user, I consider myself somewhat experienced with software development, design patterns, principles, and best practices. If this sounds like you, read on…
I’m beginning a series of articles that will:
- document my journey with Hibernate
- be a guide for those of you who are still on your journey
- give me a way to remember why I’ve made the decisions that I’ve made; what was I thinking??
Please look forward to the following topics that will start out this series.
- Getting started quickly. (read it)
- Using a base class to map common fields. (read it)
- Criteria returning duplicate results in OneToMany relationships.
- The Abstract Dao.
- Keeping transactional behavior in a lazy world.
Also, feel free to comment on any of these topics, or request new topics. Remember to check the following resources; a lot of common problems can be solved by reading the hibernate FAQ.
For the purpose of these examples, please assume the following versions:
- Hibernate FAQ
- Hibernate Forums
- Java Persistence API