convert mysql table structure to java bean
- Java 7 and above
Download from here, or you can compile your own.
Here is a quick example:
java -Dfile.encoding=UTF8 -jar mysql_table_toJavaBean.jar -url jdbc:mysql://host/database -tables ******** -username ******** -password ********
π url
This property sets the jdbc url.
π username
This property sets the authentication username used when obtaining connection.
π password
This property sets the authentication password used when obtaining connection.
π tables
If you do not set this property, it will convert all tables in the database. available multiple tables separated by commas.
π packageName
This property sets the Java Bean belongs to.
βuseLombok
if use this property, it will generate annotation @Data on class level instead of getter and setter methods in class.
βuseLocalDate
if use this property, it will map date(mysql) to java.time.LocalDate instead of java.util.Date when you run this jar with JDK8+.
βuseLocalDateTime
if use this property, it will map datetime(mysql) to java.time.LocalDateTime instead of java.util.Date when you run this jar with JDK8+.
Welcome to contribute.