[jOOQ/jOOQ#17624] Add support for per-generation-mode type <includes> and <excludes> matching

This commit is contained in:
Lukas Eder 2024-11-15 08:54:08 +01:00
parent 4339e3ba8d
commit ee6db644ea
7 changed files with 680 additions and 11 deletions

View File

@ -38,6 +38,7 @@
package org.jooq.codegen;
import static java.lang.Boolean.TRUE;
import static java.util.Arrays.asList;
import static java.util.Collections.emptySet;
import java.io.File;
@ -50,6 +51,7 @@ import java.util.stream.Stream;
import org.jooq.meta.CatalogDefinition;
import org.jooq.meta.Database;
import org.jooq.meta.Definition;
import org.jooq.meta.SchemaDefinition;
import org.jooq.meta.jaxb.GeneratedAnnotationType;
import org.jooq.meta.jaxb.GeneratedSerialVersionUID;
@ -104,10 +106,14 @@ abstract class AbstractGenerator implements Generator {
boolean generateTables = true;
boolean generateEmbeddables = true;
boolean generateRecords = true;
String generateRecordsIncludes;
String generateRecordsExcludes;
boolean generateRecordsImplementingRecordN = false;
boolean generateEnumsAsScalaSealedTraits = false;
boolean generateEnumsAsScalaEnums = true;
boolean generatePojos = false;
String generatePojosIncludes;
String generatePojosExcludes;
boolean generatePojosAsJavaRecordClasses = false;
boolean generatePojosAsScalaCaseClasses = true;
boolean generatePojosAsKotlinDataClasses = true;
@ -122,6 +128,8 @@ abstract class AbstractGenerator implements Generator {
boolean generateImmutableInterfaces = false;
boolean generateSerializableInterfaces = true;
boolean generateDaos = false;
String generateDaosIncludes;
String generateDaosExcludes;
boolean generateJooqVersionReference = true;
boolean generateJPAAnnotations = false;
String generateJPAVersion = "";
@ -648,6 +656,15 @@ abstract class AbstractGenerator implements Generator {
this.generateEmbeddables = generateEmbeddables;
}
@Override
public boolean generateRecordsIncluded(Definition definition) {
return generateRecords()
&& !database.filterExcludeInclude(asList(definition),
generateRecordsIncludes(),
generateRecordsExcludes()
).isEmpty();
}
@Override
public boolean generateRecords() {
@ -660,6 +677,26 @@ abstract class AbstractGenerator implements Generator {
this.generateRecords = generateRecords;
}
@Override
public String generateRecordsIncludes() {
return generateRecordsIncludes;
}
@Override
public void setGenerateRecordsIncludes(String generateRecordsIncludes) {
this.generateRecordsIncludes = generateRecordsIncludes;
}
@Override
public String generateRecordsExcludes() {
return generateRecordsExcludes;
}
@Override
public void setGenerateRecordsExcludes(String generateRecordsExcludes) {
this.generateRecordsExcludes = generateRecordsExcludes;
}
@Override
public boolean generateRecordsImplementingRecordN() {
return generateRecords() && generateRecordsImplementingRecordN;
@ -693,6 +730,15 @@ abstract class AbstractGenerator implements Generator {
this.generateEnumsAsScalaEnums = generateEnumsAsScalaEnums;
}
@Override
public boolean generatePojosIncluded(Definition definition) {
return generatePojos()
&& !database.filterExcludeInclude(asList(definition),
generatePojosIncludes(),
generatePojosExcludes()
).isEmpty();
}
@Override
public boolean generatePojos() {
@ -708,6 +754,26 @@ abstract class AbstractGenerator implements Generator {
this.generatePojos = generatePojos;
}
@Override
public String generatePojosIncludes() {
return generatePojosIncludes;
}
@Override
public void setGeneratePojosIncludes(String generatePojosIncludes) {
this.generatePojosIncludes = generatePojosIncludes;
}
@Override
public String generatePojosExcludes() {
return generatePojosExcludes;
}
@Override
public void setGeneratePojosExcludes(String generatePojosExcludes) {
this.generatePojosExcludes = generatePojosExcludes;
}
@Override
public boolean generatePojosAsJavaRecordClasses() {
return generatePojosAsJavaRecordClasses;
@ -788,6 +854,15 @@ abstract class AbstractGenerator implements Generator {
this.generateSerializableInterfaces = generateSerializableInterfaces;
}
@Override
public boolean generateDaosIncluded(Definition definition) {
return generateDaos()
&& !database.filterExcludeInclude(asList(definition),
generateDaosIncludes(),
generateDaosExcludes()
).isEmpty();
}
@Override
public boolean generateDaos() {
return generateDaos;
@ -798,6 +873,26 @@ abstract class AbstractGenerator implements Generator {
this.generateDaos = generateDaos;
}
@Override
public String generateDaosIncludes() {
return generateDaosIncludes;
}
@Override
public void setGenerateDaosIncludes(String generateDaosIncludes) {
this.generateDaosIncludes = generateDaosIncludes;
}
@Override
public String generateDaosExcludes() {
return generateDaosExcludes;
}
@Override
public void setGenerateDaosExcludes(String generateDaosExcludes) {
this.generateDaosExcludes = generateDaosExcludes;
}
@Override
public boolean generateJooqVersionReference() {
return generateJooqVersionReference;

View File

@ -810,6 +810,10 @@ public class GenerationTool {
generator.setGenerateEmbeddables(g.getGenerate().isEmbeddables());
if (g.getGenerate().isRecords() != null)
generator.setGenerateRecords(g.getGenerate().isRecords());
if (g.getGenerate().getRecordsIncludes() != null)
generator.setGenerateRecordsIncludes(g.getGenerate().getRecordsIncludes());
if (g.getGenerate().getRecordsExcludes() != null)
generator.setGenerateRecordsIncludes(g.getGenerate().getRecordsExcludes());
if (g.getGenerate().isRecordsImplementingRecordN() != null)
generator.setGenerateRecordsImplementingRecordN(g.getGenerate().isRecordsImplementingRecordN());
if (g.getGenerate().isEnumsAsScalaSealedTraits() != null)
@ -818,6 +822,10 @@ public class GenerationTool {
generator.setGenerateEnumsAsScalaEnums(g.getGenerate().isEnumsAsScalaEnums());
if (g.getGenerate().isPojos() != null)
generator.setGeneratePojos(g.getGenerate().isPojos());
if (g.getGenerate().getPojosIncludes() != null)
generator.setGeneratePojosIncludes(g.getGenerate().getPojosIncludes());
if (g.getGenerate().getPojosExcludes() != null)
generator.setGeneratePojosExcludes(g.getGenerate().getPojosExcludes());
if (g.getGenerate().isPojosAsJavaRecordClasses() != null)
generator.setGeneratePojosAsJavaRecordClasses(g.getGenerate().isPojosAsJavaRecordClasses());
if (g.getGenerate().isPojosAsScalaCaseClasses() != null)
@ -836,6 +844,10 @@ public class GenerationTool {
generator.setGenerateSerializableInterfaces(g.getGenerate().isSerializableInterfaces());
if (g.getGenerate().isDaos() != null)
generator.setGenerateDaos(g.getGenerate().isDaos());
if (g.getGenerate().getDaosIncludes() != null)
generator.setGenerateDaosIncludes(g.getGenerate().getDaosIncludes());
if (g.getGenerate().getDaosExcludes() != null)
generator.setGenerateDaosExcludes(g.getGenerate().getDaosExcludes());
if (g.getGenerate().isJooqVersionReference() != null)
generator.setGenerateJooqVersionReference(g.getGenerate().isJooqVersionReference());
if (g.getGenerate().isJpaAnnotations() != null)

View File

@ -475,11 +475,41 @@ public interface Generator {
*/
void setGenerateEmbeddables(boolean generateEmbeddables);
/**
* Whether TableRecords should be generated in addition to tables for a
* specific {@link Definition}.
*/
boolean generateRecordsIncluded(Definition definition);
/**
* Whether TableRecords should be generated in addition to tables
*/
boolean generateRecords();
/**
* A regular expression matching all the object identifiers for which to
* generate records, by default, all of them.
*/
void setGenerateRecordsIncludes(String generateRecordsIncludes);
/**
* A regular expression matching all the object identifiers for which to
* generate records, by default, all of them.
*/
String generateRecordsIncludes();
/**
* A regular expression matching all the object identifiers for which not to
* generate records.
*/
void setGenerateRecordsExcludes(String generateRecordsExcludes);
/**
* A regular expression matching all the object identifiers for which not to
* generate records.
*/
String generateRecordsExcludes();
/**
* Whether TableRecords should be generated in addition to tables
*/
@ -530,15 +560,45 @@ public interface Generator {
void setGenerateEnumsAsScalaEnums(boolean generateEnumsAsScalaEnums);
/**
* Whether POJO's should be generated in addition to records
* Whether POJOs should be generated in addition to tables for a
* specific {@link Definition}.
*/
boolean generatePojosIncluded(Definition definition);
/**
* Whether POJOs should be generated in addition to records
*/
boolean generatePojos();
/**
* Whether POJO's should be generated in addition to records
* Whether POJOs should be generated in addition to records
*/
void setGeneratePojos(boolean generatePojos);
/**
* A regular expression matching all the object identifiers for which to
* generate POJOs, by default, all of them.
*/
String generatePojosIncludes();
/**
* A regular expression matching all the object identifiers for which to
* generate POJOs, by default, all of them.
*/
void setGeneratePojosIncludes(String generatePojosIncludes);
/**
* A regular expression matching all the object identifiers for which not to
* generate POJOs.
*/
String generatePojosExcludes();
/**
* A regular expression matching all the object identifiers for which not to
* generate POJOs.
*/
void setGeneratePojosExcludes(String generatePojosExcludes);
/**
* Whether POJOs should be generated as Java records by the
* {@link JavaGenerator}.
@ -628,15 +688,45 @@ public interface Generator {
void setGenerateSerializableInterfaces(boolean generateSerializableInterfaces);
/**
* Whether DAO's should be generated in addition to pojos
* Whether DAOs should be generated in addition to tables for a
* specific {@link Definition}.
*/
boolean generateDaosIncluded(Definition definition);
/**
* Whether DAOs should be generated in addition to pojos
*/
boolean generateDaos();
/**
* Whether DAO's should be generated in addition to pojos
* Whether DAOs should be generated in addition to pojos
*/
void setGenerateDaos(boolean generateDaos);
/**
* A regular expression matching all the object identifiers for which to
* generate DAOs, by default, all of them.
*/
String generateDaosIncludes();
/**
* A regular expression matching all the object identifiers for which to
* generate DAOs, by default, all of them.
*/
void setGenerateDaosIncludes(String generateDaosIncludes);
/**
* A regular expression matching all the object identifiers for which not to
* generate DAOs.
*/
String generateDaosExcludes();
/**
* A regular expression matching all the object identifiers for which not to
* generate DAOs.
*/
void setGenerateDaosExcludes(String generateDaosExcludes);
/**
* Whether generated objects should reference the runtime jOOQ version in
* {@link Constants}, to help debug code generator / runtime version

View File

@ -322,7 +322,7 @@ class GeneratorStrategyWrapper extends AbstractDelegatingGeneratorStrategy {
return name;
// [#1150] Intercept Mode.RECORD calls for tables
if (definition instanceof TableDefinition && !generator.generateRecords() && mode == Mode.RECORD)
if (definition instanceof TableDefinition && mode == Mode.RECORD && !generator.generateRecordsIncluded(definition))
return Record.class.getSimpleName();
String className;
@ -358,7 +358,7 @@ class GeneratorStrategyWrapper extends AbstractDelegatingGeneratorStrategy {
public String getJavaPackageName(Definition definition, Mode mode) {
// [#1150] Intercept Mode.RECORD calls for tables
if (!generator.generateRecords() && mode == Mode.RECORD && definition instanceof TableDefinition)
if (definition instanceof TableDefinition && mode == Mode.RECORD && !generator.generateRecordsIncluded(definition))
return Record.class.getPackage().getName();
return fixJavaPackageName(delegate.getJavaPackageName(definition, mode));

View File

@ -1651,10 +1651,12 @@ public class JavaGenerator extends AbstractGenerator {
for (TableDefinition table : database.getTables(schema)) {
try {
if (table.isTableValuedFunction() && table.getReferencedTableOrUDT() != table)
continue;
if (generateRecordsIncluded(table)) {
if (table.isTableValuedFunction() && table.getReferencedTableOrUDT() != table)
continue;
generateRecord(table);
generateRecord(table);
}
}
catch (Exception e) {
log.error("Error while generating table record " + table, e);
@ -5219,7 +5221,8 @@ public class JavaGenerator extends AbstractGenerator {
for (TableDefinition table : database.getTables(schema)) {
try {
generateDao(table);
if (generateDaosIncluded(table))
generateDao(table);
}
catch (Exception e) {
log.error("Error while generating table DAO " + table, e);
@ -5853,7 +5856,8 @@ public class JavaGenerator extends AbstractGenerator {
for (TableDefinition table : database.getTables(schema)) {
try {
generatePojo(table);
if (generatePojosIncluded(table))
generatePojo(table);
}
catch (Exception e) {
log.error("Error while generating table POJO " + table, e);

View File

@ -106,6 +106,10 @@ public class Generate implements Serializable, XMLAppendable
protected Boolean embeddables = true;
@XmlElement(defaultValue = "true")
protected Boolean records = true;
@XmlJavaTypeAdapter(StringAdapter.class)
protected String recordsIncludes;
@XmlJavaTypeAdapter(StringAdapter.class)
protected String recordsExcludes;
@XmlElement(defaultValue = "false")
protected Boolean recordsImplementingRecordN = false;
@XmlElement(defaultValue = "false")
@ -114,6 +118,10 @@ public class Generate implements Serializable, XMLAppendable
protected Boolean enumsAsScalaEnums = true;
@XmlElement(defaultValue = "false")
protected Boolean pojos = false;
@XmlJavaTypeAdapter(StringAdapter.class)
protected String pojosIncludes;
@XmlJavaTypeAdapter(StringAdapter.class)
protected String pojosExcludes;
@XmlElement(defaultValue = "true")
protected Boolean pojosEqualsAndHashCode = true;
@XmlElement(defaultValue = "true")
@ -144,6 +152,10 @@ public class Generate implements Serializable, XMLAppendable
protected Boolean serializableInterfaces = true;
@XmlElement(defaultValue = "false")
protected Boolean daos = false;
@XmlJavaTypeAdapter(StringAdapter.class)
protected String daosIncludes;
@XmlJavaTypeAdapter(StringAdapter.class)
protected String daosExcludes;
@XmlElement(defaultValue = "true")
protected Boolean jooqVersionReference = true;
@XmlElement(defaultValue = "false")
@ -1177,6 +1189,74 @@ public class Generate implements Serializable, XMLAppendable
this.records = value;
}
/**
* All the object identifiers for which to generate records, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public String getRecordsIncludes() {
return recordsIncludes;
}
/**
* All the object identifiers for which to generate records, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public void setRecordsIncludes(String value) {
this.recordsIncludes = value;
}
/**
* All the object identifiers for which not to generate records.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public String getRecordsExcludes() {
return recordsExcludes;
}
/**
* All the object identifiers for which not to generate records.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public void setRecordsExcludes(String value) {
this.recordsExcludes = value;
}
/**
* Generate TableRecord classes that implement Record[N] super types
*
@ -1275,6 +1355,74 @@ public class Generate implements Serializable, XMLAppendable
this.pojos = value;
}
/**
* All the object identifiers for which to generate POJOs, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public String getPojosIncludes() {
return pojosIncludes;
}
/**
* All the object identifiers for which to generate POJOs, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public void setPojosIncludes(String value) {
this.pojosIncludes = value;
}
/**
* All the object identifiers for which not to generate POJOs.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public String getPojosExcludes() {
return pojosExcludes;
}
/**
* All the object identifiers for which not to generate POJOs.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public void setPojosExcludes(String value) {
this.pojosExcludes = value;
}
/**
* Generate basic equals() and hashCode() methods in POJOs.
*
@ -1595,6 +1743,74 @@ public class Generate implements Serializable, XMLAppendable
this.daos = value;
}
/**
* All the object identifiers for which to generate DAOs, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public String getDaosIncludes() {
return daosIncludes;
}
/**
* All the object identifiers for which to generate DAOs, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public void setDaosIncludes(String value) {
this.daosIncludes = value;
}
/**
* All the object identifiers for which not to generate DAOs.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public String getDaosExcludes() {
return daosExcludes;
}
/**
* All the object identifiers for which not to generate DAOs.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public void setDaosExcludes(String value) {
this.daosExcludes = value;
}
/**
* Generate references to the most up to date minor release in {@link org.jooq.Constants} to produce compilation errors if an outdated runtime library is being used.
*
@ -3669,6 +3885,42 @@ public class Generate implements Serializable, XMLAppendable
return this;
}
/**
* All the object identifiers for which to generate records, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public Generate withRecordsIncludes(String value) {
setRecordsIncludes(value);
return this;
}
/**
* All the object identifiers for which not to generate records.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public Generate withRecordsExcludes(String value) {
setRecordsExcludes(value);
return this;
}
/**
* Generate TableRecord classes that implement Record[N] super types
*
@ -3705,6 +3957,42 @@ public class Generate implements Serializable, XMLAppendable
return this;
}
/**
* All the object identifiers for which to generate POJOs, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public Generate withPojosIncludes(String value) {
setPojosIncludes(value);
return this;
}
/**
* All the object identifiers for which not to generate POJOs.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public Generate withPojosExcludes(String value) {
setPojosExcludes(value);
return this;
}
/**
* Generate basic equals() and hashCode() methods in POJOs.
*
@ -3831,6 +4119,42 @@ public class Generate implements Serializable, XMLAppendable
return this;
}
/**
* All the object identifiers for which to generate DAOs, by default, all of them.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public Generate withDaosIncludes(String value) {
setDaosIncludes(value);
return this;
}
/**
* All the object identifiers for which not to generate DAOs.
* <p>
* This is a Java regular expression. Use the pipe to separate several expressions.
* Watch out for case-sensitivity. Depending on your database, this might be
* important!
* <p>
* You can create case-insensitive regular expressions
* using this syntax: <code>(?i:expr)</code>
* <p>
* Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.
*
*/
public Generate withDaosExcludes(String value) {
setDaosExcludes(value);
return this;
}
/**
* Generate references to the most up to date minor release in {@link org.jooq.Constants} to produce compilation errors if an outdated runtime library is being used.
*
@ -4550,10 +4874,14 @@ public class Generate implements Serializable, XMLAppendable
builder.append("tables", tables);
builder.append("embeddables", embeddables);
builder.append("records", records);
builder.append("recordsIncludes", recordsIncludes);
builder.append("recordsExcludes", recordsExcludes);
builder.append("recordsImplementingRecordN", recordsImplementingRecordN);
builder.append("enumsAsScalaSealedTraits", enumsAsScalaSealedTraits);
builder.append("enumsAsScalaEnums", enumsAsScalaEnums);
builder.append("pojos", pojos);
builder.append("pojosIncludes", pojosIncludes);
builder.append("pojosExcludes", pojosExcludes);
builder.append("pojosEqualsAndHashCode", pojosEqualsAndHashCode);
builder.append("pojosEqualsAndHashCodeIncludePrimaryKeyOnly", pojosEqualsAndHashCodeIncludePrimaryKeyOnly);
builder.append("pojosEqualsAndHashCodeColumnIncludeExpression", pojosEqualsAndHashCodeColumnIncludeExpression);
@ -4568,6 +4896,8 @@ public class Generate implements Serializable, XMLAppendable
builder.append("immutableInterfaces", immutableInterfaces);
builder.append("serializableInterfaces", serializableInterfaces);
builder.append("daos", daos);
builder.append("daosIncludes", daosIncludes);
builder.append("daosExcludes", daosExcludes);
builder.append("jooqVersionReference", jooqVersionReference);
builder.append("jpaAnnotations", jpaAnnotations);
builder.append("jpaVersion", jpaVersion);
@ -4994,6 +5324,24 @@ public class Generate implements Serializable, XMLAppendable
return false;
}
}
if (recordsIncludes == null) {
if (other.recordsIncludes!= null) {
return false;
}
} else {
if (!recordsIncludes.equals(other.recordsIncludes)) {
return false;
}
}
if (recordsExcludes == null) {
if (other.recordsExcludes!= null) {
return false;
}
} else {
if (!recordsExcludes.equals(other.recordsExcludes)) {
return false;
}
}
if (recordsImplementingRecordN == null) {
if (other.recordsImplementingRecordN!= null) {
return false;
@ -5030,6 +5378,24 @@ public class Generate implements Serializable, XMLAppendable
return false;
}
}
if (pojosIncludes == null) {
if (other.pojosIncludes!= null) {
return false;
}
} else {
if (!pojosIncludes.equals(other.pojosIncludes)) {
return false;
}
}
if (pojosExcludes == null) {
if (other.pojosExcludes!= null) {
return false;
}
} else {
if (!pojosExcludes.equals(other.pojosExcludes)) {
return false;
}
}
if (pojosEqualsAndHashCode == null) {
if (other.pojosEqualsAndHashCode!= null) {
return false;
@ -5156,6 +5522,24 @@ public class Generate implements Serializable, XMLAppendable
return false;
}
}
if (daosIncludes == null) {
if (other.daosIncludes!= null) {
return false;
}
} else {
if (!daosIncludes.equals(other.daosIncludes)) {
return false;
}
}
if (daosExcludes == null) {
if (other.daosExcludes!= null) {
return false;
}
} else {
if (!daosExcludes.equals(other.daosExcludes)) {
return false;
}
}
if (jooqVersionReference == null) {
if (other.jooqVersionReference!= null) {
return false;
@ -5848,10 +6232,14 @@ public class Generate implements Serializable, XMLAppendable
result = ((prime*result)+((tables == null)? 0 :tables.hashCode()));
result = ((prime*result)+((embeddables == null)? 0 :embeddables.hashCode()));
result = ((prime*result)+((records == null)? 0 :records.hashCode()));
result = ((prime*result)+((recordsIncludes == null)? 0 :recordsIncludes.hashCode()));
result = ((prime*result)+((recordsExcludes == null)? 0 :recordsExcludes.hashCode()));
result = ((prime*result)+((recordsImplementingRecordN == null)? 0 :recordsImplementingRecordN.hashCode()));
result = ((prime*result)+((enumsAsScalaSealedTraits == null)? 0 :enumsAsScalaSealedTraits.hashCode()));
result = ((prime*result)+((enumsAsScalaEnums == null)? 0 :enumsAsScalaEnums.hashCode()));
result = ((prime*result)+((pojos == null)? 0 :pojos.hashCode()));
result = ((prime*result)+((pojosIncludes == null)? 0 :pojosIncludes.hashCode()));
result = ((prime*result)+((pojosExcludes == null)? 0 :pojosExcludes.hashCode()));
result = ((prime*result)+((pojosEqualsAndHashCode == null)? 0 :pojosEqualsAndHashCode.hashCode()));
result = ((prime*result)+((pojosEqualsAndHashCodeIncludePrimaryKeyOnly == null)? 0 :pojosEqualsAndHashCodeIncludePrimaryKeyOnly.hashCode()));
result = ((prime*result)+((pojosEqualsAndHashCodeColumnIncludeExpression == null)? 0 :pojosEqualsAndHashCodeColumnIncludeExpression.hashCode()));
@ -5866,6 +6254,8 @@ public class Generate implements Serializable, XMLAppendable
result = ((prime*result)+((immutableInterfaces == null)? 0 :immutableInterfaces.hashCode()));
result = ((prime*result)+((serializableInterfaces == null)? 0 :serializableInterfaces.hashCode()));
result = ((prime*result)+((daos == null)? 0 :daos.hashCode()));
result = ((prime*result)+((daosIncludes == null)? 0 :daosIncludes.hashCode()));
result = ((prime*result)+((daosExcludes == null)? 0 :daosExcludes.hashCode()));
result = ((prime*result)+((jooqVersionReference == null)? 0 :jooqVersionReference.hashCode()));
result = ((prime*result)+((jpaAnnotations == null)? 0 :jpaAnnotations.hashCode()));
result = ((prime*result)+((jpaVersion == null)? 0 :jpaVersion.hashCode()));

View File

@ -2695,6 +2695,32 @@ jOOQ API, without adding custom data type bindings to them.]]></jxb:javadoc></jx
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Generate TableRecord classes.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="recordsIncludes" type="string" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[All the object identifiers for which to generate records, by default, all of them.
<p>
This is a Java regular expression. Use the pipe to separate several expressions.
Watch out for case-sensitivity. Depending on your database, this might be
important!
<p>
You can create case-insensitive regular expressions
using this syntax: <code>(?i:expr)</code>
<p>
Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="recordsExcludes" type="string" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[All the object identifiers for which not to generate records.
<p>
This is a Java regular expression. Use the pipe to separate several expressions.
Watch out for case-sensitivity. Depending on your database, this might be
important!
<p>
You can create case-insensitive regular expressions
using this syntax: <code>(?i:expr)</code>
<p>
Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="recordsImplementingRecordN" type="boolean" default="false" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Generate TableRecord classes that implement Record[N] super types]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
@ -2719,6 +2745,32 @@ jOOQ API, without adding custom data type bindings to them.]]></jxb:javadoc></jx
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Generate POJOs.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="pojosIncludes" type="string" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[All the object identifiers for which to generate POJOs, by default, all of them.
<p>
This is a Java regular expression. Use the pipe to separate several expressions.
Watch out for case-sensitivity. Depending on your database, this might be
important!
<p>
You can create case-insensitive regular expressions
using this syntax: <code>(?i:expr)</code>
<p>
Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="pojosExcludes" type="string" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[All the object identifiers for which not to generate POJOs.
<p>
This is a Java regular expression. Use the pipe to separate several expressions.
Watch out for case-sensitivity. Depending on your database, this might be
important!
<p>
You can create case-insensitive regular expressions
using this syntax: <code>(?i:expr)</code>
<p>
Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="pojosEqualsAndHashCode" type="boolean" default="true" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Generate basic equals() and hashCode() methods in POJOs.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
@ -2774,6 +2826,32 @@ jOOQ API, without adding custom data type bindings to them.]]></jxb:javadoc></jx
<element name="daos" type="boolean" default="false" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Generate DAOs.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="daosIncludes" type="string" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[All the object identifiers for which to generate DAOs, by default, all of them.
<p>
This is a Java regular expression. Use the pipe to separate several expressions.
Watch out for case-sensitivity. Depending on your database, this might be
important!
<p>
You can create case-insensitive regular expressions
using this syntax: <code>(?i:expr)</code>
<p>
Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="daosExcludes" type="string" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[All the object identifiers for which not to generate DAOs.
<p>
This is a Java regular expression. Use the pipe to separate several expressions.
Watch out for case-sensitivity. Depending on your database, this might be
important!
<p>
You can create case-insensitive regular expressions
using this syntax: <code>(?i:expr)</code>
<p>
Whitespace is ignored and comments are possible unless overridden in {@link #getRegexFlags()}.]]></jxb:javadoc></jxb:property></appinfo></annotation>
</element>
<element name="jooqVersionReference" type="boolean" default="true" minOccurs="0" maxOccurs="1">
<annotation><appinfo><jxb:property><jxb:javadoc><![CDATA[Generate references to the most up to date minor release in {@link org.jooq.Constants} to produce compilation errors if an outdated runtime library is being used.]]></jxb:javadoc></jxb:property></appinfo></annotation>