About lazy

forum_thread

OneToMany and cascade delete problem

Hi, I don't really know if this is a bug or maybe model that I make is bad. I have a problem with with two different classes with OneToMany relation to one, shared class. For example (first class): @Entity public static class Store { @OneToMany(targetEntity = Offer.class, mappedBy = "store") private List<Offer> offers; } second class: ... = "product" , fetch = FetchType . LAZY , cascade = CascadeType . ALL ) private ...

 
api-jpa

Basic.fetch

(Optional) Defines whether the value of the field or property should be lazily loaded or must be eagerly fetched.(Annotation Element of javax.persistence.Basic)

 
api-jpa

ManyToOne.fetch

(Optional) Whether the association should be lazily loaded or must be eagerly fetched.(Annotation Element of javax.persistence.ManyToOne)

 
api-jpa

ManyToMany.fetch

(Optional) Whether the association should be lazily loaded or must be eagerly fetched.(Annotation Element of javax.persistence.ManyToMany)

 
forum_thread

Speeding up reporting queries with size() on list

Hi, I'm working on some reporting stuff in our application. One of few different reports should include activity on last modified objects. The query for now looks like this: select date(insp.lastModificationDate), insp.modifiedBy, insp.description.length(), insp.products.size(), insp.picture from Inspiration insp order by date(insp.lastModificationDate) desc insp.description is normal String field in Inspiration entity. insp.products is a list with 0 to 600 objects. Definition: ... = Product. class , fetch = FetchType . LAZY ) private List<Product> products ; There is ...

 
forum_thread

Merge of entity classes with "mapped by" very slow

Hi, I have found a strange behavior when merging entities with "mapped by" set on @OneToMany relation. Even if object is fetched with find on the same transaction, merge is very slow. It's because on merge every single relation marked as LAZY is fetch from database. Attached two examples - one with mapped by, second with adding entities list without "mapped by". The difference is huge event for such small objects - 2ms (without mapped by) vs ~50ms (with mapped by) ... It's because on merge every single relation marked as LAZY is fetch from database. Attached two examples - one with mapped ...

 
api-jpa

javax.persistence.ElementCollection

Defines a collection of instances of a basic type or embeddable class.(Annotation of JPA)

 
forum_thread

Adding EntityListener Throws Unexpected Internal Exception

I tried adding EntityListener for a entity class and an exception was thrown. I followed similar as mentioned on the documentation but no luck. My entity class looks like below: ... ManyToOne ( fetch = FetchType . LAZY ) private SomeClass someClass ;   ... ...

 
issue

Mapped by fields are not initialized by JOIN FETCH in queries

As demonstrated in this forum thread, a mapped by collection field with lazy fetch mode is not initialized in results of a query that uses JOIN FETCH on that collection field (when enhancement is used). ... this forum thread , a mapped by collection field with lazy fetch mode is not initialized in results of a query that uses JOIN FETCH ...

 
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 { ... . ALL } , fetch = FetchType . LAZY ) private DataTypeImpl toBeModified ;   @ ...