Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.
Articles
On Baeldung, you can find a very good article about JPA and Hibernate pagination. While JPA 2.2 defines support for Java 1.8 Stream operations. pagination is still the proffered way to controlling the amount of data being fetched.
Have you ever wondered how you can map a JPA many-to-many association with extra column? If you are interested in the best way to much a a relationship, then you should definitely read this article.
If you’re using a relational database, then you should be using a connection pool as well. Check out this article for an performance analysis of the most common Java connection pools. You will also need connection pool monitoring, and the FlexyPool open source framework allows you to do so.
Hibernate offers a dirty checking mechanism which automatically detects changes to managed entities. While the default mechanism is suitable for most use cases, you can even customize it as explained in this article.
If you ever wondered why you got the HHH000179: Narrowing proxy to class this operation breaks == warning message or wondered how to fix it, then you should read this article wrote by Marcin Chwedczuk.
Traditionally, storing EAV (Entity-Attribute-Value) data in a RDBMS has required various tricks to handle multiple value types.
Now that most relational databases support JSON column types,
you can use a custom Hibernate type to store your EAV data as a JsonNode
object.
Check out
this article
for a step-by-step tutorial that will show you how you can accomplish this task.
Joe Nelson wrote a great article about the difference between various SQL isolation levels with examples for various phenomena like read skew, write skew or lost updates.
Thorben Janssen gives you some tips about mapping the Many-To-One and One-To-Many associations. For more details, check out the best way to map a @OneToMany relationship with JPA and Hibernate article as well.
Time to upgrade
-
Hibernate Validator 6.0 has been released with Bean Validation 2.0 support.
-
Hibernate ORM 5.2.9 is out with many improvements and bug fixes.
Questions and answers
-
What are some best practices for handling large data with Hibernate?
-
What is the difference between projections and restrictions in Hibernate framework?
-
What are some tips, tricks and gotchas when using Spring Data JPA for database access?
-
How does Hibernate detect the dirty state of an entity object?
-
Is it possible to limit the size of a @OneToMany collection with Hibernate or JPA Annotations?
-
How to define database generated column values as readonly fields in JPA and Hibernate?
-
What’s the difference between PESSIMISTIC_READ and PESSIMISTIC_WRITE in JPA?
-
Why do I need Transaction in Hibernate for read-only operation?
-
Refresh and fetch an entity after save (JPA/Spring Data/Hibernate)
-
Database inserts fail with no transaction error when UPGRADED to Spring 4.3.7 and Hibernate 5.2.9
-
The
hibernate.default_schema
configuration property doesn’t work properly