Generated Files¶
Files for Applications¶
Modeling | File Naming | Description |
---|---|---|
entity [name] where the entity does have an id field |
[Name].java | The class gets a JPA @Entity annotation. |
entity [name] where the entity does not have an id field |
[Name].java | The class gets a JPA @Embeddable annotation and can be used as type for field in a class that has an @Entity annotation. |
entity [name] | [Name]DAO.java | The class encapsulates logic to retrieve/persist data. Its purpose is to make that logic easily reusable, no matter whether the class is used inside or outside a JEE application server. It does not use any JPA annotations. |
entity [name] where the entity does have an id field |
[Name]LifecycleListener.java | The class has methods that are going to be executed whenever data is read, persisted updated or deleted. It is used as value for a @EntityListeners annotation. |
entity [name] where the entity does have an id field |
[Name]_.java | Normally, a persistence provider has means to create JPA meta classes that contain meta information for entity classes (e.g. by using a maven plugin). The JPA generator makes this step superfluous. |
orm.xml | This XML file holds mapping metadata and defaults. You can use it to override configuration that is provided through annotations and to provide commonly used configuration in a central place like for instance named entity graphs. | |
persistence.xml | This XML file holds the definition of one or more JPA persistence units. | |
ThreadLocalSessionData.java | The class has static fields and static inner classes that have the purpose to hold session-related data. The class is being used in entity lifecycle listeners for classes that have an @Entity annotation and that get utility fields createdBy , modifiedBy , creationTimestamp and modificationTimestamp generated. |
Files for Testing¶
Modeling | File Naming | Description |
---|---|---|
DataGenerator.java | The class has some helper methods to create test data (strings, numbers, …). | |
scowl-2017.08.24.zip | The zip file contains sample data that is going to be used by the test data generator class to create test data. | |
entity [name] | Test[Name]DAO.java | The class has JUnit annotations and provides a test method for each method in the DAO class. |
AbstractTest.java | The class has methods with JUnit annotations for the initialization of the persistence provider. That functionality is needed by all unit test classes. | |
entity [name] | Test[Name].java | The class has test methods testFind() , testPersist() , testMerge() and testRemove() and tests a single entity class. |
TestDataGenerator.java | The class has a main method. Executing the application creates test data by using the generated JPA classes and the data generator class. | |
TestTestDataGenerator.java | The class has a single test method that has the sole purpose to call the test data generator class to insert test data into a database. |