I was trying to add the xml schema to an existing EJB project. JAXB is used to bind the XML-Schema to java class. As we are going to use the search engine to crawl thru DTO when EJB is in session.
I could not find any direct approach as to map entity class file to XML-Schema.
The only way we could achieve so far is to create the Web Services, generate the WSDL which generates xml-schema(XSD) and then parsing the xsd file thru jaxb(xjc command) to create java class files. Now using mapping-binding.xml file we can map both xml and java class file.
But now again the issue is to how map this to entity class.
\
This is what we want to achieve ::
XML Data Object with XML Schema, (This is already present in the JAXB specification). - Entity Bean then Extends or has an interface to this JAXB object. - All Persistence functions are managed by the Entity Bean... - The Entity Bean would then contain the XML Marshalling and UnMarshalling features found in JAXB.. - A Value Object could be retrieved in binary or XML form from the Entity Bean Object. - A JSP could easily extract the XML Schema and XML Data from the Value Object and perform operations on it such as XSL transformations.
My argument is that the Entity Beans have no standard way for interfacing to JAXB objects.
Castor may be the solution, but then again we have to implement web services or using castor JDO’s.
I found xstream to be pretty useful as it uses a converter class in which you can call the entity bean class objects and generate a xml file. but i was not preferring to use another class but incorporate the functions in existing bean class.
Can you help me in this regard?
Thanks in advance
-Sid