Hi Juergen, [EMAIL PROTECTED] wrote:
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:Oops! This is a bug! retrieveReference is meant to explicitly load references! I'll fix this ASAP.
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?if getCascadeRetrieve() is true references are loaded implicitely on loading instances from db. Of course this will result in loading complete object graphs. Thus I recommended to set auto-retrieve to false and use explicit loading.
manual invocations on this method should succeed, or not?
yes, it's definitely a bug!
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?
This is a void operation, thus no result is returned to the client.
question on your third proposal: wouldn't that make necessary to map those preview-classes?
Yes!
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?;
Only the methods that your current implementation class provides. do i
you only have to add an implements MyInterface clause to the Impl class.have to make changes in my code for that? )
have a look at the classe Article and ArticleInterface in the testsuite for a simple example.
cheers,
Thomas
greetings, Juergen Richtsfeld Hi Juergen, [EMAIL PROTECTED] wrote:hi!user
i want to display several lists (collections of the same class). the
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 triedthem
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]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
