I recently stumbled upon this punchy one-liner: No More Hibernate!. At first, I couldn’t believe what I read. Then, scrolling down, I noticed that the site was linked to jOOQ, a framework that advocates for SQL to have a first-class status in Java: SQL was never meant to be abstracted. To be confined in the narrow boundaries of heavy mappers, hiding the beauty and simplicity of relational data. SQL was never meant to be object-oriented. SQL was never meant to be anything other than
Envers is a Hibernate module that can be configured to automatically audit changes made to your entities. Each audited entity are thus associated with a list of revisions, each revision capturing the state of the entity when a change occurs. There is however an obstacle I came across while I was 'unit testing' my DAO, and that’s what I want to share to avoid others to fall in the same pit. First, let’s have an overview of the couple of steps needed to use Envers: Annotate your enti
This is the 7th post in the Hibernate hard facts focus series. In this post, we'll have a look at the difference between saveOrUpdate() and merge(). Hibernate's way for updating entities is through the update() method. We can get an object, detach it from the session and then update it later with no problem.
With such a controversial title, I’m bound to be the target of heated comments. Although provocative, such is not my goal, however, I just want to initiate an educated debate between people that are interested into thinking about the problem. The origin of this post was a simple discussion between developers of different level of experience on Hibernate. The talk was about eager-, lazy-loading and the infamous LazyInitializationException. Since I imagine not everyone has the problem in hi
This is the 6th post in the Hibernate hard facts focus series. In this article, I will show you how to use the fetch profile feature introduced in Hibernate 3.5. Lazy loading is a core feature in Hibernate: it saves memory space. The reasoning behind it is, if you don't use an association, you don't need the object and thus, Hibernate does not load it into memory. Hibernate fills the lazy loaded attribute with a proxy that makes the SQL request when the getter is called.
This review is about Spring Persistence with Hibernate by Ahmad Reza Seddighi from Packt Publishing. Facts 15 chapters, 441 pages, 38€99This book is intended for beginners but more experienced developers can learn a thing or twoThis book covers Hibernate and Spring in relation to persistence Pros The scope of this book is what makes it very interesting. Many books talk about Hibernate and many talk about Spring. Yet, I do not know of many which talk about the use of both in relation to per
This is the 2nd post in the Hibernate hard facts focus series. Hibernate is a widely-used Object Relational Mapping framework. Many organizations use it across their projects in order to manage their data access tier. Yet, many developers working on Hibernate don't fully understand the full measure of its features.
This is the 1st post in the Hibernate hard facts focus series. Hibernate is a widely-used Object Relational Mapping framework. Many organizations use it across their projects in order to manage their data access tier. Yet, many developers working on Hibernate don't fully understand the full measure of its features.
With new JEE 5 standard has come the EJB3 specifications. From an historical point of view, EJBs come into 3 different flavors: (i) Entity for persistence, (ii) Session for business logic and (iii) Message-Driven for listeners. Entity EJB are the most time-consuming to develop in their 2.1 version. Apart from the inherent complexity of EJB (local and remote interfaces, homes), developing an EJB 2 is error-prone because of the mapping mechanism. All in all, EJB 2 development really needs a very sp