merge « Map « JPA Q&A





1. Merging and retrieving children using Hibernate    stackoverflow.com

I have a model that looks like this:

A -- Many-toMany --> B -- Many-toMany --> C
Both A and B have the CascadeType of All and FetchType of Lazy. When I make the ...

2. Hibernate merge issue with one to one mapping    stackoverflow.com

I have a class hierarchy mapped with InheritanceType.JOINED in Hibernate (3.5.6 final) with JPA 2.0 -

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class A{
    private Long id;

    ...

3. JPA 2.0 BI directional one-to-one mapping merge    stackoverflow.com

I am using JPA 2 with hibernate as the vendor. I have 2 entities, Group and GroupFilter. I have a one-to-one bidirectional mapping between them with a join column in GroupFilter referencing ...

4. Hibernate mapping and merging    stackoverflow.com

I have 2 classes like this : Message(id, title, content) MessageEmployee(id, messageId, employeeId, readFlag) and 2 tables like this : MESSAGE(mess_id, mess_title, mess_content) MESSAGE_EMPLOYEE(mess_empl_id, mess_id, empl_id, read_fg) Mapping files :

    <hibernate-mapping package="core">
   ...

5. JPA2 and hibernate - why does merge store child entities whilst persist does not?    stackoverflow.com

I have the usual parent - child OneToMany relationship:

@OneToMany(mappedBy = "mapType", cascade = CascadeType.ALL, orphanRemoval = true)
public List<Child> getChildren() {
    return children;
}
I have fairly standard use cases:
  • Must delete ...

6. JPA - Child merge is also updating Parent    forum.hibernate.org

Hi, In my project, we are maintaining the bidirectional relationship between Parent and Child using @OneToMany( mappedBy) in Parent and @ManyToOne in Child class. Based on the row action property on Parent/Child we call EntityManager.merge() on Parent and Child separately (although both calls may happen in the same transaction). When we call EntityManager.merge(Parent) by clearing out all the children, it is ...

7. Exception in removing bi. OneToOne Child while merge Parent    forum.hibernate.org

Newbie Joined: Wed Jun 08, 2011 4:14 am Posts: 1 Hi, I use Hibernate 3.6.4. I have 2 basic entities "Parent" and "Child" with bidirectional orphanRemoval OneToOne association between them. PropertyAccessException is thrown when I want to remove Child entity from Parent. ... parent.setChild(null); entityManager.merge(parent); entityManager.flush(); ... When I try the same code with eclipselink 2.1.0 everything is ok. Parent has ...

8. Parent/Child merge issue    forum.hibernate.org

We have run into the following issue with Hibernate. I have a parent object with a collection of children in the hibernate session. I also have a detached parent object from a form submission that does not have the collection of childern. Now I do a merge so that I can save the updates to the parent object. If the cascade ...

9. Session merge,update, parent child relationship    forum.hibernate.org

I am trying to model a parent child relationship with a one-to-many and cascade="all" option. I didn't go for bidirectional relationship because I always traverse from parent to child. The persistent objects from the server are retrieved and passed onto gui where they are manipulated and sent back to server. Thus the objects I deal with in the update are transient/detached. ...





10. Unexpected update of parent in merge of parent-child    forum.hibernate.org

Author Message DWright Post subject: Unexpected update of parent in merge of parent-child Posted: Wed Apr 12, 2006 5:40 pm Regular Joined: Wed Jul 07, 2004 2:00 pm Posts: 64 I have a simple eager unidirectional 1-many relationship between Person and Phone. If I read a Person and Phones in one session, then make a change to a Phone ...

11.  mapping does not fully support merge?    forum.hibernate.org

Hibernate version: 3.1.2 Short description: I'm using merge (for reasons I won't get into now) to persist an object graph containing multiple new entities. Hibernate throws an exception when one new entity references another new entity via Long description: I have an mapping on an entity that can be "owned" by other types of entities: Code: ...

12. Merging lazy fetched children    forum.hibernate.org

13. Question on merging Hibernate mappings    forum.hibernate.org

Hibernate Version: 3.x Problem statement: I have 2 projects that were developed separately and that used Hibernate as the persistence mechanism. They used the same class name e.g., Task, but were of course in different packages. Later on it was decided to integrate these 2 projects. But Hibernate complained that there was more than 1 hibernate class with the same name, ...

14. Merging managed parent with new child creates two children.    forum.hibernate.org

Using: spring-2.0.6 hibernate-3.2.4.sp1 hibernate-annotations-3.3.0.ga hibernate-commons-annotations-3.3.0.ga hibernate-entitymanager-3.3.1.ga hibernate-validator-3.0.0.ga Issue: I am using spring/jpa/hibernate for persistence and I am having issues with a very simple scenario. I have two domain objects. Let's call them Parent and Child: Code: @Entity public class Parent { private Long id; private List children; public Parent() ...

15. Dirty map not updating without a specified merge call    forum.hibernate.org

@Entity @Name("user") @Table(name = "customer_user") @Scope(ScopeType.SESSION) @SequenceGenerator(name = "seq", sequenceName = "customer_user_seq") public class User { ... @OneToMany(cascade = javax.persistence.CascadeType.PERSIST) @JoinColumn(name = "user_id", updatable = false) @MapKey(name = "name") @Cascade( { CascadeType.ALL, CascadeType.DELETE_ORPHAN }) @Valid private Map preferences = new HashMap(); ...

16. Hibernate should merge maps...    forum.hibernate.org

If you have an entity that contains a java.util.Map mapped to a table, the map's data does *not* get merged if you call merge against that entity. I'd like to report that as a bug, but I am checking here first to make sure I am not missing anything. My entity mapping looks like this: .... ...





17. Automatically refresh parent when merge on child?    forum.hibernate.org

I have a parent/child relationship such that the parent contains a List of child elements. I am trying to get it so when a child element is updated, the parent's List of child elements is automatically updated. So far, I can't get this to work - it will only update the parent List on the second update of a child. I ...

18. Automatically refresh parent when merge on child?    forum.hibernate.org

I have a parent/child relationship such that the parent contains a List of child elements. I am trying to get it so when a child element is updated, the parent's List of child elements is automatically updated. So far, I can't get this to work - it will only update the parent List on the second update of a child. I ...