Hi Morgan,

Glad you got through this okay. Instead of using the factory method, you 
can probably use the new (as of 1.1) create-type attribute on the 
collection (see 
http://jibx.sourceforge.net/details/binding-attributes.html#object).

  - Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



Morgan Rachell wrote:
> I got it to work. I needed to give the collection a factory method for 
> HashSets.
> I removed the item-type and type attributes of <collection> and added the
> factory. I also added a structure that specifies the types. One of the samples
> that JiBX ships with (example 8 or 9) did it this way.
>
> My old mapping was:
>
>  
>  <binding forwards="false" value-style="attribute">
>    <mapping class="FlockTest" name="flock-test">
>  [....]
>       <collection field="flockTestDetails" 
>               item-type="FlockTestDetail" 
>               type="java.util.HashSet"
>               usage="optional"/>
>  </mapping>
>
> And my new mapping is: 
>
> <binding forwards="false" value-style="attribute">
>   <mapping class="FlockTest" name="flock-test">
>   [....]
>   <collection field="flockTestDetails" 
>       factory="FlockTestDetail.HashSetFactory"> 
>       <structure 
>               type="FlockTestDetail" 
>               usage="optional"/>
>   </collection>
>   </mapping>
> </binding>
>
> I have to say that I am very happy with the ease with which I was able to
> generate a binding file from my hibernate domain objects using 
> jibx-genbinding.
> It was also just a cut-and-paste of sample code to get my marshalling code to
> work (with some small tweaks in the binding file). I also have maven2 calling
> the binding compiler. Very nice. Great documentation too! 
>
> Morgan
>
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to