About cascade

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

Double persist of Entity field with Cascade.ALL

I am building a JavaEE application using Netbeans 7.0.1, Glassfish 3.1 and ObjectDB 2.3.3. I have a Book class with entity field Chapter which has a CascadeType.ALL property. The Book fields are as follows: @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String bookTitle; @OneToMany(cascade= CascadeType.ALL, fetch= FetchType.EAGER) private List<Chapter> chapters; The Chapter fields are as follows: ... String bookTitle ; @ OneToMany ( cascade = CascadeType . ALL , fetch = FetchType . ...

 
forum_thread

Remove not working

Hello! We have a strange problem. ... com.objectdb.o.TVS.j(TVS.java:169) at com.objectdb.o.TVS.cascade(TVS.java:156) at com.objectdb.o.TVS.g(TVS.java:105) at ... @ OneToMany ( mappedBy = "a" , cascade = CascadeType . REMOVE ) private ...

 
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 ...

 
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

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 ...

 
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

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

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 ; ...

 
release

2.3.3

Release date: 2011-11-10 Download (5.49 MB) Binary:  objectdb-2.3.3.zip You should start by following a  tutorial or reading the manual ...