however, restful web services generated from ee 5 entity classes still have converter classes.
Netbeans ide 7.0 also lets you add jaxb annotations to ee 5 entity classes. however, when you use the entity classes from database wizard, you have the choice whether or not to add jaxb annotations to the entity classes. When you use netbeans ide 7's restful web service from database wizard, jaxb annotations are automatically added to the jpa entity classes. for example, the customer class is annotated with xmlrootelement. The jaxb annotations are directly in the entity classes instead. in this case, be careful of cyclic dependencies and annotate any affected methods with is the structure of an ee 6 restful service created with a development build of netbeans ide 7.0. If you create ee6 restful web services from existing entity classes, make certain that they have the necessary jaxb annotations. the annotation prevents jaxb marshaller from failing due to a cyclic dependency. the annotation is necessary because customer and discountcode are mutually dependent. Here you see the customerconverter class annotated with xmlrootelement and xmlelement.ĭiscountcode also has an annotation for the getcustomercollection method. Here is the structure of an ee 6 restful service created with netbeans ide 6.9.1, showing the converter classes. when cases arise where you do have to modify the jpa classes by hand, this should be much easier. this not only leads to cleaner code, but should reduce problems that arise between static jpa and runtime jaxb-generation of xml, such as loops in the reference creating infinitely deep xml. Starting with netbeans ide 7.0, you have the option of generating jaxb annotations directly in the jpa entity classes. previously, when you generated a restful web service from entity classes, netbeans ide created converter classes that contained these annotations.
In java code indicate the xml structure that should be generated from that code. this reduces the number of generated service classes and simplifies their code. this removes the need for converter classes. Jaxb annotations can be added directly to jpa entity classes. In the 7.0 version of netbeans ide, currently available as a development build, there are two changes to java ee 6 restful web services generated from entity classes that greatly simplify the resulting application: