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 fix the Hibernate "object references an unsaved transient instance - save the transient instance before flushing" error

I receive following error when I save the object using Hibernate object references an unsaved transient instance - save the …

java hibernate jpa orm entity
JPA EntityManager: Why use persist() over merge()?

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only …

jpa merge entitymanager persist java-persistence-api
What's the difference between JPA and Hibernate?

I understand that JPA 2 is a specification and Hibernate is a tool for ORM. Also, I understand that Hibernate has …

java hibernate jpa jakarta-ee orm
Difference between FetchType LAZY and EAGER in Java Persistence API?

I am a newbie to Java Persistence API and Hibernate. What is the difference between FetchType.LAZY and FetchType.EAGER …

java hibernate jpa orm java-persistence-api
What's the difference between @JoinColumn and mappedBy when using a JPA @OneToMany association

What is the difference between: @Entity public class Company { @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY) @JoinColumn(name = "companyIdRef", referencedColumnName = "…

java hibernate jpa orm one-to-many
PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate

I have a JPA-persisted object model that contains a many-to-one relationship: an Account has many Transactions. A Transaction has one …

java hibernate jpa entity persist
Error creating bean with name 'entityManagerFactory' defined in class path resource : Invocation of init method failed

When I compile my spring project, I got the following error. Error creating bean with name 'entityManagerFactory' defined in class …

java spring hibernate spring-mvc jpa
Spring Boot - Cannot determine embedded database driver class for database type NONE

This is the error that is thrown when trying to run my web app: [INFO] WARNING: Nested in org.springframework.…

java google-app-engine jpa spring-data spring-boot
How do I update an entity using spring-data-jpa?

Well the question pretty much says everything. Using JPARepository how do I update an entity? JPARepository has only a save …

java jpa spring-data-jpa
Setting default values for columns in JPA

Is it possible to set a default value for columns in JPA, and if, how is it done using annotations?

java jpa annotations