No lazy loading?

0 views
Skip to first unread message

Hez

unread,
Apr 25, 2009, 11:39:36 AM4/25/09
to dreamsource_orm
Hi

I found Dreamsource ORM from the GWT discussion group.

If Dreamsource ORM does not support lazy loading, how do we handle the
one to many relationship effectively?
Especially in the case where there are huge records,
e.g. hundreds of customers where each of the customers has hundreds of
orders?






Jim

unread,
Apr 26, 2009, 10:45:52 AM4/26/09
to dreamsource_orm
Please see http://www.leeonsoft.com/query.jsp for some examples. You
can get a list of customers containing its primary key using the
following methods in EntityManager:

public <T> List<T> list(Select<T> select) throws LinqException
public <T> List<T> list(Query<T> query) throws LinqException

and use one of the following methods to retrieve one Customer with
its orders. No lazy loading is not supported. But eager loading is
supported because you know what you want in advance.


7.3.2 The following four methods in com.leeonsoft.jdbc.EntityManager
return the found entity instance with one of its dependencies or null
if the entity does not exist.
public <T> T find(Object primaryKey, Class<T> entityClass,
TableRelation relation)
public Object find(TablePK tablePK, TableRelation relation)
public <T> T find(boolean frontend, Object primaryKey, Class<T>
entityClass, TableRelation relation)
public Object find(boolean frontend, TablePK tablePK, TableRelation
relation)


You can use the following methods to retrieve its more dependences
and its dependence's dependences.

7.3.3 The following four methods in com.leeonsoft.jdbc.EntityManager
return the found entity instance with all of its dependencies or null
if the entity does not exist.
public <T> T find(Object primaryKey, Class<T> entityClass,
List<TableRelation> relations)
public Object find(TablePK tablePK, List<TableRelation> relations)
public <T> T find(boolean frontend, Object primaryKey, Class<T>
entityClass, List<TableRelation> relations)
public Object find(boolean frontend, TablePK tablePK,
List<TableRelation> relations)

7.3.4 The following four methods in com.leeonsoft.jdbc.EntityManager
return the found entity instance with different levels of dependencies
or null if the entity does not exist.
public <T> T find(Fetch fetch, Object primaryKey, Class<T>
entityClass)
public Object find(Fetch fetch, TablePK tablePK)
public <T> T find(boolean frontend, Fetch fetch, Object primaryKey,
Class<T> entityClass)
public Object find(boolean frontend, Fetch fetch, TablePK tablePK)
com.leeonsoft.jdbc.Fetch parameter determines different levels for
dependencies away from the target which is retrieved.

Fetch.All(int level) indicates that EntityManager.find() method
retrieves its direct parents, the parent's direct parent, etc until
the level is reached, its direct children, the child's direct
children, etc until the level is reached.
Fetch.Ancestors(int level) indicates that EntityManager.find() method
retrieves its direct parents, the parent's direct parent, etc until
the level is reached.
Fetch.Descents(int level) indicates that EntityManager.find() method
retrieves its direct children, the child's direct children, etc until
the level is reached.


Jim.
Reply all
Reply to author
Forward
0 new messages