Key annotations you need to know when working with JPA and Hibernate

Key annotations you need to know when working with JPA and Hibernate

When you start learning and using Hibernate and JPA, the number of annotations might be overwhelming. But as long as you rely on the defaults, you can implement your persistence layer using only a small subset of them. After you have mastered the basic annotations, you can take a look at additional customization options. You…

Why, When and How to Use DTO Projections with JPA and Hibernate
|

Why, When and How to Use DTO Projections with JPA and Hibernate

DTOs are easy to use and the most efficient projection for read-only operations. So, whenever you don’t need to change the requested information, you should prefer a DTO projection. But what exactly is a DTO? How does such a projection work with Hibernate? And how can you use it in your queries? I will answer…

Access Strategies in JPA and Hibernate – Which is better, field or property access?
|

Access Strategies in JPA and Hibernate – Which is better, field or property access?

The access strategy defines how your JPA implementation, e.g., Hibernate or EclipseLink, access your entity attributes. You can choose between field-based access and property-based access: If you use field-based access, your JPA implementation uses reflection to read or write your entity attributes directly. It also expects that you place your mapping annotations on your entity attributes….

5 Things Beginners Need to Know Before Using JPA / Hibernate / EclipseLink
|

5 Things Beginners Need to Know Before Using JPA / Hibernate / EclipseLink

A solid understanding of JPA and its implementations is still one of the most in-demand skills among Java developers. So, it’s no surprise that there are several blog posts, books, and courses available that teach you how to implement a persistence layer using the JPA specification. I even recorded a JPA for Beginners course myself. But…