About eager

manual

Retrieving JPA Entity Objects

Explains how to use JPA to retrieve entity objects from the database.... by Class and Primary Key Retrieval by Eager Fetch Retrieval by Navigation and Access ... to be set from another entity object. Retrieval by Eager Fetch Retrieval of an entity object from the database might cause ...

 
api-jpa

FetchType.EAGER

Defines that data must be eagerly fetched.(Enum Constant of javax.persistence.FetchType)

 
forum_thread

Lazy Init / Eager / Join Fetch collection strategy ? What to choose ?

Hello, I'm doing some tests to choose the best collection fetch strategy. I have entities with many lazy collections and i don't want to load them all. In JPA / Hibernate world it exist some tests demonstrating how to choose the best strategy. For example : http://zeroturnaround.com/rebellabs/how-to-use-jpa-correctly-to-avoid-complaints-of-a-slow-application/ In this article,join fetch seems to be the right choice. What about ObjectDb ? The implementation is totally different. ... implementation is totally different. Is an "All eager strategy" more efficient that many join fetch ( cartesian product + ... In my first impressions ( not tested with metrics ), "all eager fetch" strategy seems to be more efficient than only fetch required ...

 
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" ... closes and as expected both a LAZY @ManyToOne field and an EAGER @ManyToOne field are viewable: b.cLazy:{C}[2]"cLazy"
 ... ManyToOne ( fetch = FetchType . EAGER , cascade = CascadeType . ALL ) C cEager ...

 
issue

Bulk load of eager mapped by (inverse) relationships

When a collection of objects is retrieved by ObjectDB (e.g. by a query) ordinary referenced objects and collection of objects that have to be loaded eagerly are loaded in bulk for better performance. However, inverse (mapped by) references that have to be loaded eagerly currently do not participate in a bulk load, which means that every reference requires running a separate query and doing a separate client-server round trip. Future versions of ObjectDB should load eager mapped by (inverse) fields in bulk as well. ... trip. Future versions of ObjectDB should load eager mapped by (inverse) fields in bulk as well. ... 06:50 Bulk load of eager mapped by (inverse) singular references is now supported in build ...

 
forum_thread

Eager Fetch is not stable for collection or map types?

Hi, thanks very much for your helpful software. The problem is the storage of collection or map types is not stable, we lost them sometimes after JVM restarted. Eager fetch is properly set.And we still found that the storage is stable when we not use generic, such as "private List users = new ArrayList();" instead of "private List<User> users = new ArrayList<User>();".   The code about entity and fetch is: ... is not stable, we lost them sometimes after JVM restarted. Eager fetch is properly set.And we still found that the storage is stable when ... ( fetch = FetchType . EAGER )   private List<Player> members = ...

 
issue

Eager load Map

I'm having an issue eager loading a nested map. I've attached @ManyToMany(fetch=FetchType.EAGER) attributes to no avail. If the map is viewed in the debugger or force iterated in the code it loads ok. The attached code attempts to replicate the scenario. Its not an exact match but is the best I could come up with without replicating the whole system. The test creates an object, persists it to a db and re-loads it. The EntityManager is closed before accesing any fields. Finally the nested map is accessed and printed to screen. ... I'm having an issue eager loading a nested map. I've attached @ManyToMany(fetch=FetchType.EAGER) attributes to no avail. If the map is viewed in the debugger or force ... There was a bug in eager fetch of collections and maps of simple values. Build 2.3.2_04 ...

 
forum_thread

Fetch a whole entity graph eager

Hello, I have two question at you. Are you provided JPA 2.1 annotation @NamedEntityGraph in next version ObjectDB 3.0? And do you know an easy possibility to get an entirely eager entity graph with all depended entities which we can use as a detached full accessible entity graph outside a transaction without lazy loading? Best regards ... And do you know an easy possibility to get an entirely eager entity graph with all depended entities which we can use as a detached ... Currently supported: Field level  eager fetch. JOIN FETCH queries . JDO fetch ...

 
issue

Eager Fetch of Map with Entities as Keys

Loading eagerly a map that uses entity objects as keys is currently unsupported, if the equals and hashCode method of the keys are based on the key entity content, since it is unavailable during instantiation of the map. The following test case demonstrates the problem: ... OneToMany ( fetch = FetchType . EAGER ) Map map = new HashMap ( ) ; ...

 
forum_thread

Is there a way to set EAGER fetch on all "ToMany" collection relationships

Given that the default seems to be FetchType.LAZY for all collections @OneToMany and @ManyToMany. Such as a configuration option. Instead of having to explicitly set fetch in annotation code in every relationship. ... No. There is no such configuration option, since having EAGER as the fetch type of all relationships may cause loading the entire ...