keywhiz-model
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.squareup.keywhiz</groupId>
<artifactId>keywhiz-model</artifactId>
<version>0.10.1</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.squareup.keywhiz</groupId>
<artifactId>keywhiz-parent</artifactId>
<version>0.10.1</version>
</parent>
<artifactId>keywhiz-model</artifactId>
<name>Keywhiz Model</name>
<properties>
<db.driver>com.mysql.jdbc.Driver</db.driver>
<db.create-url>jdbc:mysql://localhost/?useUnicode=true&characterEncoding=utf8</db.create-url>
<db.migrate-url>jdbc:mysql://localhost/keywhizdb_test?useUnicode=true&characterEncoding=utf8</db.migrate-url>
<db.username>root</db.username>
<db.migrations-path>mysql/migration</db.migrations-path>
<jooq.dialect>org.jooq.meta.mysql.MySQLDatabase</jooq.dialect>
<jooq.excludes>mysql.*</jooq.excludes>
<jooq.input-schema>keywhizdb_test</jooq.input-schema>
</properties>
<dependencies>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-meta</artifactId>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Creates (or re-creates) a keywhizdb_test database. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<driver>${db.driver}</driver>
<url>${db.create-url}</url>
<username>${db.username}</username>
<autocommit>true</autocommit>
<sqlCommand>
DROP DATABASE IF EXISTS keywhizdb_test;
CREATE DATABASE keywhizdb_test;
</sqlCommand>
</configuration>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>migrate</goal>
</goals>
</execution>
</executions>
<configuration>
<driver>${db.driver}</driver>
<url>${db.migrate-url}</url>
<user>${db.username}</user>
<locations>
<location>filesystem:../server/src/main/resources/db/${db.migrations-path}</location>
</locations>
</configuration>
</plugin>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<!-- The plugin should hook into the generate goal -->
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbc>
<driver>${db.driver}</driver>
<url>${db.migrate-url}</url>
<user>${db.username}</user>
</jdbc>
<!-- Generator parameters -->
<generator>
<name>org.jooq.codegen.JavaGenerator</name>
<database>
<name>${jooq.dialect}</name>
<includes>.*</includes>
<excludes>${jooq.excludes}</excludes>
<inputSchema>${jooq.input-schema}</inputSchema>
<!-- Registers custom types -->
<customTypes>
<customType>
<name>keywhiz.model.TimestampConverter</name>
<type>Long</type>
<converter>keywhiz.model.TimestampConverter</converter>
</customType>
<customType>
<name>java.lang.Boolean</name>
<converter>keywhiz.model.TinyIntConverter</converter>
</customType>
<customType>
<name>java.lang.Long</name>
<converter>keywhiz.model.LongConverter</converter>
</customType>
</customTypes>
<!-- Forces JOOQ to use custom types in generated code -->
<forcedTypes>
<forcedType>
<name>keywhiz.model.TimestampConverter</name>
<types>(?i:timestamp.*)</types>
</forcedType>
<forcedType>
<name>java.lang.Boolean</name>
<!-- mysql doesn't support booleans and uses tinyint instead. -->
<types>(?i:tinyint.*)</types>
</forcedType>
<forcedType>
<name>java.lang.Long</name>
<!-- We ran into some postgres + bigint + autoincrement issues -->
<types>(?i:int.*)</types>
</forcedType>
</forcedTypes>
</database>
<target>
<packageName>keywhiz.jooq</packageName>
</target>
</generator>
</configuration>
</plugin>
</plugins>
</build>
</project>