Hi

Thanks for sharing your own solution.

The JAXB annotations you've put on the POJO *by hand* is exactly what the
XJC compiler would have done by the generated Java sources If there was a
proper XSD of the XML you consume. So to say now you've got a POJO which is
*both* a JPA entity as well a JAXB complaint POJO (not too sexy though, but
that's my personal taste).

An regarding your question on StackOverflow site: The XJC compiler generates
other than JAXB-POJOS also a class called ObjectFactory.java, see for an
explanation of this class here:

http://www.oracle.com/technetwork/articles/javase/index-140168.html

The other option is not making use of this generated class but a simple text
file called jaxb.index listing *all* the JAXB classes being generated/used.
If you make use of Maven then instead of putting this file together with
your WeatherCurrent.java under the same directory you could also put it
under the Maven resource directory src/main/resources. Then Maven will put
this file *under the same path* inside your generated JAR, WAR etc.

As an example look at this one:

https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/camel/example/server/model/jaxb.index

Babak

--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-create-a-Camel-route-which-takes-XML-and-bind-some-data-to-JPA-annotated-POJO-tp5564614p5570147.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to