When you base a new application on an existing database, you can generate all the required entities with the respective DAO via the import function of RapidClipse. The Java code is generated for the corresponding entities based on the imported metadata in the tables, relations, and other constrains, among others.
Hibernate data type mapping
The data types used by databases are often significantly different from the corresponding data types in Java, mainly in the name, structure, and value range. During import, all the database data types are automatically converted to suitable Java data types (data type mapping). If certain relations have not been defined or were not defined clearly in the database, this must be completed or corrected during the import.
- In the Project Management > Entities click on Create JPA entities from tables.
- Click on Tables to select all the database tables. Then click on Next >.
- Check the imported constraints.
- Click on the relation that you want to check in detail or change, if required. You can make any changes that are necessary in the bottom detail area.
- Click on Next>.
- Enter the target folder or packages in which the code for your entities and the respective DAO should be generated.
- Click on Finish to initiate the database-metadata-import and to generate the entity model.
- Select the name of your project in the Project Management area in which the entities and respective DAO are displayed.
- Import complete database - It is recommended that you always import the entire database for the entity generation. When you generate only parts of your database entities, no relations can be created for entities that are generated later.
- Documentation on the Hibernate data type mapping of RapidClipse - You will find extensive documentation for the data type mapping strategy employed by the databases supported by RapidClipse here: