merge « Entity « JPA Q&A





1. Merging entities in hibernate    stackoverflow.com

what is the best way to do this: I have some entities stored as Hibernate entities and they contain some fields that needs to be unique for single row. So when i ...

2. JPA: is merging ever necessary for attached entities?    stackoverflow.com

Is it correct that I never need to use EntityManager#merge(), as long as I only deal with attached managed entities? In other words, calling merge() on an attached managed entity has ...

3. JPA entity updated only after method is done    stackoverflow.com

I have an Asynchronous annotated method which receives an entity though the method parameter. In this method I try to set a variable three times:

@Inject EntityDao entityDao;

@Asynchronous
public Future<String> doSomething (MyEntity p_myEntity) ...

4. Problems with Merging JPA Entities    forums.netbeans.org

I have two tables (a and b) that have an association to each other in a join table. When I try adding a new entry to the join table by creating a new entry in table a using the merge(), the entry is added to the join table. The problem is if I try adding a new entry in the join ...

5. Merging Entities in Web Application    forum.hibernate.org

The following entities are defined in my system: Code: @Entity @Table(name="roles") public class Role { @Id @GeneratedValue @Column(name="ROLE_ID") private Long id; @OneToMany( fetch=FetchType.LAZY, cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE}, ...

6. Strange hibernate requests when merging an Entity.    forum.hibernate.org

Hi. I noticed a strange behaviour when I'm trying to merge an Entity using the EntityManager. First of all, the entities: Code: @Entity public class Import implements Serializable { ... @OneToMany(targetEntity = MicroAction.class, cascade = { CascadeType.ALL }, fetch = FetchType.LAZY) private List microActions; ... Code: @Entity @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn( name="microActionType", ...