Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

sp00m/db2jpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reverse Engineering from a Database to JPA Entities based on the Remarks

Description

Reverse engineering strategy based on the "remarks" property of the database tables and fields.

The transformation rules applied to the remarks are:

+------------+----------------+-------------------+
|   Remark   | Table to class | Field to property |
+------------+----------------+-------------------+
| the remark | TheRemark      | theRemark         |
| the_remark | TheRemark      | theRemark         |
| theremark  | Theremark      | theremark         |
| theRemark  | Theremark      | theremark         |
+------------+----------------+-------------------+

If no remark has been set, the corresponding table/field real name will be used to proceed the transformation.

For example, given the below MySQL table named "tbl_user" with the comment "user":

+----------------------+--------------+-----+-------------------+
|         name         |     type     | ... |     comments      |
+----------------------+--------------+-----+-------------------+
| id_user              | int(11)      | ... |                   |
| tx_email             | varchar(100) | ... | the email         |
| tx_username          | varchar(20)  | ... | userName          |
| tx_password          | char(40)     | ... | password          |
| bl_need_confirmation | tinyint(1)   | ... | need_confirmation |
+----------------------+--------------+-----+-------------------+

The following entity will be generated:

public class User {
	
	private int idUser;
	private String theEmail;
	private String username;
	private String password;
	private boolean needConfirmation;
	
	// ...
	
}

How-to

  1. Configure the POM properties
  2. Run mvn exec:exec
  3. Check your destination dir

About

Reverse engineering strategy based on the "remarks" property of the database tables and fields

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages