Stephen,

does the approach as suggested by Ralf address your issue ? If not, can
you please provide me with a fully working sample (ideally following the
bug submission guidelines available at http://castor.codehaus.org) to
replay your problem ?

Thanks
Werner Guttmann

Ralf Joachim wrote:
> Hi Stephen,
> 
> Werner recently added collection="sortedset" (included with 1.0M1). I
> don't know how it behaves together with lazy loading but it should be
> the best option for you.
> 
> You may want to have a look at release-notes for a short description on
> how to use it.
> 
> Regards
> Ralf
> Castor JDO, committer
> 
> 
> Stephen Ince schrieb:
> 
>>I am getting duplicate entries when I am using lazy loading for a
>>collection. It only happens when I add all the items to the arraylist.
>>What is the best way to model lazy loading when the collection needs to
>>be sorted?
>>
>>1--- N
>>WebResource ------> FormData.
>>
>>Here is my implementation and mapping file.
>>
>>Class WebResource {
>>:
>>  ArrayList formData = new ArrayList();
>>
>>   public void setFormData(Collection formData) {
>>
>>       this.formData.clear();
>>       if ( formData == null ) return;
>>
>>       this.formData.addAll(formData);
>>
>>       final Iterator iter = this.formData.iterator();
>>       while(iter.hasNext() ) {
>>           FormData f = (FormData) iter.next();
>>           f.setWebResource(this);
>>       }
>>       java.util.Collections.sort(this.formData);
>>   }
>>
>>
>>
>><class name="com.opendemand.jdo.WebResource" auto-complete="false"
>>identity="webResourceId" key-generator="keygen"
>>depends="com.opendemand.jdo.UserScenario">
>>
>><field name="formData" type="com.opendemand.jdo.FormData"
>>
>>required="false" direct="false" transient="false"
>>collection="collection" lazy="true">
>>
>><sql many-key="web_resource_id" dirty="ignore" />
>>
>></field>
>>
>></class>
>>
>>Steve
>>
>>
>>-------------------------------------------------
>>If you wish to unsubscribe from this list, please send an empty message
>>to the following address:
>>
>>[EMAIL PROTECTED]
>>-------------------------------------------------
> 
> 

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to