[#395] Use XML configuration file instead of plain properties file
This commit is contained in:
parent
53ad31933c
commit
9bb49fc234
@ -85,7 +85,7 @@ public class GenerationTool {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length != 1) {
|
||||
if (args.length < 1) {
|
||||
error();
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ public class GenerationTool {
|
||||
else {
|
||||
Properties properties = new Properties();
|
||||
properties.load(in);
|
||||
main(properties);
|
||||
main(properties, args);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Cannot read " + args[0] + ". Error : " + e.getMessage());
|
||||
@ -120,11 +120,7 @@ public class GenerationTool {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(Properties properties) throws Exception {
|
||||
log.warn("WARNING: jooq-codegen source code generation using .properties files is deprecated");
|
||||
log.warn("WARNING: consider using XML configuration instead");
|
||||
log.warn("WARNING: See http://www.jooq.org/manual/META/Configuration/ for more details");
|
||||
|
||||
public static void main(Properties properties, String... args) throws Exception {
|
||||
Jdbc jdbc = new Jdbc();
|
||||
jdbc.setDriver(properties.getProperty("jdbc.Driver"));
|
||||
jdbc.setUrl(properties.getProperty("jdbc.URL"));
|
||||
@ -137,6 +133,8 @@ public class GenerationTool {
|
||||
|
||||
MasterDataTables masterDataTables = new MasterDataTables();
|
||||
for (String name : defaultString(properties.getProperty("generator.generate.master-data-tables")).split(",")) {
|
||||
if (isBlank(name)) continue;
|
||||
|
||||
MasterDataTable table = new MasterDataTable();
|
||||
|
||||
table.setName(name);
|
||||
@ -177,9 +175,16 @@ public class GenerationTool {
|
||||
database.setIncludes(properties.containsKey("generator.database.includes") ? properties.getProperty("generator.database.includes") : null);
|
||||
database.setExcludes(properties.containsKey("generator.database.excludes") ? properties.getProperty("generator.database.excludes") : null);
|
||||
database.setDateAsTimestamp("true".equalsIgnoreCase(properties.getProperty("generator.database.date-as-timestamp")));
|
||||
database.setMasterDataTables(masterDataTables);
|
||||
database.setEnumTypes(enumTypes);
|
||||
database.setForcedTypes(forcedTypes);
|
||||
|
||||
// Avoid creating these empty elements when migrating
|
||||
if (!masterDataTables.getMasterDataTable().isEmpty())
|
||||
database.setMasterDataTables(masterDataTables);
|
||||
|
||||
if (!enumTypes.getEnumType().isEmpty())
|
||||
database.setEnumTypes(enumTypes);
|
||||
|
||||
if (!forcedTypes.getForcedType().isEmpty())
|
||||
database.setForcedTypes(forcedTypes);
|
||||
|
||||
Target target = new Target();
|
||||
target.setPackageName(properties.getProperty("generator.target.package"));
|
||||
@ -193,7 +198,10 @@ public class GenerationTool {
|
||||
generate.setGeneratedAnnotation(!"false".equalsIgnoreCase(properties.getProperty("generator.generate.generated-annotation")));
|
||||
|
||||
org.jooq.util.jaxb.Generator generator = new org.jooq.util.jaxb.Generator();
|
||||
generator.setStrategy(strategy);
|
||||
|
||||
if (!isBlank(strategy.getName()))
|
||||
generator.setStrategy(strategy);
|
||||
|
||||
generator.setDatabase(database);
|
||||
generator.setTarget(target);
|
||||
generator.setGenerate(generate);
|
||||
@ -203,7 +211,21 @@ public class GenerationTool {
|
||||
configuration.setJdbc(jdbc);
|
||||
configuration.setGenerator(generator);
|
||||
|
||||
main(configuration);
|
||||
if (args.length < 2) {
|
||||
log.warn("WARNING: jooq-codegen source code generation using .properties files is deprecated as of jOOQ 2.0.4");
|
||||
log.info(" Consider using XML configuration instead");
|
||||
log.info(" See http://www.jooq.org/manual/META/Configuration/ for more details");
|
||||
log.info("");
|
||||
log.info("Use GenerationTool to migrate your .properties file to XML (printed on System.out) :");
|
||||
log.info("Usage : GenerationTool <configuration-file> migrate");
|
||||
log.info("");
|
||||
|
||||
main(configuration);
|
||||
}
|
||||
else if ("migrate".equals(args[1])) {
|
||||
log.info("Migrating properties to XML");
|
||||
JAXB.marshal(configuration, System.out);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@ -14,6 +14,6 @@
|
||||
<!-- Run a full mvn clean package install deploy first before this -->
|
||||
<target name="xjc-generator" description="Generate JAXB artefacts from XSD">
|
||||
<mkdir dir="${dir.java}/org/jooq/util/jaxb" />
|
||||
<xjc schema="${dir.resources}/jooq-codegen.xsd" destdir="${dir.java}" package="org.jooq.util.jaxb"/>
|
||||
<xjc schema="${dir.resources}/jooq-codegen-2.0.4.xsd" destdir="${dir.java}" package="org.jooq.util.jaxb"/>
|
||||
</target>
|
||||
</project>
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
@ -25,8 +25,8 @@ import javax.xml.bind.annotation.XmlType;
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <all>
|
||||
* <element name="jdbc" type="{http://www.jooq.org/xsd/jooq-codegen}Jdbc"/>
|
||||
* <element name="generator" type="{http://www.jooq.org/xsd/jooq-codegen}Generator"/>
|
||||
* <element name="jdbc" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}Jdbc"/>
|
||||
* <element name="generator" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}Generator"/>
|
||||
* </all>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="masterDataTable" type="{http://www.jooq.org/xsd/jooq-codegen}MasterDataTable" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="masterDataTable" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}MasterDataTable" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
@ -53,7 +53,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="enumType" type="{http://www.jooq.org/xsd/jooq-codegen}EnumType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="enumType" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}EnumType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
@ -64,7 +64,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="forcedType" type="{http://www.jooq.org/xsd/jooq-codegen}ForcedType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="forcedType" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}ForcedType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
@ -327,7 +327,7 @@ public class Database {
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="enumType" type="{http://www.jooq.org/xsd/jooq-codegen}EnumType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="enumType" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}EnumType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
@ -386,7 +386,7 @@ public class Database {
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="forcedType" type="{http://www.jooq.org/xsd/jooq-codegen}ForcedType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="forcedType" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}ForcedType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
@ -445,7 +445,7 @@ public class Database {
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="masterDataTable" type="{http://www.jooq.org/xsd/jooq-codegen}MasterDataTable" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="masterDataTable" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}MasterDataTable" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
@ -29,10 +29,10 @@ import javax.xml.bind.annotation.XmlType;
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <all>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="strategy" type="{http://www.jooq.org/xsd/jooq-codegen}Strategy" minOccurs="0"/>
|
||||
* <element name="database" type="{http://www.jooq.org/xsd/jooq-codegen}Database"/>
|
||||
* <element name="generate" type="{http://www.jooq.org/xsd/jooq-codegen}Generate" minOccurs="0"/>
|
||||
* <element name="target" type="{http://www.jooq.org/xsd/jooq-codegen}Target" minOccurs="0"/>
|
||||
* <element name="strategy" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}Strategy" minOccurs="0"/>
|
||||
* <element name="database" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}Database"/>
|
||||
* <element name="generate" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}Generate" minOccurs="0"/>
|
||||
* <element name="target" type="{http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd}Target" minOccurs="0"/>
|
||||
* </all>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <all>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="literal" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="literal" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </all>
|
||||
* </restriction>
|
||||
@ -47,7 +47,6 @@ public class MasterDataTable {
|
||||
|
||||
@XmlElement(required = true)
|
||||
protected String name;
|
||||
@XmlElement(required = true)
|
||||
protected String literal;
|
||||
protected String description;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
@ -36,6 +36,46 @@ public class ObjectFactory {
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Strategy }
|
||||
*
|
||||
*/
|
||||
public Strategy createStrategy() {
|
||||
return new Strategy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Jdbc }
|
||||
*
|
||||
*/
|
||||
public Jdbc createJdbc() {
|
||||
return new Jdbc();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Database }
|
||||
*
|
||||
*/
|
||||
public Database createDatabase() {
|
||||
return new Database();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Generate }
|
||||
*
|
||||
*/
|
||||
public Generate createGenerate() {
|
||||
return new Generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Target }
|
||||
*
|
||||
*/
|
||||
public Target createTarget() {
|
||||
return new Target();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Database.MasterDataTables }
|
||||
*
|
||||
@ -44,14 +84,6 @@ public class ObjectFactory {
|
||||
return new Database.MasterDataTables();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link ForcedType }
|
||||
*
|
||||
*/
|
||||
public ForcedType createForcedType() {
|
||||
return new ForcedType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Generator }
|
||||
*
|
||||
@ -68,22 +100,6 @@ public class ObjectFactory {
|
||||
return new MasterDataTable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link EnumType }
|
||||
*
|
||||
*/
|
||||
public EnumType createEnumType() {
|
||||
return new EnumType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Strategy }
|
||||
*
|
||||
*/
|
||||
public Strategy createStrategy() {
|
||||
return new Strategy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Database.ForcedTypes }
|
||||
*
|
||||
@ -93,43 +109,19 @@ public class ObjectFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Target }
|
||||
* Create an instance of {@link EnumType }
|
||||
*
|
||||
*/
|
||||
public Target createTarget() {
|
||||
return new Target();
|
||||
public EnumType createEnumType() {
|
||||
return new EnumType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Configuration }
|
||||
* Create an instance of {@link ForcedType }
|
||||
*
|
||||
*/
|
||||
public Configuration createConfiguration() {
|
||||
return new Configuration();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Jdbc }
|
||||
*
|
||||
*/
|
||||
public Jdbc createJdbc() {
|
||||
return new Jdbc();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Generate }
|
||||
*
|
||||
*/
|
||||
public Generate createGenerate() {
|
||||
return new Generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Database }
|
||||
*
|
||||
*/
|
||||
public Database createDatabase() {
|
||||
return new Database();
|
||||
public ForcedType createForcedType() {
|
||||
return new ForcedType();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,4 +132,12 @@ public class ObjectFactory {
|
||||
return new Database.EnumTypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link Configuration }
|
||||
*
|
||||
*/
|
||||
public Configuration createConfiguration() {
|
||||
return new Configuration();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
|
||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||
// Generated on: 2012.01.29 at 09:33:16 PM MEZ
|
||||
// Generated on: 2012.01.29 at 10:08:11 PM MEZ
|
||||
//
|
||||
|
||||
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jooq.org/xsd/jooq-codegen", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
|
||||
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
|
||||
package org.jooq.util.jaxb;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.jooq.org/xsd/jooq-codegen"
|
||||
targetNamespace="http://www.jooq.org/xsd/jooq-codegen"
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd"
|
||||
targetNamespace="http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<element name="configuration">
|
||||
@ -121,7 +122,7 @@
|
||||
</annotation>
|
||||
<all>
|
||||
<element name="name" type="string" minOccurs="1" maxOccurs="1" />
|
||||
<element name="literal" type="string" minOccurs="1"
|
||||
<element name="literal" type="string" minOccurs="0"
|
||||
maxOccurs="1" />
|
||||
<element name="description" type="string" minOccurs="0"
|
||||
maxOccurs="1" />
|
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd">
|
||||
<jdbc>
|
||||
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
|
||||
<url>jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks;integratedSecurity=true</url>
|
||||
<schema>dbo</schema>
|
||||
<user></user>
|
||||
<password></password>
|
||||
</jdbc>
|
||||
<generator>
|
||||
<name>org.jooq.util.DefaultGenerator</name>
|
||||
<database>
|
||||
<name>org.jooq.util.sqlserver.SQLServerDatabase</name>
|
||||
<includes>.*</includes>
|
||||
<excludes></excludes>
|
||||
<dateAsTimestamp>false</dateAsTimestamp>
|
||||
</database>
|
||||
<generate>
|
||||
<relations>true</relations>
|
||||
<deprecated>true</deprecated>
|
||||
<instanceFields>true</instanceFields>
|
||||
<unsignedTypes>true</unsignedTypes>
|
||||
<generatedAnnotation>false</generatedAnnotation>
|
||||
</generate>
|
||||
<target>
|
||||
<packageName>org.jooq.examples.sqlserver.adventureworks.dbo</packageName>
|
||||
<directory>./examples</directory>
|
||||
</target>
|
||||
</generator>
|
||||
</configuration>
|
||||
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd">
|
||||
<jdbc>
|
||||
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
|
||||
<url>jdbc:sqlserver://localhost:1433;databaseName=test;integratedSecurity=true</url>
|
||||
<schema>dbo</schema>
|
||||
<user></user>
|
||||
<password></password>
|
||||
</jdbc>
|
||||
<generator>
|
||||
<name>org.jooq.util.DefaultGenerator</name>
|
||||
<strategy/>
|
||||
<database>
|
||||
<name>org.jooq.util.sqlserver.SQLServerDatabase</name>
|
||||
<includes>t_.*,x_.*,v_.*,p_.*,f_.*,(f|p)[0-9]+,s_.*</includes>
|
||||
<excludes>t_book_details</excludes>
|
||||
<dateAsTimestamp>false</dateAsTimestamp>
|
||||
<masterDataTables>
|
||||
<masterDataTable>
|
||||
<name>t_language</name>
|
||||
<literal>cd</literal>
|
||||
<description>description</description>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_11</name>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_21</name>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_31</name>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_12</name>
|
||||
<literal>cd</literal>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_22</name>
|
||||
<literal>cd</literal>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_32</name>
|
||||
<literal>cd</literal>
|
||||
</masterDataTable>
|
||||
</masterDataTables>
|
||||
<enumTypes>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YN_LC</name>
|
||||
<literals>y,"n"</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YN_UC</name>
|
||||
<literals>"Y",N</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_TRUE_FALSE_LC</name>
|
||||
<literals>true,false</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_TRUE_FALSE_UC</name>
|
||||
<literals>TRUE,FALSE</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_10</name>
|
||||
<literals>1,0</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YES_NO_LC</name>
|
||||
<literals>yes,no</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YES_NO_UC</name>
|
||||
<literals>"YES","NO"</literals>
|
||||
</enumType>
|
||||
</enumTypes>
|
||||
<forcedTypes>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YES_NO_LC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.YES_NO_LC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YES_NO_UC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.YES_NO_UC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YN_LC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.Y_N_LC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YN_UC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.Y_N_UC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_TRUE_FALSE_LC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.TRUE_FALSE_LC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_TRUE_FALSE_UC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.TRUE_FALSE_UC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BIT</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.(VC|C|N)_BOOLEAN)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_10</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.ONE_ZERO)</expressions>
|
||||
</forcedType>
|
||||
</forcedTypes>
|
||||
</database>
|
||||
<generate>
|
||||
<relations>true</relations>
|
||||
<deprecated>true</deprecated>
|
||||
<instanceFields>true</instanceFields>
|
||||
<unsignedTypes>true</unsignedTypes>
|
||||
<generatedAnnotation>false</generatedAnnotation>
|
||||
</generate>
|
||||
<target>
|
||||
<packageName>org.jooq.test.sqlserver.generatedclasses</packageName>
|
||||
<directory>./src</directory>
|
||||
</target>
|
||||
</generator>
|
||||
</configuration>
|
||||
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-2.0.4.xsd">
|
||||
<jdbc>
|
||||
<driver>com.sybase.jdbc3.jdbc.SybDriver</driver>
|
||||
<url>jdbc:sybase:Tds:localhost:2638</url>
|
||||
<schema>dba</schema>
|
||||
<user>dba</user>
|
||||
<password>sql</password>
|
||||
</jdbc>
|
||||
<generator>
|
||||
<name>org.jooq.util.DefaultGenerator</name>
|
||||
<strategy/>
|
||||
<database>
|
||||
<name>org.jooq.util.sybase.SybaseDatabase</name>
|
||||
<includes>t_.*,x_.*,v_.*,V_.*,p_.*,f_.*,(f|p)[0-9]+,s_.*</includes>
|
||||
<excludes>t_book_details</excludes>
|
||||
<dateAsTimestamp>false</dateAsTimestamp>
|
||||
<masterDataTables>
|
||||
<masterDataTable>
|
||||
<name>t_language</name>
|
||||
<literal>cd</literal>
|
||||
<description>description</description>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_11</name>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_21</name>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_31</name>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_12</name>
|
||||
<literal>cd</literal>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_22</name>
|
||||
<literal>cd</literal>
|
||||
</masterDataTable>
|
||||
<masterDataTable>
|
||||
<name>t_658_32</name>
|
||||
<literal>cd</literal>
|
||||
</masterDataTable>
|
||||
</masterDataTables>
|
||||
<enumTypes>
|
||||
<enumType>
|
||||
<name>BOOLEAN_TRUE_FALSE_LC</name>
|
||||
<literals>true,false</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_TRUE_FALSE_UC</name>
|
||||
<literals>TRUE,FALSE</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YN_LC</name>
|
||||
<literals>y,"n"</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YN_UC</name>
|
||||
<literals>"Y",N</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_10</name>
|
||||
<literals>1,0</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YES_NO_LC</name>
|
||||
<literals>yes,no</literals>
|
||||
</enumType>
|
||||
<enumType>
|
||||
<name>BOOLEAN_YES_NO_UC</name>
|
||||
<literals>"YES","NO"</literals>
|
||||
</enumType>
|
||||
</enumTypes>
|
||||
<forcedTypes>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YN_LC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.Y_N_LC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YN_UC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.Y_N_UC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_10</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.ONE_ZERO)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_TRUE_FALSE_LC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.TRUE_FALSE_LC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_TRUE_FALSE_UC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.TRUE_FALSE_UC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YES_NO_LC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.YES_NO_LC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BOOLEAN_YES_NO_UC</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.YES_NO_UC)</expressions>
|
||||
</forcedType>
|
||||
<forcedType>
|
||||
<name>BIT</name>
|
||||
<expressions>(?i:(.*?.)?T_BOOLEANS.(VC|C|N)_BOOLEAN)</expressions>
|
||||
</forcedType>
|
||||
</forcedTypes>
|
||||
</database>
|
||||
<generate>
|
||||
<relations>true</relations>
|
||||
<deprecated>true</deprecated>
|
||||
<instanceFields>true</instanceFields>
|
||||
<unsignedTypes>true</unsignedTypes>
|
||||
<generatedAnnotation>false</generatedAnnotation>
|
||||
</generate>
|
||||
<target>
|
||||
<packageName>org.jooq.test.sybase.generatedclasses</packageName>
|
||||
<directory>./src</directory>
|
||||
</target>
|
||||
</generator>
|
||||
</configuration>
|
||||
32
jOOQ-test/launch/GenerationTool - migrate.launch
Normal file
32
jOOQ-test/launch/GenerationTool - migrate.launch
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<stringAttribute key="bad_container_name" value="/jOOQ-codegen/launch"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/jOOQ-meta"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" javaProject="jOOQ-codegen" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="3" projectName="jOOU" type="1"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="3" projectName="jOOQ" type="1"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="3" projectName="jOOQ-codegen" type="1"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="3" projectName="jOOQ-test" type="1"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/jOOQ-test/lib/jconn3.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="3" projectName="jOOQ-meta" type="1"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" javaProject="jOOQ-meta" path="3" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/jOOQ-test/lib/log4j-1.2.16.jar" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jooq.util.GenerationTool"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sqlserver/adventureworks.properties migrate"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jOOQ-meta"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:jOOQ-test}"/>
|
||||
</launchConfiguration>
|
||||
@ -36,7 +36,7 @@
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jooq.util.GenerationTool"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sqlserver/adventureworks.properties"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sqlserver/adventureworks.xml"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jOOQ-codegen"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.library.path=C:\sqljdbc_3.0\enu\auth\x64"/>
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jooq.util.GenerationTool"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sqlserver/library.properties"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sqlserver/library.xml"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jOOQ-codegen"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.library.path=C:\sqljdbc_3.0\enu\auth\x64"/>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jooq.util.GenerationTool"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sybase/library.properties"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/sybase/library.xml"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jOOQ-meta"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:jOOQ-test}"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user