JavaBeans code generation from XSD
Hi everyone,
I know that this is not a new question, but I still did not find a satisfying answer.
Does anyone know a good code generator for creating JavaBeans out of XSD schemas?
The output of this tool has to comply with the JavaBeans specification, because we want to map these POJOs to a database with the Java Persistence API. Especially lists and sets need to be created correctly, because we will make heavy use of associations.
I've evaluated a large number of tools, most of them are not useable together with JPA. Here is a short list of tools I already tried:
- Castor: Really nice tool, but getter-methods for "java.util.List" objects return a copy of this list as array! Output is not a JavaBean!
- XMLBeans: As far as I've seen, Java objects have to be retrieved via a factory method, I see no possibility to use this library together with JPA. I furthermore doubt that these objects are JavaBeans.
- HyperJaxb2+3: This tool promises to create Java POJOs and Hibernate mappings at the same time. The description looks very good, but the page seems to be down. I was not able to initiate a download for days.
- Altova XMLSpy: This tool allows the generation of Java code out of XSD schemas. But the result is rather ugly. A simple XML "string" is translated into an internal Java class definition instead of a simple "String" instance. I see no usage of these objects together with JPA.
I spent quite a lot of time for searching a good code generation framework that works together with JPA. Has anyone made good experience with any kind of code generators in this area?
Thanks for any help!
Martin

