qianlifeng / mysql_table_toJavaBean

convert mysql table structure to Java Bean

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mysql_table_toJavaBean

Build Status Dependency Status

convert mysql table structure to java bean

Prerequisites

  • 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 ********

Supported Parameters

required

πŸ” 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.

optional

πŸ” 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+.

Contributions

Welcome to contribute.

About

convert mysql table structure to Java Bean

License:GNU General Public License v3.0


Languages

Language:Java 100.0%