David Zejda wrote:

You have a missing quotation mark for the collection-class attribute,

thanks for a quick reply - sorry about my blindness

No problem, happens to all of us :-)

Btw, I don't think that TreeSet works as the collection-class, you should use one of the classes provided by OJB. Same for using SortedSet as the variable type - you have to use Set here. You shouldn't need to specify TreeSet as the collection-class anyway as OJB maintains the order that the objects are inserted. So you should be fine with

> > /** > * @ojb.collection element-class-ref="oit.ucase.DepositIndulgence" > * foreignkey="deposit_id" > * auto-retrieve="true" > * auto-update="true" > * auto-delete="true" > */ > private java.util.Set indulgences = new java.util.TreeSet();

OK, but imagine the scenario:

1) TreeSet created, a few objects inserted by program (and ordered).
2) Persisted.
3) Retrieved from DB, OJB creates it's own (non-sorted) Set, inserts objects in correct order.
4) Several more objects inserted by program. I guess, they will not be sorted (and it's a problem)..


possible solutions:
a) use non-sorted set as a persistent one and sort it independently on persistence (by wrapper SortedSet or somehow..)
b) create OJB-capable SortedSet and use that one as e collection-class

Then I'd say, go for option b, e.g. create a ManageableTreeSet or DTreeSet (depending on your requirements). Have a look at the source of ManageableHashSet and DSetImpl for pointers.
If you'd be willing to, we could include your class in OJB as it probably is useful for other people, as well.


Tom


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



Reply via email to