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 can I make a JPA OneToOne relation lazy

In this application we are developing, we noticed that a view was particularly slow. I profiled the view and noticed …

java hibernate jpa lazy-loading one-to-one
How does the FetchMode work in Spring Data JPA

I do have a relation between three model object in my project (model and repository snippets in the end of …

java spring hibernate jpa spring-data-jpa
Default fetch type for one-to-one, many-to-one and one-to-many in Hibernate

What is the default fetch type in hibernate mappings? What I got to know after exploring is: for one-to-one it …

java hibernate jpa
How to generate the JPA entity Metamodel?

In the spirit of type safety associated with the CriteriaQuery JPA 2.0 also has an API to support Metamodel representation of …

java hibernate jpa annotation-processing metamodel
What is Persistence Context?

I am new to the Java world and JPA. I was studying JPA and came across many new terms like …

java jpa orm persistence
How to force Hibernate to return dates as java.util.Date instead of Timestamp?

Situation: I have a persistable class with variable of java.util.Date type: import java.util.Date; @Entity @Table(name = "…

java hibernate jpa mapping
What is the best way to update the entity in JPA

I am doing some CRUD operations using JPA. For updating an object which is the right way to do? Through …

java jpa entitymanager
JPA COUNT with composite primary key query not working

In my db, I have a table (Defaults), and when I generate an entity from table, I get these two …

sql hibernate jpa count composite-primary-key
JPA mapping: "QuerySyntaxException: foobar is not mapped..."

I've been playing around with a very simple JPA example and am trying to tweak it to an existing database. …

java mysql hibernate jpa
JPA passing list to IN clause in named native query

I know I can pass a list to named query in JPA, but how about NamedNativeQuery? I have tried many …

jpa arraylist in-clause nativequery