Tag: JPA
-
Descriptive names for column constraints in Hibernate
by
Hibernate (re-)generates names for database constraints such as foreign keys or unique columns when creating a schema. However, the names for indexes and unique keys are not very descriptive, since they are created from a hash string of the table and column name. Unreadable technical names may seem just to be an insignificant ugliness, but…
-
Enhancing Hibernate’s metadata model
Hibernate internally uses an abstract metadata model to validate the data model defined by the declared entities. The framework also offers entry points to enhance this metadata model with custom code. In this article we show how to extend the generated metadata model using annotations. Our example is to implement a convenient way to define…
-
Creating “inherited” indexes with JPA/Hibernate
For optimal performance developers often define database indexes in the JPA data model classes. While this is relatively easy at entity class level, it becomes quite cumbersome if you your model consists of a deeply nested inheritance hierarchy using “mapped” super classes. I.e., there is no direct way that indexes defined for super classes will…
-
JPA Pitfalls (16): EntityManager.remove Does Not Remove Entity
This blog article is part of a “series of blog articles” about common pitfalls using JPA and ways to avoid them. In this article, we describe a problem with entites not beeing removed altough EntityManager.remove succeeds.
-
JPA Pitfalls (14): EntityManager.persist and Transactions
This blog article is part of a “series of blog articles” about common pitfalls using JPA and ways to avoid them. In this article, we describe the result of EntityManager.persist inside and outside of a transaction.
-
JPA Pitfalls (12): Lazy Loading of Relationships in a Loop
This blog article is part of a “series of blog articles” about common pitfalls using JPA and ways to avoid them. In this article, we describe a potential performance problem when loading relationships in a loop.
-
JPA Pitfalls (11): Iteration / Sorting in Memory or in DB
This blog article is part of a “series of blog articles” about common pitfalls using JPA and ways to avoid them. In this article, we describe a potential problem when filtering in memory instead of DB.

You must be logged in to post a comment.