Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.
Articles
For our Portuguese readers, this article gives a very good introduction to database transactions and isolation levels.
Hibernate Query Cache can help you reduce the number of queries that are sent to the database, but you have to pay attention to the entity cache expiration policy, as otherwise, you might bump into N+1 query problems.
The Hibernate @Immutable
annotation allows you to optimize the Persistence Context size and the dirty checking mechanism
if entities should never be modified. For more details, check out
this article.
When mapping bidirectional associations, it is very important to synchronize both sides of the association. Otherwise, you might encounter inconsistencies which prevent entity state transitions from being propagated to the database.
If you’re using Spring Boot, check out
this tutorial
about mapping a @OneToMany
JPA association.
With Hibernate 5.2.17, you can now use the @PrePersist
and @PreUpdate
entity listeners even on embeddable types.
For more details, check out
this article.
With Hibernate, you can map a @ManyToOne
association using the result of a query, as explained in
this article.
Time to upgrade
There were several Hibernate project releases since the last newsletter:
-
Hibernate Search 5.10.0 CR1
Questions and answers
-
How can I set Hibernate to fix the “fetch first ? rows only” in Oracle
-
Write not equal Restriction with Hibernate Criteria if the particular column is not null
-
Hibernate returns different results for the same query than directly on SQL Server
-
How does Hibernate determine whether an entity needs to be updated?
-
What is the Java annotation in Hibernate used to auto increment a MySQL Primary Key -
@Id