collection « Cascade « JPA Q&A





1. Hibernate 2: net.sf.hibernate.HibernateException: You may not dereference a collection with cascade=    coderanch.com

I am getting net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan" All I am doing is running a select query: "from Book book item where book.read= false order by item.writtenDate desc" It does not make any sense... Please help. Thanks, John. PS. Here is the full stack trace 1.1 net.sf.hibernate.HibernateException: You may not dereference a collection with cascade="all-delete-orphan"net.sf.hibernate.HibernateException: You may ...

2. JPA Cascade ALL update collection elements    forum.hibernate.org

Hi, can anyone help me with this problem? I have two entities (products and attributes of the product) mapped with annotations this way: ProductVO --> 1-N --> AttribVO ProductVO ---------------- @OneToMany(fetch=FetchType.EAGER,mappedBy="product",cascade=CascadeType.ALL) @OrderBy("order ASC") @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) private List attribs; AttribVO ---------------- @ManyToOne @JoinColumn(name="LPRODUCTID") private ProductVO product; I have two attributes "a" and "b" for the product. If I set a new list of ...

3. How to get Hibernate to cascade save/update to collection?    forum.hibernate.org

Hibernate version: 3.0rc1 How can I get Hibernate to persist entries in the objectMap below? It seems that the cascade operation will not be performed if the element type is not of an Entity/Component/Any type. The mapping fragment below shows the mapping I use. Mapping documents: Code: ... ...

4. org.hibernate.HibernateException: A collection with cascade=    forum.hibernate.org

Author Message GoodDog Post subject: org.hibernate.HibernateException: A collection with cascade= Posted: Fri Apr 21, 2006 10:06 am Beginner Joined: Thu Feb 23, 2006 11:22 am Posts: 30 org.hibernate.HibernateException: A collection with cascade="all-delete-orphan HIBERNATE VERISON: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: 1.4.2_09-b05 (Sun Microsystems Inc.) Hibernate-Version: 3.1.2 THE MAPPING FILES: This is the parent object: Code:

5. Cascade saving new item in collection twice    forum.hibernate.org

Hibernate version: 3.2 GA and annotation 3.2 GA Mapping documents: @Entity public class Entity { // Has a DB generated id @OneToMany (mappedBy = "entity", cascade = CascadeType.ALL) private List things; // Getters and setters } @Entity public class Thing { // Has a DB generated id @OneToOne(optional = false) @JoinColumn(name = "entity_id", nullable = false) private Entity entity; // Getters ...

6. Dummy collection for cascade purposes only    forum.hibernate.org

Hi, I am thinking of technique similar to this http://opensource.atlassian.com/projects/hibernate/browse/HHH-552 but applied to collections. I would like to define a association in hbm but I don't need it at the POJO level. The only purpose of this association (collection) is to define cascade="delete" which will delete all associated objects when its parent is deleted. There is no update="false" attribute available on ...