JPA Entity Graphs: How to Define and Use a @NamedEntityGraph
| |

JPA Entity Graphs: How to Define and Use a @NamedEntityGraph

Lazy loading is often an issue with JPA. You have to define at the entity if you want to use FetchType.LAZY (default) or FetchType.EAGER to load the relation and this mode is always used. FetchType.EAGER is only used if we want to always load the relation. FetchType.LAZY is used in almost all of the cases…

Criteria Update/Delete – The easy way to implement bulk operations with JPA2.1
| |

Criteria Update/Delete – The easy way to implement bulk operations with JPA2.1

JPA 2.1 added a list of nice features to the specification. One of them is the support for bulk update and delete operations in the Criteria API. We will have a look at the new CriteriaUpdate and CriteriaDelete classes in this article. If you like to learn more about the other features added in JPA 2.1, have…