Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.
Interviews
Don’t miss our Hibernate developer interview with Dmitry Alexandrov.
If you want to share your story about Hibernate, let us know, and we can share it with our huge community of passionate developers.
Articles
I was told about a new blog post which proclaims that Lazy loading is a code smell. Well, in my experience, this is exactly the opposite since I’m a strong believer that EAGER fetching is almost always a bad way of fetching data. After reading Sebastian Malaca’s article, I managed to find a very interesting series of article on mixing JPA and DDD (Domain-driven design).
DDD is a great approach. However, trying to treat a relational database as if it were a document store can be very detrimental to application performance. All in all, JPA entities are not the same as DDD entities. In fact, JPA entities are just the persistent state of the Domain Model.
Orlando L Otero wrote a tutorial about implementing a Multitenant architecture on top of Spring, Hibernate, and PostgreSQL. Related to Multitenancy, I found this Microsoft article from 2006 very relevant to the day.
Choosing the right entity identifier strategy requires some knowledge of the underlying JPA provider.
For this reason, if you want portability, check out how you can
replace the suboptimal TABLE
strategy with SEQUENCE
or IDENTITY
.
Mike Rocke wrote a very nice review of the High-Performance Java Persistence book.
Thorben Janssen wrote a short guide which introduces several JPQL query features. For more on this topic, check out the exhaustive JPQL and HQL chapter in the Hibernate 5 User Guide.
Gregg Bolinger offers a very nice solution to truncating all tables when running integration tests with Spring Boot and Hibernate.
Hibernate entity queries are suitable when you want to modify the fetched entities, and taking advantage of the dirty checking mechanism. However, if you want to take advantage of advanced SQL query capabilities, you need native SQL queries. Check out this article to learn why native SQL queries are a Magic Wand.
Time to upgrade
-
Hibernate ORM 5.2.7, as well as 5.1.4 and 5.0.12 have been released.
-
Hibernate Validator 5.4.0 CR1 is out.
Questions and answers
-
https://www.quora.com/When-do-you-decide-that-it-is-time-to-create-database-View
-
What is the difference between Hibernate and Spring Data JPA?
-
How to make this
SELECT * FROM
2 joined tables query in HQL? -
Spring Data REST + JPA remove from OneToMany collection [not owner side]
-
How to call a Stored Procedure from Hibernate having both IN and OUT parameters?
-
QueryCache is not working when record is not available in the Database
-
Removing entity from a
@ManyToMany
bidirectional association