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

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

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

 
forum_thread

find() cost unreasonable time!

Hi, I make a full binary tree of 4095 node, I check the first 9 node, but the root cost 24 seconds, why? Result: ... = "parent" , fetch = FetchType . EAGER ) protected List<Nodes> Sons ; function of ... = "parent" , fetch = FetchType . EAGER ) protected List<Nodes> Sons ;   public ...

 
page

ObjectDB Object Database Features

ObjectDB provides a rich set of features, many of them as the result of supporting the JPA and JDO APIs.... Lazy/Eager Loading Automatic ... Configurable JPA eager/lazy fetch  and JPA query FETCH JOIN . ...