SyntaxFix
Write A Post
Hire A Developer
Questions
🔍
[java] What's the difference between session.persist() and session.save() in Hibernate?
Home
Question
What's the difference between session.persist() and session.save() in Hibernate?
Here is the difference:
save:
will return the id/identifier when the object is saved to the database.
will also save when the object is tried to do the same by opening a new session after it is detached.
Persist:
will return void when the object is saved to the database.
will throw PersistentObjectException when tried to save the detached object through a new session.
Examples related to
java
•
Under what circumstances can I call findViewById with an Options Menu / Action Bar item?
•
How much should a function trust another function
•
How to implement a simple scenario the OO way
•
Two constructors
•
How do I get some variable from another class in Java?
•
this in equals method
•
How to split a string in two and store it in a field
•
How to do perspective fixing?
•
String index out of range: 4
•
My eclipse won't open, i download the bundle pack it keeps saying error log
Examples related to
hibernate
•
Hibernate Error executing DDL via JDBC Statement
•
How does spring.jpa.hibernate.ddl-auto property exactly work in Spring?
•
Error creating bean with name 'entityManagerFactory' defined in class path resource : Invocation of init method failed
•
JPA Hibernate Persistence exception [PersistenceUnit: default] Unable to build Hibernate SessionFactory
•
Disable all Database related auto configuration in Spring Boot
•
Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
•
HikariCP - connection is not available
•
Hibernate-sequence doesn't exist
•
How to find distinct rows with field in list using JPA and Spring?
•
Spring Data JPA and Exists query