我想使用http://code.google.com/p/dbmapper/并且我不确定如何在命令提示符下运行它。
示例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 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
从命令行?
答案 0 :(得分:1)
例如,要运行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