Model Archetype
Database module
1 2 3 4 5 6 7 8 9 10 |
|
1 2 3 4 |
|
Entities module
Datasource connection definition
Edit the src/main/resources/META-INF/persistence.xml file of your module and change the <jta-data-source>osgi:service/jdbc/${project.parent.artifactId}.database.xa</jta-data-source> and the <non-jta-data-source> Sections (referencing the non xa exported one). If you want to disable the transactional access, you’ve also to change the ‘transaction-type’ value to ‘RESOURCE_LOCAL’
Model object definition
In order to define a new model object, you’ve got to extends the ‘AbstractEntity’ abstract class of the src/main/java folder. All Java files that are located on this folder will be ‘delombokized’ e.g they will interpret the lombok annotations and generate the according Java code. Here’s an example of a model entity:
DAO module
Declaring DAOs
In order to declare a Data Access Object you’ve to expose its API to others via an interface:
Adding JMS, REST or integration Tests to the JPA module
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|