Java 如何使用Dbmapper从DB脚本生成JPA实体类?
我正在尝试使用,不知道如何在命令提示符下运行它 示例usesege如下所示Java 如何使用Dbmapper从DB脚本生成JPA实体类?,java,Java,我正在尝试使用,不知道如何在命令提示符下运行它 示例usesege如下所示 Usage: com.moonspider.dbmap.GenerateConfig -type (-t) [String] The type to generate, either 'jpa' or 'gorm' (experimental) (jpa) -destinationDirectory (-d) [String] Destination directory -url [String] The u
Usage: com.moonspider.dbmap.GenerateConfig
-type (-t) [String] The type to generate, either 'jpa' or 'gorm' (experimental) (jpa)
-destinationDirectory (-d) [String] Destination directory
-url [String] The url of the database
-pkg (-package) [String] The target package ()
-user (-u) [String] Database user (sa)
-password (-p) [String] Database password ()
-globalExtends (-extends) [String] Class for all Java classes to extend
-globalImplements (-implements) [String] Class for all Java classes to implement
-driver [String] Database drive class
-extension (-ext) [String] File extension for the generated code (java)
-hibernate [String] Generate hibernate.cfg.xml to this directory
-jaxb [flag] Enable xml binding generation
-schema [String] Specify the non-default schema to use
如何运行com.moonspider.dbmap.GenerateConfig
从命令行?例如,要使用MySQL数据库运行,请按以下方式运行:
java -cp /path/to/lib/mysql-connector-java-3.1.14-bin.jar:dbmap-r12.jar \
com.moonspider.dbmap.Generator -t jpa -d entities -url jdbc:mysql://localhost/jpagen \
-pkg com.xyz.data.entity -u user -p pass -driver com.mysql.jdbc.Driver