About cascade

forum_thread

LAZY @ManyToOne field functions as EAGER

In the code example below (also attached) I would like to understand why I am able to print to console a lazy @ManyToOne field after the entity manager closes. There is a switch DO_VIEW_BEFORE_CLOSE, and when it is true the fields are accessed and output before the finding entity manager closes and as expected both a LAZY @ManyToOne field and an EAGER @ManyToOne field are viewable: b.cLazy:{C}[2]"cLazy"
 b.cEager:{C}[3]"cEager" ... ( fetch = FetchType . LAZY , cascade = CascadeType . ALL ) C cLazy ; ... ( fetch = FetchType . EAGER , cascade = CascadeType . ALL ) C cEager ; ...

 
forum_thread

Performance issues on aggregate query

we are using this aggregate query to collect some data: ... @OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.REMOVE) @Index public List<ObjectProperty> ... @OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.REMOVE) public List<ObjectProperty> ...

 
forum_thread

Cannot sort descending, when ordering by caluculated float in a method

Hi, I have found an issue in ordering by a method. I have two entities : Invoice and InvoiceItem. public class InvoiceItem{ ..     private float price;     private float amount; .. }   public class Invoice{ ... { @ OneToMany ( cascade = CascadeType . PERSIST ) private ... FetchType . EAGER , orphanRemoval = true , cascade = CascadeType . ALL ) private ...

 
issue

ClassCastException after upgrade to 2.3.5_03

On upgrading to the latest version of objectdb I get the following exception on object retrieval: ... OneToOne ( orphanRemoval = true , cascade = CascadeType . ALL , fetch = FetchType . ... OneToOne ( orphanRemoval = true , cascade = CascadeType . ALL , fetch = FetchType . ...

 
forum_thread

Performance in large transactions

Hello, we have a performance problem when we use a large transaction. Let's do exactly the same in several transactions the ObjectDB works much faster. In our use case, we create many new entities and between the creations we call a select query. The execution of the query becomes slower at each iteration. (In the query, we search for an item of type Entity2. However, there is only one entity.)   Pseudocode for the fast and the slow solution FAST: ... MyEntity { @ OneToMany ( cascade = CascadeType . ALL ) private ... { @ OneToMany ( cascade = CascadeType . ALL , mappedBy = "ownerEntity" ...

 
forum_thread

Extra uninitialised entities spawned on merge()

In the following, Element is a base entity class, with a bi-directional @ManyToOne-@OneToMany relationship Element owner - List<Element> ownedElements, and Example is a subclass entity with a relationship @OneToOne Element child. ... ( mappedBy = "owner" , cascade = CascadeType . ALL ) public ...

 
issue

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

Environment: Mac OS X JVM: Java 1.8 u 20 Steps to reproduce Use the following classes: /** Account Class **/ ... }   @ OneToMany ( cascade = { CascadeType . MERGE , CascadeType . ... 1L ;   @ OneToMany ( cascade = { CascadeType . MERGE , CascadeType . ...

 
release

2.4.1

Release date: 2012-06-16 Download (5.4 MB) Binary:  objectdb-2.4.1.zip You should start by following a  tutorial or reading the manual ...

 
forum_thread

Left join fetch behaviour doesn't retrieve children?

Hello support, I'm a little bit confused about a left join fetch behaviour. In this test case, i try to fetch my 3 children using a left join fetch. But my collection is null after closing the em. It was expected to be fetched before closing the em, no ? In fact, that is the objective of the fetch purpose (i guess ?). ... ( targetEntity = MyEntityChild. class , cascade = CascadeType . ALL ) public ... join fetch + various jpa collection combinaison + various cascade combinaison + merge / persist parents and childs + add indexes ) to ...

 
forum_thread

JPA vs JDO - which is more efficient for OneToMany queries?

I'm curious about the trade offs between JDO and JPA. Seems to me that JDO will perform better and be statically typed. For example: Assume there are Customers and Orders.... 2) You have to persist both unless you have automatic cascade persist. In JDO all fields cascade persist operations automatically. In JPA you have to set it per field ...