persist « Insert « JPA Q&A





1. JPA: persist does not insert into join table    stackoverflow.com

All, I am using JPA for this application and annotations for Mapping entities. I have an entity called UserStory and another one called Revision. There is a OneToMany for UserStory to Revision.

@Entity
@Table(name ...

2. JPA: premature INSERTing on persist()    forum.hibernate.org

I am observing a behaviour of Hibernate used as JPA provider which I cannot understand. Could you please help? I have to import external data into existing and possibly new persistent entities. The code I wrote does the following (in a transaction using a transaction-scoped entity manager): (1) Try to find an existing entity using the business key (taken from the ...

3. why em.persist() immediately inserts data into database?    forum.hibernate.org

all managed objects need to have assigned a primary key before it can be added to the persistence context. I guess you're using a type of primary key which is generated by the database (like mysql autoincrements?) so Hibernate needs to send the INSERT statement to the database in order to have a PK assigned. This doesn't change semantics as of ...

4. How to insert a new line in persistent ArrayList?    forum.hibernate.org

Hi, First of all, thanks for reading this post. Please, help me! I do not know How can I insert a new line in an persistent ArrayList. I mean that I got an ArrayList from the database, and I want to insert a new line in this ArrayList, but When I tries to update the list, this error message is shown ...

5. Customize SQL statements when inserting/persisting entities    forum.hibernate.org

Hi *, we have an existing legacy database schema to which we have to map our new domain model. Currently EclipseLink is used as JPA implementation but because of the tighter integration with JBoss we want to migrate to Hibernate. Because of the complexity of the mapping to that database schema we have to execute more than one SQL insert statement ...

6. Cant insert object, save dont persist item    forum.hibernate.org

7. Insert rolling back but persistent object updated    forum.hibernate.org

Thank you for your response. My question is why is it null. I am using generated id's for the Identifier field on all of my tables. This is defined in all of my .hbm files. I believe that the way saveOrUpdate() works is that if the object already exists in the db then it does not assign a new id but ...

8. Data Insert/Update not persist    forum.hibernate.org

Hi When I do select all I got it all but the database hase no change. and I so that it add a user with incremental id (not the id that I gave it). There is somthing thet I need to change in the mySql configuratio? the twice "hbm2ddl.auto" its becuase I didn't noetic that its there. This is the completely ...

9. Inserting an object containing non-persisted objects    forum.hibernate.org

Hello all, I have the following standard bean objects as follows: Code: class A implements Serializable { private Long id; private Point point; private String name; ... } class Point implements Serializable { private int x; private int y; ... } Class A is marked as an ...