i decided to try the second recommendation, but i have a problem in client
/ server. but i think, this is not only client / server specific. i
debuged and found the following code in PersistenceBrokerImpl:
private void retrieveReference(Object obj, ClassDescriptor cld,
ObjectReferenceDescriptor rds)
{
PersistentField refField;
Object refObj;
if (rds.getCascadeRetrieve())
{
refObj = getReferencedObject(obj, rds, cld);
refField = rds.getPersistentField();
//logger.info("RETRIEVING reference for "+obj);
//logger.info("RETRIEVING reference field
"+refField.getName()+"="+refObj);
refField.set(obj, refObj);
}
}
it seems, that only auto-retrieve="true" set references will be loaded by
this method, so your idea doesn't work. my question is, why not simply
call this method (retrieveReference) when rds.getCascadeRetrieve() ==
true? manual invocations on this method should succeed, or not? the second
is, that the server doesn't return the new filled object. that's also a
strange behavior to me. any ideas how to fix this? has anyone tried other
solutions?
question on your third proposal: wouldn't that make necessary to map those
preview-classes?
i allready tried the fourth one, but i can't use this because it's
impossible to get a mapping between Object[] indices and attribute names
(but it had great performance).
if i don't get this ( the second way) working, i will try out proxies, but
i don't exactly know where to begin. the advanced o/r mapping tutorial
doesn't answer my questions (what methods must the interface have?; do i
have to make changes in my code for that? )
greetings,
Juergen Richtsfeld
Hi Juergen,
[EMAIL PROTECTED] wrote:
> hi!
> i want to display several lists (collections of the same class). the
user
> chooses one of the objects, and this will be loaded from the database.
>
> my current solution is a PB.getCollectionByQuery, but this is very slow,
> because the whole object tree is loaded (but not used). is there a
> solution?
>
There are several possible solutions for this (ordered by relevance):
1. use proxies (work great in singlevm mode)
2. you can set auto-retrieve="false" on reference- and
collection-attributes that you don't want to load.
(they will be set to null)
(If you must access these attributes later you can use
PB.retrieveReference("attributename"))
3. you can use additional preview-classes that are used for display
purposes only. These classes would have only the most neccessary
attributes and no references.
4. you can use report queries for display purposes that do not
materialize complete entities, but only Object[] representing a
resultset-row.
cheers,
Thomas
> i'm not sure, but i think this should be done by using proxy classes,
but
> i had lots of troubles with them in client / server mode (never tried
them
> in singlevm).
>
> please help
>
> juergen
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>