About cascade

forum_thread

Relationship Annatations

hi,   what is the purpose of annotating a field with a RDB relationship shuch as OneToMany. ManyToMany etc? #1 2012-09-27 05:34 hi,   what is the purpose of annotating a field with a RDB relationship shuch as OneToMany. ...

 
forum_thread

OrphanRemoval not working?

Dear all, I have entities Invoice and InvoiceItem, their relation is defined: public class Invoice implements Serializable { ..     @OneToMany(mappedBy = "invoice", fetch= FetchType.EAGER, orphanRemoval=true, cascade= CascadeType.ALL)     private List<InvoiceItem> invoiceItemList; .. } ... EAGER , orphanRemoval = true , cascade = CascadeType . ALL ) private ...

 
manual

DELETE Queries in JPA/JPQL

Explains how to apply server side bulk delete using a JPA/JPQL query. As explained in chapter 2 , entity objects can be deleted from the database by: Retrieving the entity objects into an EntityManager . Removing these objects from the EntityManager  within an active ...

 
forum_thread

Mapped By Fetch is very Slow

Well ! I think i pointed out a HUGE performance issue with mapped-by attribute (yeah again :( ). Here is the test case : 1- Create 100 000 entities with for each 1 entity with @OneToOne(mappedBy attribute) 2- Retrieve only 10 000 for testing 3- Wait ... On my AMD FX 8350, it took 60s Now, go the MyEntity class and remove "mapped-by". You obtain 1 second max of query fetch. ... ( targetEntity = MyEntityChild. class , cascade = CascadeType . ALL , mappedBy = "myEntity" ...

 
forum_thread

LifeCycle Event with Embeddable classes

Hello, is there a way that lifecycle events like prepersist or preupdate are also fired for embeddable classes, not just for entities? My case looks as follows: ... description ;   @ OneToMany ( cascade = CascadeType . ALL , fetch = FetchType . ...

 
forum_thread

LEFT (OUTER) JOIN problem when mappedBy is defined

Hi all, I want to get objects with their lists, even when the lists are empty. So I've witten this query: "SELECT i FROM Invoice i LEFT OUTER JOIN i.itemList items" But this query never returns invoices without items! Only invoices with items. When I remove mappedBy from @OneToMany annotation, LEFT JOIN works correctly. Is this normal behaviour? Thank you Michael   Sample application ... FetchType . EAGER , orphanRemoval = true , cascade = CascadeType . ALL ) private ...

 
forum_thread

Different behavior with persist() and queried instances?

Hi, We have a simple class that by itself contains (among others) a property pointing to a collection: class Bla {  @OneToMany(cascade = CascadeType.ALL) private List<AttributeEntity> metaAttributes = new ArrayList<AttributeEntity>(); } ... Bla { @ OneToMany ( cascade = CascadeType . ALL ) private ...

 
forum_thread

orphanRemoval = true not working when CascadeType.REMOVE is disabled

Dear all, I have entities Employee and Address, their relation is defined (full example in attachment): @Entity     public static class Employee { ....         @OneToMany(orphanRemoval = true)         private Set<Address> addresses; I'm expecting, that removing Employee from db, addresses has been too, but I can see, that the Address is still: ... try use  @ OneToMany ( cascade = CascadeType . REMOVE ) Address ...

 
forum_thread

An ArrayIndexOutOfBoundsException with nested entities and enhanced entities

We have a new issue like the issue in the forum task http://www.objectdb.com/database/forum/1075. This issue is very important for us, because we want to create a release soon. ObjectDB version: 2.6.8_06 All our entities are enhanced. There are nested entities in following hierarchy: @Entity @Access (AccessType.FIELD) public abstract class ModifierImpl extends DataTypeImpl implements Modifier { ... ( targetEntity = DataTypeImpl. class , cascade = { CascadeType . ALL } , fetch = ...

 
forum_thread

The exception "Attempt to remove a detached entity object" have no information about the entity

Hello, the exception "Attempt to remove a detached entity object" have no information about the detached entity. It is very hard, especially if the involved entities uses cascading, to find the removed call for the detached entity.   It would be very helpful if you can add a few information to the Exception. Maybe: The class of the Entity and the id (Field annotated with @ID), or just the String representation of the entity. #1 2017-03-22 12:50 Hello, the exception "Attempt to remove a detached entity object" have no information about the detached ...