Armin Waibel wrote:

Hi Robert,

Robert S. Sfeir wrote:

I have auto-retreive set to false in all my descriptors currently. Reason I do that is because sometimes I am not interested in getting the related objects, I just want to do a select from the table and just get the data back.

However, there are times when I do want to fetch the related objects. So with that, I tried the following code below, but it seems that it's incorrect since my bean still returns a null for the related bean.

final Query query = QueryFactory.newQuery( Category.class, crit );
broker.beginTransaction();
final ObjectReferenceDescriptor ord = new ObjectReferenceDescriptor( broker.getClassDescriptor( Project.class ) );
ord.setCascadeRetrieve( true );


OJB couldn't watch your made changes, 'ord' instance was not integrated.
Why you don't use

PB.retrieveAllReferences
PB.retrieveReference
for these objects you want to know the reference objects?

That's the first thing I tried, but it returns null for my objects, I must not be using the code Right!


Project p = new ProjectBean(); //TODO: Replace with Factory call.
broker.retrieveAllReferences( p );
final List results = ( List ) broker.getCollectionByQuery( query );

Any help is appreciated.
R

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to