/
Adding Data Model Generation to a project
Adding Data Model Generation to a project
API Project
- Add directory src/main/dmgen with datamodel.xml and generator.xml
- Specify entities and their attributes in datamodel.xml
- Specify what the generator should do in generator.xml (in an API project usually generating dtos and joinDtos)#
Contents of generator.xml e.g.
In pom.xml: Add resources to build/resources section, e.g.:
In pom.xml: Register maven-clean plugin
In pom.xml: Register dmgen plugin
Impl Project
Add directory src/main/dmgen with only generator.xml (datamodel.xml will be copied from API project using the plugin calls shown below). Contents of generator.xml e.g.
In pom.xml: Add call to maven-clean-plugin
In pom.xml: Add call to maven-dependency-plugin
In pom.xml: Finally add call to dmgen-maven-plugin
Work around a battle between Eclipse and Maven:
Necessary dependencies (sql-util, jdbc2xml):
Subversion
- Refresh in Eclipse
- Delete all possibly (as result of testing the changes above) generated sources below src/generated/java. I.e. src/generated/java stays, but not src/generated/java/at.
- Commit the changes so far.
- Perform a maven build both on api and on impl project
- Refresh both projects in eclipse
- Both in api and in impl project, Team -> Add to svn.ignore by name the top level package below src/generated/java, e.g. "at".
- Commit.
Java Build Path
- In both projects (api and impl), add src/generated/java to the Build Path.
- Commit.
, multiple selections available,
Related content
Generator Usage
Generator Usage
More like this
Migration to debhelper 9
Migration to debhelper 9
More like this
Where to place styles
Where to place styles
More like this
Clazzes.org Home
Clazzes.org Home
More like this
Adapting PBA to new Debian Release
Adapting PBA to new Debian Release
More like this
Remoting Home
Remoting Home
More like this