Hello,

I am having a rather important problem with my mapping between my xml file and my java classes (pojos). Right now I am trying to bind xml files to my hibernate pojos. Here is a sample of my mapping:

<mapping name="Itinerary" class="entities.Itinerary">
<collection name="flightLegs" field="flightLegs" type="java.util.HashSet" usage="optional">
<structure name="FlightLeg" type="entities.FlightLeg" usage="optional">
...
</structure>
</collection>
</mapping>



This works great if I load an xml file and unmarshall it using jibx. My problem occurs when I populate my POJO hibernate classes by fetching the data from the db and then try to marshall them in xml documents. The reason is that hibernate instantiates net.sf.hibernate.collections.Set for collections rather than a java.util.HashSet. Therefore, JIBX will give me a compilation error because it tries to use a java.util.HashSet. And in case you are wondering, I cannot use net.sf.hibernate.collection.Set for my collections in my POJOs because a hibernate session is needed to instantiate such an object.


Is there a way to have a different "type" for marshalling and unmarshalling collections? Or is there a workaround to my problem?

Any help would be greatly appreciated,

Thank you,

Fran�ois






------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id808&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to