I am a fresh graduate and currently studying for an upcoming project. The task is convert a set of XSD docs through JAXB to corresponding Java specs. Also generate the correct SQL table definitions. So the topics I am studying now are JAXB and JPA, decided I will be using eclipseLink and I have it all set up. What I don't understand is the workflow. From what I understood, it's
xsd -> jaxb classes -> annotate(JPA) -> database
I can now generate JAXB classes from an example XSD but I don't know what to do from there. I have read about generating JPA classes from a database but I don't have any resources on doing the reverse. Help would be appreciated
posted 4 years ago
You can persist the same JAXB generated class through JPA by adding @Entity and @Id annotations to them.
You can auto create a database schema using DDL generation in your JPA persistence.xml,