Top "Jpa" questions

The Java Persistence API (JPA) is a Java specification for accessing, persisting, and managing data between Java objects/classes and a relational database.

How to map calculated properties with JPA and Hibernate

My Java bean has a childCount property. This property is not mapped to a database column. Instead, it should be …

java hibernate jpa orm hibernate-mapping
JPA eager fetch does not join

What exactly does JPA's fetch strategy control? I can't detect any difference between eager and lazy. In both cases JPA/…

java hibernate jpa join
What does EntityManager.flush do and why do I need to use it?

I have an EJB where I am saving an object to the database. In an example I have seen, once …

java jpa entitymanager
Spring Data JPA and Exists query

I'm using Spring Data JPA (with Hibernate as my JPA provider) and want to define an exists method with a …

java hibernate jpa spring-data jpql
Getting Database connection in pure JPA setup

We have a JPA application (using hibernate) and we need to pass a call to a legacy reporting tool that …

java hibernate orm jpa jdbc
How can i get the session object if i have the entity-manager

I have private EntityManager em; public List getAll(DetachedCriteria detachedCriteria) { return detachedCriteria.getExecutableCriteria("....").list(); } How can I retrieve the session …

java hibernate jpa hibernate-entitymanager
Spring data JPA query with parameter properties

What is the simplest way of declaring a Spring data JPA query that uses properties of an input parameter as …

spring jpa spring-data spring-data-jpa
Java - JPA - @Version annotation

How does @Version annotation work in JPA? I found various answers whose extract is as follows: JPA uses a version …

java jpa jpa-annotations
Parameter in like clause JPQL

I am trying to write a JPQL query with a like clause: LIKE '%:code%' I would like to …

java jpa eclipselink jpql sql-like
How to create a JPA query with LEFT OUTER JOIN

I am starting to learn JPA, and have implemented an example with JPA query, based on the following native SQL …

java jpa jpql