- hibernate POJOS with xdoclet mappings (supports associations compositions, inheritances, etc.)
- persistence facades
- struts actions
- jsp tiles
- xsd mapping
- jibx mapping (based on the xml format specified by the xsd)
- jibx sax marshalling and unmarshalling facades
- and more...
We just opened the project so there are no official release or documentation but we should have some very quickly (in the next week or so). Come and visit the site next week and there should be enough to get started :-)
Fran�ois
Linus Kamb wrote:
Glad to help.
AndroMDA looks great. Who's working on the JiBX cartridge? :-)
Fran�ois Eric wrote:
AHA! Correct!
Thanks a lot Linus...I was really getting discouraged!
By the way, I'm actually using andromda to do my whole code generation. In case you don't know this tool, it generates my hibernate mappings and POJOs from a uml model. It does not use hbm2java.
Thanks again!
Fran�ois
Linus Kamb wrote:
I was in in the middle of composing a reply when your next post came in.
The add-method needs to be a method that takes an Object:
public void addFlightLegs(Object leg)
in which you can cast the Object leg to a FlightLeg and call your method.
Also, they don't have to be public methods.
This is a little bit of a bother, since you have to go through and add this method, but again, it woudl be fairly easy to the the hbm2java to generate it. It would be nice if JiBX could call the "real" addXXX method, but I don't know what difficulties there might be in that.
Fran�ois Eric wrote:
Hi Linus,
Thanks for your answer. Unfortunately I have tried and it doesn't seem to work for me. Here is my mapping:
<collection name="flightLegs" field="flightLegs" usage="optional" item-type="entities.FlightLeg" add-method="addFlightLegs" iter-method="getFlightLegsIterator" test-method="hasFlightLegs">
My java POJO has of course the concerned methods. But still, I get the following error when trying to map it:
org.jibx.runtime.JiBXException: Add method addFlightLegs not found in collection type java.util.Collection at tag "collection"(line 51, col 249, in itineraryserver/output/cumul/src/conf/jibx/ItineraryRendition-binding.xml)
at org.jibx.runtime.impl.UnmarshallingContext.throwStartTagException(UnmarshallingContext.java:2725)
at org.jibx.binding.def.BindingBuilder.unmarshalStructure(BindingBuilder.java:1153)
at org.jibx.binding.def.BindingBuilder.unmarshalStructureChildren(BindingBuilder.java:837)
Which version of jibx are you using? Do you have an idea why it works for you and not for me?
Thank you very much.
Fran�ois
Linus Kamb wrote:
I use hibernate and map collections as follows:
<collection name="Configurations" usage="optional" ordered="true"
item-type="edu.iris.dmc.isis.StationConfiguration"
add-method="addConfiguration"
iter-method="getConfigurationsIterator"
test-method="hasConfiguration" />
although, I guess my POJOs are not so PO anymo', having added the various JiBX-required methods. You could modify the hbm2java source generator code to add them, since they are pretty generic. I did some of that.
I *think* you can just leave out the collection type, since the hibernate collections support the Collection interface, which supplies an iterator() method.
Fran�ois Eric wrote:
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�k _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------- 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�k _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------- 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�k _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------- 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
