hi jamo,

Jamo Smith schrieb:
What if i modifed an element of the collection while, it was in the
cache, would it be resorted the next time I retrieve it?  I think with
the SQL sort it would only be sorted when it was refreshed from the
database, which should be minimized.

yes you'll have to refresh the collection in this case.

The use of this is in a forum where there may be a large # of topics that need to be sorted by topic type & by topic lastupdated. I do have a start & end index and usually it is only a pull of 20-30 topics. Could this be done a better way?

i think it depends on how often the data is updated. don't need to go to the database to get the last updated topic ?


when using the start- and end-index in ojb you'l have to be aware of the fact that ojb handles these indices internally, not in the sql.

jakob


Thank you very much for your help!

On Sun, 20 Feb 2005 19:28:26 +0100, Jakob Braeuchi <[EMAIL PROTECTED]> wrote:

hi jamo,

afaik ojb supports a single column only in the collection-descriptor.
for more flexibility you could also use a query-customizer.
i think sorting the rows using sql is more effective than using compareTo.

jakob

Jamo Smith schrieb:

My object is sorted by more than one column.  It is best, I think, to
utilize compareTo in this instance.  More important, would the below
method be as optimal as the method I purpose - if so, could I have it
sort by multiple columns?


On Sun, 20 Feb 2005 17:24:31 +0100, Jakob Braeuchi <[EMAIL PROTECTED]> wrote:


hi jamo,

the collecton descriptor supports sorting. ie:

    <collection-descriptor
       name="allArticlesInGroup"
       element-class-ref="org.apache.ojb.broker.AbstractArticle"
       auto-retrieve="true"
       auto-update="true"
       auto-delete="false"
    >
       <orderby name="articleId" sort="DESC"/>
       <inverse-foreignkey field-ref="productGroupId" />
    </collection-descriptor>

hth
jakob

Jamo Smith schrieb:


I have a one to many relationship.  I need to retrieve the many in a
SortedSet as optimally as possible(instead of retrieving as a
collection then adding to a TreeSet)  What is the way to do this with
OJB?

--
Jamo Smith

---------------------------------------------------------------------
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]





---------------------------------------------------------------------
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