Skip to content

Instantly share code, notes, and snippets.

@de314
Created June 11, 2015 21:59
Show Gist options
  • Save de314/1db12f258be9d2fc58f3 to your computer and use it in GitHub Desktop.
Save de314/1db12f258be9d2fc58f3 to your computer and use it in GitHub Desktop.
Generate Jooq Classes
#!/bin/bash
java -classpath jooq-3.6.1.jar:jooq-meta-3.6.1.jar:jooq-codegen-3.6.1.jar:mysql-connector-java-5.1.31-bin.jar:. org.jooq.util.GenerationTool ubnt_vnla.xml
#<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
#<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.6.0.xsd">
# <!-- Configure the database connection here -->
# <jdbc>
# <driver>com.mysql.jdbc.Driver</driver>
# <url>jdbc:mysql://localhost:3306/db_name</url>
# <user>root</user>
# <password></password>
# </jdbc>
# <generator>
# <!-- The default code generator. You can override this one, to generate your own code style
# Defaults to org.jooq.util.DefaultGenerator -->
# <name>org.jooq.util.DefaultGenerator</name>
# <database>
# <!-- The database type. The format here is:
# org.util.[database].[database]Database -->
# <name>org.jooq.util.mysql.MySQLDatabase</name>
# <!-- The database schema (or in the absence of schema support, in your RDBMS this
# can be the owner, user, database name) to be generated -->
# <inputSchema>db_name</inputSchema>
# <!-- All elements that are generated from your schema
# (A Java regular expression. Use the pipe to separate several expressions)
# Watch out for case-sensitivity. Depending on your database, this might be important! -->
# <includes>.*</includes>
# <!-- All elements that are excluded from your schema
# (A Java regular expression. Use the pipe to separate several expressions).
# Excludes match before includes -->
# <excludes></excludes>
# </database>
# <target>
# <!-- The destination package of your generated classes (within the destination directory) -->
# <packageName>com.path.to.dao.package</packageName>
# <!-- The destination directory of your generated classes -->
# <directory>/path/to/src/main/java</directory>
# </target>
# </generator>
#</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment