1/1/2024 0 Comments Smartsynchronize tortoisehgSounds pretty nice, but there are some problems, particularly at the JPA annotations stage. What I prefer to do is design the data layer entirely in XSD (which maps to Java classes in a more natural way than DDL), then generate Java beans using JAXB or something similar, enrich it with JPA annotations and generate DDL as the result. Once again, you will need to fix the resulting XSD manually, that's for sure. But you will have to do a double amount of work fixing the beans structure and hardcoding annotations for both technologies. Nevertheless, this approach is quite common and supported by many powerful tools, such as my favorite IBM Rational Software Architect 7.5.įrom the other hand, you can start with some UML and generate Java Beans, then put all the necessary annotations (both JAXB and JPA) inside. But I must warn you that the XSD will be rather ugly, because usually you don't have too much control over the whole process, that's why the proper tooling is vital for success. You will be able to get an XSD using some JavaBeans-to-XSD tool (like you have in IBM Rational tools when generating WSDLs for given beans), or just generate a bunch of sample XML files by marshaling some test data and use any modern XML editor to generate XSD by example. You can start with DDL, generate JPA-annotated beans using Hibernate Tools for example, and then annotate it with some JAXB stuff (or use something not requiring annotations at all, like XStream). Here I want to share some of my ideas how to achieve this.įew variants are possible. But when you write your application from scratch, you have a unique possibility to seriously reduce amount of work need to be done. Usually both are designed, implemented and documented separately. Also, good chances are that you will have to have a RDBMS schema, too. In both cases you will probably end up having some XML Schema describing your data transfer format. Let us imagine a situation when you are writing an application sitting on the ESB, or providing a web service enabled interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |