hi daniel,

there are two ways to define ordering of related objects:
1.) you can define a static ordering in the collection-descriptor.

     <collection-descriptor
..       orderby="saldo"
         sort="ASC"

2.) for dynamic ordering (based on the owner of the related objects) use a query-cusomizer.

hth
jakob

Daniel Perry wrote:
I've got two classes with a 1:n relationship - job and grade
I want to order by the results of an OQL query by the field "jobname" from
the table job, then within each job by the field "gradename".

String queryStr= "select job from " + Job.class.getName() + " where
deleted=0 order by jobname";

The above handles the first bit of the ordering, but i am not sure how to do
the second level ordering.

Both the job and grade have fields titled "deleted", i only want to select
objects that dont have the deleted fields set.  The above query ignores jobs
with deleted set to 1, but not grades.  How can i acheive this?

Thanks for you help!

Daniel.


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




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



Reply via email to