From f915b55590392b40d4e6c8a23c9be6b924957716 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 10 Jun 2022 15:57:07 +0200 Subject: [PATCH] [jOOQ/jOOQ#13655] Add XMLSchemaCollectionDefinition, XMLNamespaceDefinition, and XMLTypeDefinition to jOOQ-meta --- .../java/org/jooq/codegen/GenerationTool.java | 2 + .../java/org/jooq/codegen/JavaGenerator.java | 15 +- .../java/org/jooq/meta/AbstractDatabase.java | 668 ++++++++++-------- .../org/jooq/meta/AbstractMetaDatabase.java | 6 + .../org/jooq/meta/DataTypeDefinition.java | 5 + .../src/main/java/org/jooq/meta/Database.java | 45 ++ .../jooq/meta/DefaultDataTypeDefinition.java | 11 + .../meta/DefaultXMLNamespaceDefinition.java | 69 ++ .../DefaultXMLSchemaCollectionDefinition.java | 75 ++ .../jooq/meta/DefaultXMLTypeDefinition.java | 71 ++ .../org/jooq/meta/XMLNamespaceDefinition.java | 63 ++ .../meta/XMLSchemaCollectionDefinition.java | 64 ++ .../java/org/jooq/meta/XMLTypeDefinition.java | 64 ++ .../org/jooq/meta/cubrid/CUBRIDDatabase.java | 7 + .../org/jooq/meta/derby/DerbyDatabase.java | 7 + .../jooq/meta/firebird/FirebirdDatabase.java | 7 + .../java/org/jooq/meta/h2/H2Database.java | 7 + .../org/jooq/meta/hsqldb/HSQLDBDatabase.java | 7 + .../java/org/jooq/meta/jaxb/Database.java | 86 +++ .../org/jooq/meta/mysql/MySQLDatabase.java | 7 + .../jooq/meta/postgres/PostgresDatabase.java | 7 + .../org/jooq/meta/sqlite/SQLiteDatabase.java | 7 + .../java/org/jooq/meta/xml/XMLDatabase.java | 7 + .../org/jooq/meta/xsd/jooq-codegen-3.17.0.xsd | 12 +- 24 files changed, 1016 insertions(+), 303 deletions(-) create mode 100644 jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLNamespaceDefinition.java create mode 100644 jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLSchemaCollectionDefinition.java create mode 100644 jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLTypeDefinition.java create mode 100644 jOOQ-meta/src/main/java/org/jooq/meta/XMLNamespaceDefinition.java create mode 100644 jOOQ-meta/src/main/java/org/jooq/meta/XMLSchemaCollectionDefinition.java create mode 100644 jOOQ-meta/src/main/java/org/jooq/meta/XMLTypeDefinition.java diff --git a/jOOQ-codegen/src/main/java/org/jooq/codegen/GenerationTool.java b/jOOQ-codegen/src/main/java/org/jooq/codegen/GenerationTool.java index 287abda3e3..b8dc02bd77 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/GenerationTool.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/GenerationTool.java @@ -591,6 +591,7 @@ public class GenerationTool { database.setIncludeTables(!FALSE.equals(d.isIncludeTables())); database.setIncludeEmbeddables(!FALSE.equals(d.isIncludeEmbeddables())); database.setIncludeTriggerRoutines(TRUE.equals(d.isIncludeTriggerRoutines())); + database.setIncludeXMLSchemaCollections(!FALSE.equals(d.isIncludeXMLSchemaCollections())); database.setIncludeUDTs(!FALSE.equals(d.isIncludeUDTs())); database.setIncludeUniqueKeys(!FALSE.equals(d.isIncludeUniqueKeys())); database.setForceIntegerTypesOnZeroScaleDecimals(!FALSE.equals(d.isForceIntegerTypesOnZeroScaleDecimals())); @@ -603,6 +604,7 @@ public class GenerationTool { database.setConfiguredEnumTypes(d.getEnumTypes()); database.setConfiguredForcedTypes(d.getForcedTypes()); database.setForcedTypesForBuiltinDataTypeExtensions(d.isForcedTypesForBuiltinDataTypeExtensions()); + database.setForcedTypesForXMLSchemaCollections(d.isForcedTypesForXMLSchemaCollections()); database.setConfiguredEmbeddables(d.getEmbeddables()); database.setConfiguredComments(d.getComments()); database.setConfiguredSyntheticObjects(d.getSyntheticObjects()); diff --git a/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java b/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java index 072b49d4fd..2efcdef851 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java @@ -192,6 +192,7 @@ import org.jooq.meta.TableDefinition; import org.jooq.meta.TypedElementDefinition; import org.jooq.meta.UDTDefinition; import org.jooq.meta.UniqueKeyDefinition; +import org.jooq.meta.XMLTypeDefinition; import org.jooq.meta.jaxb.ForcedType; import org.jooq.meta.jaxb.GeneratedAnnotationType; import org.jooq.meta.jaxb.GeneratedTextBlocks; @@ -9314,7 +9315,8 @@ public class JavaGenerator extends AbstractGenerator { type.getQualifiedUserType(), type.getJavaType(), Object.class.getName(), - udtMode + udtMode, + type.getXMLTypeDefinition() ); } @@ -9339,10 +9341,19 @@ public class JavaGenerator extends AbstractGenerator { } protected String getType(Database db, SchemaDefinition schema, JavaWriter out, String t, int p, int s, Name u, String javaType, String defaultType, Mode udtMode) { + return getType(db, schema, out, t, p, s, u, javaType, defaultType, udtMode, null); + } + + protected String getType(Database db, SchemaDefinition schema, JavaWriter out, String t, int p, int s, Name u, String javaType, String defaultType, Mode udtMode, XMLTypeDefinition xmlType) { String type = defaultType; + // XML types + if (xmlType != null) { + type = getStrategy().getJavaClassName(xmlType); + } + // Custom types - if (javaType != null) { + else if (javaType != null) { type = javaType; } diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/AbstractDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/AbstractDatabase.java index b7a9fe5ddb..54f2032b75 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/AbstractDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/AbstractDatabase.java @@ -109,7 +109,6 @@ import org.jooq.conf.RenderQuotedNames; import org.jooq.exception.DataAccessException; import org.jooq.exception.DetachedException; import org.jooq.impl.DSL; -import org.jooq.impl.DefaultExecuteListener; import org.jooq.impl.SQLDataType; import org.jooq.meta.jaxb.CatalogMappingType; import org.jooq.meta.jaxb.CommentType; @@ -147,156 +146,160 @@ import org.jooq.tools.jdbc.JDBCUtils; */ public abstract class AbstractDatabase implements Database { - private static final JooqLogger log = JooqLogger.getLogger(AbstractDatabase.class); - private static final Set NO_SUPPORT_SCHEMATA = SQLDialect.supportedBy(CUBRID, FIREBIRD, SQLITE); + private static final JooqLogger log = JooqLogger.getLogger(AbstractDatabase.class); + private static final Set NO_SUPPORT_SCHEMATA = SQLDialect.supportedBy(CUBRID, FIREBIRD, SQLITE); // ------------------------------------------------------------------------- // Configuration elements // ------------------------------------------------------------------------- - private Properties properties; - private String basedir; - private SQLDialect dialect; - private Connection connection; - private boolean regexMatchesPartialQualification; - private boolean sqlMatchesPartialQualification; - private OnError onError = OnError.FAIL; - private List filters; - private String[] excludes; - private String[] includes = { ".*" }; - private boolean includeExcludeColumns = false; - private boolean includeExcludePackageRoutines = false; - private boolean includeInvisibleColumns = true; - private boolean includeTables = true; - private boolean includeEmbeddables = true; - private boolean includeRoutines = true; - private boolean includeTriggerRoutines = false; - private boolean includePackages = true; - private boolean includePackageRoutines = true; - private boolean includePackageUDTs = true; - private boolean includePackageConstants = true; - private boolean includeUDTs = true; - private boolean includeDomains = true; - private boolean includeSequences = true; - private boolean includeIndexes = true; - private boolean includeCheckConstraints = true; - private boolean includeSystemTables = false; - private boolean includeSystemIndexes = false; - private boolean includeSystemCheckConstraints = false; - private boolean includeSystemSequences = false; - private boolean includeSystemUDTs = false; - private boolean includePrimaryKeys = true; - private boolean includeUniqueKeys = true; - private boolean includeForeignKeys = true; - private boolean forceIntegerTypesOnZeroScaleDecimals = true; - private String[] recordVersionFields; - private String[] recordTimestampFields; - private String embeddablePrimaryKeys = null; - private String embeddableUniqueKeys = null; - private String embeddableDomains = null; - private boolean readonlyIdentities = false; - private boolean readonlyComputedColumns = true; - private boolean readonlyNonUpdatableColumns = true; - private boolean supportsUnsignedTypes; - private boolean integerDisplayWidths; - private boolean ignoreProcedureReturnValues; - private boolean dateAsTimestamp; - private boolean javaTimeTypes = true; - private List configuredCatalogs = new ArrayList<>(); - private List configuredSchemata = new ArrayList<>(); - private List configuredCustomTypes = new ArrayList<>(); - private List configuredEnumTypes = new ArrayList<>(); - private boolean forcedTypesForBuiltinDataTypeExtensions = true; - private boolean builtInForcedTypesInitialised = false; - private List configuredForcedTypes; - private Set unusedForcedTypes = new HashSet<>(); - private List configuredEmbeddables = new ArrayList<>(); - private Set unusedEmbeddables = new HashSet<>(); - private List configuredComments = new ArrayList<>(); - private Set unusedComments = new HashSet<>(); - private List configuredSyntheticColumns = new ArrayList<>(); - private Set unusedSyntheticColumns = new HashSet<>(); - private List configuredSyntheticReadonlyColumns = new ArrayList<>(); - private Set unusedSyntheticReadonlyColumns = new HashSet<>(); - private List configuredSyntheticReadonlyRowids = new ArrayList<>(); - private Set unusedSyntheticReadonlyRowids = new HashSet<>(); - private List configuredSyntheticIdentities = new ArrayList<>(); - private Set unusedSyntheticIdentities = new HashSet<>(); - private List configuredSyntheticPrimaryKeys = new ArrayList<>(); - private Set unusedSyntheticPrimaryKeys = new HashSet<>(); - private List configuredSyntheticUniqueKeys = new ArrayList<>(); - private Set unusedSyntheticUniqueKeys = new HashSet<>(); - private List configuredSyntheticForeignKeys = new ArrayList<>(); - private Set unusedSyntheticForeignKeys = new HashSet<>(); - private List configuredSyntheticViews = new ArrayList<>(); - private Set unusedSyntheticViews = new HashSet<>(); - private List configuredSyntheticDaos = new ArrayList<>(); - private SchemaVersionProvider schemaVersionProvider; - private CatalogVersionProvider catalogVersionProvider; - private Comparator orderProvider; - private boolean includeRelations = true; - private boolean tableValuedFunctions = true; - private int logSlowQueriesAfterSeconds; - private int logSlowResultsAfterSeconds; + private Properties properties; + private String basedir; + private SQLDialect dialect; + private Connection connection; + private boolean regexMatchesPartialQualification; + private boolean sqlMatchesPartialQualification; + private OnError onError = OnError.FAIL; + private List filters; + private String[] excludes; + private String[] includes = { ".*" }; + private boolean includeExcludeColumns = false; + private boolean includeExcludePackageRoutines = false; + private boolean includeInvisibleColumns = true; + private boolean includeXMLSchemaCollections = true; + private boolean includeTables = true; + private boolean includeEmbeddables = true; + private boolean includeRoutines = true; + private boolean includeTriggerRoutines = false; + private boolean includePackages = true; + private boolean includePackageRoutines = true; + private boolean includePackageUDTs = true; + private boolean includePackageConstants = true; + private boolean includeUDTs = true; + private boolean includeDomains = true; + private boolean includeSequences = true; + private boolean includeIndexes = true; + private boolean includeCheckConstraints = true; + private boolean includeSystemTables = false; + private boolean includeSystemIndexes = false; + private boolean includeSystemCheckConstraints = false; + private boolean includeSystemSequences = false; + private boolean includeSystemUDTs = false; + private boolean includePrimaryKeys = true; + private boolean includeUniqueKeys = true; + private boolean includeForeignKeys = true; + private boolean forceIntegerTypesOnZeroScaleDecimals = true; + private String[] recordVersionFields; + private String[] recordTimestampFields; + private String embeddablePrimaryKeys = null; + private String embeddableUniqueKeys = null; + private String embeddableDomains = null; + private boolean readonlyIdentities = false; + private boolean readonlyComputedColumns = true; + private boolean readonlyNonUpdatableColumns = true; + private boolean supportsUnsignedTypes; + private boolean integerDisplayWidths; + private boolean ignoreProcedureReturnValues; + private boolean dateAsTimestamp; + private boolean javaTimeTypes = true; + private List configuredCatalogs = new ArrayList<>(); + private List configuredSchemata = new ArrayList<>(); + private List configuredCustomTypes = new ArrayList<>(); + private List configuredEnumTypes = new ArrayList<>(); + private boolean forcedTypesForBuiltinDataTypeExtensions = true; + private boolean forcedTypesForXMLSchemaCollections = true; + private boolean builtInForcedTypesInitialised = false; + private List configuredForcedTypes; + private Set unusedForcedTypes = new HashSet<>(); + private List configuredEmbeddables = new ArrayList<>(); + private Set unusedEmbeddables = new HashSet<>(); + private List configuredComments = new ArrayList<>(); + private Set unusedComments = new HashSet<>(); + private List configuredSyntheticColumns = new ArrayList<>(); + private Set unusedSyntheticColumns = new HashSet<>(); + private List configuredSyntheticReadonlyColumns = new ArrayList<>(); + private Set unusedSyntheticReadonlyColumns = new HashSet<>(); + private List configuredSyntheticReadonlyRowids = new ArrayList<>(); + private Set unusedSyntheticReadonlyRowids = new HashSet<>(); + private List configuredSyntheticIdentities = new ArrayList<>(); + private Set unusedSyntheticIdentities = new HashSet<>(); + private List configuredSyntheticPrimaryKeys = new ArrayList<>(); + private Set unusedSyntheticPrimaryKeys = new HashSet<>(); + private List configuredSyntheticUniqueKeys = new ArrayList<>(); + private Set unusedSyntheticUniqueKeys = new HashSet<>(); + private List configuredSyntheticForeignKeys = new ArrayList<>(); + private Set unusedSyntheticForeignKeys = new HashSet<>(); + private List configuredSyntheticViews = new ArrayList<>(); + private Set unusedSyntheticViews = new HashSet<>(); + private List configuredSyntheticDaos = new ArrayList<>(); + private SchemaVersionProvider schemaVersionProvider; + private CatalogVersionProvider catalogVersionProvider; + private Comparator orderProvider; + private boolean includeRelations = true; + private boolean tableValuedFunctions = true; + private int logSlowQueriesAfterSeconds; + private int logSlowResultsAfterSeconds; // ------------------------------------------------------------------------- // Loaded definitions // ------------------------------------------------------------------------- - private Map sources; - private List inputCatalogs; - private List inputSchemata; - private Map> inputSchemataPerCatalog; - private List catalogs; - private List schemata; - private List sequences; - private List identities; - private List indexes; - private List primaryKeys; - private List uniqueKeys; - private List keys; - private List foreignKeys; - private List checkConstraints; - private List tables; - private List embeddables; - private List enums; - private List domains; - private List udts; - private List arrays; - private List routines; - private List packages; - private Relations relations; + private Map sources; + private List inputCatalogs; + private List inputSchemata; + private Map> inputSchemataPerCatalog; + private List catalogs; + private List schemata; + private List sequences; + private List identities; + private List indexes; + private List primaryKeys; + private List uniqueKeys; + private List keys; + private List foreignKeys; + private List checkConstraints; + private List tables; + private List embeddables; + private List enums; + private List domains; + private List xmlSchemaCollections; + private List udts; + private List arrays; + private List routines; + private List packages; + private Relations relations; - private transient Map> sequencesBySchema; - private transient Map> identitiesBySchema; - private transient Map> indexesBySchema; - private transient Map> indexesByTable; - private transient Map> primaryKeysBySchema; - private transient Map> uniqueKeysBySchema; - private transient Map> keysBySchema; - private transient Map> foreignKeysBySchema; - private transient Map> checkConstraintsBySchema; - private transient Map> tablesBySchema; - private transient Map> embeddablesByDefiningSchema; - private transient Map> embeddablesByDefiningTable; - private transient Map> embeddablesByReferencingTable; - private transient Map> enumsBySchema; - private transient Map> domainsBySchema; - private transient Map> udtsBySchema; - private transient Map> udtsByPackage; - private transient Map> arraysBySchema; - private transient Map> routinesBySchema; - private transient Map> packagesBySchema; - private transient boolean initialised; + private transient Map> sequencesBySchema; + private transient Map> identitiesBySchema; + private transient Map> indexesBySchema; + private transient Map> indexesByTable; + private transient Map> primaryKeysBySchema; + private transient Map> uniqueKeysBySchema; + private transient Map> keysBySchema; + private transient Map> foreignKeysBySchema; + private transient Map> checkConstraintsBySchema; + private transient Map> tablesBySchema; + private transient Map> embeddablesByDefiningSchema; + private transient Map> embeddablesByDefiningTable; + private transient Map> embeddablesByReferencingTable; + private transient Map> enumsBySchema; + private transient Map> domainsBySchema; + private transient Map> xmlSchemaCollectionsBySchema; + private transient Map> udtsBySchema; + private transient Map> udtsByPackage; + private transient Map> arraysBySchema; + private transient Map> routinesBySchema; + private transient Map> packagesBySchema; + private transient boolean initialised; // Other caches - private final List all; - private final List included; - private final List excluded; - private final Map, Boolean> existTables; - private final Map, Boolean> existFields; - private final Patterns patterns; - private final Statements statements; + private final List all; + private final List included; + private final List excluded; + private final Map, Boolean> existTables; + private final Map, Boolean> existFields; + private final Patterns patterns; + private final Statements statements; protected AbstractDatabase() { existTables = new HashMap<>(); @@ -755,6 +758,43 @@ public abstract class AbstractDatabase implements Database { return null; } + @Override + public final List getXMLSchemaCollections() { + if (xmlSchemaCollections == null) { + xmlSchemaCollections = new ArrayList<>(); + + if (getIncludeXMLSchemaCollections()) { + onError(ERROR, "Error while fetching XML schema collections", () -> { + List sc = getXMLSchemaCollections0(); + + xmlSchemaCollections = sort(filterExcludeInclude(sc)); + log.info("XML schema collections fetched", fetchedSize(sc, xmlSchemaCollections)); + }); + } + else + log.info("XML schema collections excluded"); + } + + return xmlSchemaCollections; + } + + @Override + public final List getXMLSchemaCollections(SchemaDefinition schema) { + if (xmlSchemaCollectionsBySchema == null) + xmlSchemaCollectionsBySchema = new LinkedHashMap<>(); + + return filterSchema(getXMLSchemaCollections(), schema, xmlSchemaCollectionsBySchema); + } + + @Override + public final XMLSchemaCollectionDefinition getXMLSchemaCollection(SchemaDefinition schema, String inputName) { + for (XMLSchemaCollectionDefinition sc : getXMLSchemaCollections(schema)) + if (sc.getName().equals(inputName)) + return sc; + + return null; + } + @Override public final List getInputCatalogs() { if (inputCatalogs == null) { @@ -1095,6 +1135,16 @@ public abstract class AbstractDatabase implements Database { this.includePackageConstants = includePackageConstants; } + @Override + public final boolean getIncludeXMLSchemaCollections() { + return includeXMLSchemaCollections; + } + + @Override + public final void setIncludeXMLSchemaCollections(boolean includeXMLSchemaCollections) { + this.includeXMLSchemaCollections = includeXMLSchemaCollections; + } + @Override public final boolean getIncludeUDTs() { return includeUDTs; @@ -1536,6 +1586,16 @@ public abstract class AbstractDatabase implements Database { this.forcedTypesForBuiltinDataTypeExtensions = forcedTypesForBuiltinDataTypeExtensions; } + @Override + public boolean getForcedTypesForXMLSchemaCollections() { + return this.forcedTypesForXMLSchemaCollections; + } + + @Override + public void setForcedTypesForXMLSchemaCollections(boolean forcedTypesForXMLSchemaCollections) { + this.forcedTypesForXMLSchemaCollections = forcedTypesForXMLSchemaCollections; + } + @Override public final int getLogSlowQueriesAfterSeconds() { return logSlowQueriesAfterSeconds; @@ -1977,186 +2037,188 @@ public abstract class AbstractDatabase implements Database { } private void initBuiltinForcedTypes() { - if (forcedTypesForBuiltinDataTypeExtensions && !builtInForcedTypesInitialised) { + if (!builtInForcedTypesInitialised) { builtInForcedTypesInitialised = true; - try { - ClassUtils.loadClass("org.jooq.postgres.extensions.types.Hstore"); + if (forcedTypesForBuiltinDataTypeExtensions) { + try { + ClassUtils.loadClass("org.jooq.postgres.extensions.types.Hstore"); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("java.lang.String") - .withBinding("org.jooq.postgres.extensions.bindings.CitextBinding") - .withIncludeTypes("citext") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("java.lang.String[]") - .withBinding("org.jooq.postgres.extensions.bindings.CitextArrayBinding") - .withIncludeTypes("_citext") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Ltree") - .withBinding("org.jooq.postgres.extensions.bindings.LtreeBinding") - .withIncludeTypes("ltree") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Ltree[]") - .withBinding("org.jooq.postgres.extensions.bindings.LtreeArrayBinding") - .withIncludeTypes("_ltree") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Hstore") - .withBinding("org.jooq.postgres.extensions.bindings.HstoreBinding") - .withIncludeTypes("hstore") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Hstore[]") - .withBinding("org.jooq.postgres.extensions.bindings.HstoreArrayBinding") - .withIncludeTypes("_hstore") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Inet") - .withBinding("org.jooq.postgres.extensions.bindings.InetBinding") - .withIncludeTypes("inet") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Inet[]") - .withBinding("org.jooq.postgres.extensions.bindings.InetArrayBinding") - .withIncludeTypes("_inet") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Cidr") - .withBinding("org.jooq.postgres.extensions.bindings.CidrBinding") - .withIncludeTypes("cidr") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.Cidr[]") - .withBinding("org.jooq.postgres.extensions.bindings.CidrArrayBinding") - .withIncludeTypes("_cidr") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.IntegerRange") - .withBinding("org.jooq.postgres.extensions.bindings.IntegerRangeBinding") - .withIncludeTypes("int4range") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.IntegerRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.IntegerRangeArrayBinding") - .withIncludeTypes("_int4range") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.LongRange") - .withBinding("org.jooq.postgres.extensions.bindings.LongRangeBinding") - .withIncludeTypes("int8range") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.LongRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.LongRangeArrayBinding") - .withIncludeTypes("_int8range") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.BigDecimalRange") - .withBinding("org.jooq.postgres.extensions.bindings.BigDecimalRangeBinding") - .withIncludeTypes("numrange") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.BigDecimalRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.BigDecimalRangeArrayBinding") - .withIncludeTypes("_numrange") - .withPriority(Integer.MIN_VALUE) - ); - - if (javaTimeTypes()) { getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.LocalDateRange") - .withBinding("org.jooq.postgres.extensions.bindings.LocalDateRangeBinding") - .withIncludeTypes("daterange") + .withUserType("java.lang.String") + .withBinding("org.jooq.postgres.extensions.bindings.CitextBinding") + .withIncludeTypes("citext") .withPriority(Integer.MIN_VALUE) ); getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.LocalDateRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.LocalDateRangeArrayBinding") - .withIncludeTypes("_daterange") + .withUserType("java.lang.String[]") + .withBinding("org.jooq.postgres.extensions.bindings.CitextArrayBinding") + .withIncludeTypes("_citext") .withPriority(Integer.MIN_VALUE) ); getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.LocalDateTimeRange") - .withBinding("org.jooq.postgres.extensions.bindings.LocalDateTimeRangeBinding") - .withIncludeTypes("tsrange") + .withUserType("org.jooq.postgres.extensions.types.Ltree") + .withBinding("org.jooq.postgres.extensions.bindings.LtreeBinding") + .withIncludeTypes("ltree") .withPriority(Integer.MIN_VALUE) ); getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.LocalDateTimeRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.LocalDateTimeRangeArrayBinding") - .withIncludeTypes("_tsrange") + .withUserType("org.jooq.postgres.extensions.types.Ltree[]") + .withBinding("org.jooq.postgres.extensions.bindings.LtreeArrayBinding") + .withIncludeTypes("_ltree") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.Hstore") + .withBinding("org.jooq.postgres.extensions.bindings.HstoreBinding") + .withIncludeTypes("hstore") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.Hstore[]") + .withBinding("org.jooq.postgres.extensions.bindings.HstoreArrayBinding") + .withIncludeTypes("_hstore") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.Inet") + .withBinding("org.jooq.postgres.extensions.bindings.InetBinding") + .withIncludeTypes("inet") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.Inet[]") + .withBinding("org.jooq.postgres.extensions.bindings.InetArrayBinding") + .withIncludeTypes("_inet") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.Cidr") + .withBinding("org.jooq.postgres.extensions.bindings.CidrBinding") + .withIncludeTypes("cidr") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.Cidr[]") + .withBinding("org.jooq.postgres.extensions.bindings.CidrArrayBinding") + .withIncludeTypes("_cidr") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.IntegerRange") + .withBinding("org.jooq.postgres.extensions.bindings.IntegerRangeBinding") + .withIncludeTypes("int4range") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.IntegerRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.IntegerRangeArrayBinding") + .withIncludeTypes("_int4range") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.LongRange") + .withBinding("org.jooq.postgres.extensions.bindings.LongRangeBinding") + .withIncludeTypes("int8range") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.LongRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.LongRangeArrayBinding") + .withIncludeTypes("_int8range") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.BigDecimalRange") + .withBinding("org.jooq.postgres.extensions.bindings.BigDecimalRangeBinding") + .withIncludeTypes("numrange") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.BigDecimalRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.BigDecimalRangeArrayBinding") + .withIncludeTypes("_numrange") + .withPriority(Integer.MIN_VALUE) + ); + + if (javaTimeTypes()) { + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.LocalDateRange") + .withBinding("org.jooq.postgres.extensions.bindings.LocalDateRangeBinding") + .withIncludeTypes("daterange") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.LocalDateRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.LocalDateRangeArrayBinding") + .withIncludeTypes("_daterange") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.LocalDateTimeRange") + .withBinding("org.jooq.postgres.extensions.bindings.LocalDateTimeRangeBinding") + .withIncludeTypes("tsrange") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.LocalDateTimeRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.LocalDateTimeRangeArrayBinding") + .withIncludeTypes("_tsrange") + .withPriority(Integer.MIN_VALUE) + ); + } + else { + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.DateRange") + .withBinding("org.jooq.postgres.extensions.bindings.DateRangeBinding") + .withIncludeTypes("daterange") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.DateRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.DateRangeArrayBinding") + .withIncludeTypes("_daterange") + .withPriority(Integer.MIN_VALUE) + ); + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.TimestampRange") + .withBinding("org.jooq.postgres.extensions.bindings.TimestampRangeBinding") + .withIncludeTypes("tsrange") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.TimestampRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.TimestampRangeArrayBinding") + .withIncludeTypes("_tsrange") + .withPriority(Integer.MIN_VALUE) + ); + } + + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.OffsetDateTimeRange") + .withBinding("org.jooq.postgres.extensions.bindings.OffsetDateTimeRangeBinding") + .withIncludeTypes("tstzrange") + .withPriority(Integer.MIN_VALUE) + ); + getConfiguredForcedTypes().add(new ForcedType() + .withUserType("org.jooq.postgres.extensions.types.OffsetDateTimeRange[]") + .withBinding("org.jooq.postgres.extensions.bindings.OffsetDateTimeRangeArrayBinding") + .withIncludeTypes("_tstzrange") .withPriority(Integer.MIN_VALUE) ); } - else { - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.DateRange") - .withBinding("org.jooq.postgres.extensions.bindings.DateRangeBinding") - .withIncludeTypes("daterange") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.DateRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.DateRangeArrayBinding") - .withIncludeTypes("_daterange") - .withPriority(Integer.MIN_VALUE) - ); - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.TimestampRange") - .withBinding("org.jooq.postgres.extensions.bindings.TimestampRangeBinding") - .withIncludeTypes("tsrange") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.TimestampRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.TimestampRangeArrayBinding") - .withIncludeTypes("_tsrange") - .withPriority(Integer.MIN_VALUE) - ); + catch (ClassNotFoundException ignore) { + log.debug("Built in data types", "org.jooq.postgres.extensions.types.Hstore not found on classpath, ignoring built in data type extensions"); } - - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.OffsetDateTimeRange") - .withBinding("org.jooq.postgres.extensions.bindings.OffsetDateTimeRangeBinding") - .withIncludeTypes("tstzrange") - .withPriority(Integer.MIN_VALUE) - ); - getConfiguredForcedTypes().add(new ForcedType() - .withUserType("org.jooq.postgres.extensions.types.OffsetDateTimeRange[]") - .withBinding("org.jooq.postgres.extensions.bindings.OffsetDateTimeRangeArrayBinding") - .withIncludeTypes("_tstzrange") - .withPriority(Integer.MIN_VALUE) - ); - } - catch (ClassNotFoundException ignore) { - log.debug("Built in data types", "org.jooq.postgres.extensions.types.Hstore not found on classpath, ignoring built in data type extensions"); } } } @@ -3595,6 +3657,12 @@ public abstract class AbstractDatabase implements Database { */ protected abstract List getDomains0() throws SQLException; + /** + * Retrieve ALL XML schema collections from the database. This will be + * filtered in {@link #getXMLSchemaCollections()} + */ + protected abstract List getXMLSchemaCollections0() throws SQLException; + /** * Retrieve ALL UDTs from the database. This will be filtered in * {@link #getEnums(SchemaDefinition)} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/AbstractMetaDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/AbstractMetaDatabase.java index 5f76854673..3837cfb416 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/AbstractMetaDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/AbstractMetaDatabase.java @@ -245,6 +245,12 @@ public abstract class AbstractMetaDatabase extends AbstractDatabase { return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/DataTypeDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/DataTypeDefinition.java index af60ba89a1..87e76fd47e 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/DataTypeDefinition.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/DataTypeDefinition.java @@ -143,6 +143,11 @@ public interface DataTypeDefinition { */ GenerationOption getGenerationOption(); + /** + * The XML type definition, if available. + */ + XMLTypeDefinition getXMLTypeDefinition(); + /** * The computed column generation location. */ diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/Database.java b/jOOQ-meta/src/main/java/org/jooq/meta/Database.java index f10d96bdfb..16c64afb45 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/Database.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/Database.java @@ -107,6 +107,21 @@ public interface Database extends AutoCloseable { */ SchemaDefinition getSchema(String name); + /** + * The XML schema collections generated from this database. + */ + List getXMLSchemaCollections(); + + /** + * The XML schema collections generated from this database. + */ + List getXMLSchemaCollections(SchemaDefinition schema); + + /** + * The XML schema collection generated from this database by name + */ + XMLSchemaCollectionDefinition getXMLSchemaCollection(SchemaDefinition schema, String name); + /** * Retrieve the schema's primary key / foreign key relations. */ @@ -604,6 +619,16 @@ public interface Database extends AutoCloseable { */ boolean getIncludeSequences(); + /** + * whether XML schema collections should be included. + */ + boolean getIncludeXMLSchemaCollections(); + + /** + * whether XML schema collections should be included. + */ + void setIncludeXMLSchemaCollections(boolean includeXMLSchemaCollections); + /** * whether user defined types should be included. */ @@ -943,6 +968,26 @@ public interface Database extends AutoCloseable { */ void setForcedTypesForBuiltinDataTypeExtensions(boolean forcedTypesForBuiltinDataTypeExtensions); + /** + * Whether some additional forced types for + * {@link XMLSchemaCollectionDefinition} types should be created + * automatically for columns that have non-ambiguous references to an + * {@link XMLTypeDefinition}. + *

+ * This feature is available in the commercial distribution only. + */ + boolean getForcedTypesForXMLSchemaCollections(); + + /** + * Whether some additional forced types for + * {@link XMLSchemaCollectionDefinition} types should be created + * automatically for columns that have non-ambiguous references to an + * {@link XMLTypeDefinition}. + *

+ * This feature is available in the commercial distribution only. + */ + void setForcedTypesForXMLSchemaCollections(boolean forcedTypesForXMLSchemaCollections); + /** * Log slow queries after this amount of seconds. */ diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/DefaultDataTypeDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultDataTypeDefinition.java index 781c410bf1..e4e4d95e49 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/DefaultDataTypeDefinition.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultDataTypeDefinition.java @@ -79,6 +79,7 @@ public class DefaultDataTypeDefinition implements DataTypeDefinition { private boolean readonly; private String generatedAlwaysAs; private GenerationOption generationOption; + private XMLTypeDefinition xmlTypeDefinition; private boolean identity; private final String defaultValue; private final int length; @@ -294,6 +295,11 @@ public class DefaultDataTypeDefinition implements DataTypeDefinition { return generationOption; } + @Override + public XMLTypeDefinition getXMLTypeDefinition() { + return xmlTypeDefinition; + } + @Override public GenerationLocation getGenerationLocation() { return generator == null ? GenerationLocation.SERVER : GenerationLocation.CLIENT; @@ -314,6 +320,11 @@ public class DefaultDataTypeDefinition implements DataTypeDefinition { return this; } + public final DefaultDataTypeDefinition xmlTypeDefinition(XMLTypeDefinition x) { + this.xmlTypeDefinition = x; + return this; + } + public final DefaultDataTypeDefinition identity(boolean i) { this.identity = i; return this; diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLNamespaceDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLNamespaceDefinition.java new file mode 100644 index 0000000000..336eecbcc4 --- /dev/null +++ b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLNamespaceDefinition.java @@ -0,0 +1,69 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.meta; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Lukas Eder + */ +public class DefaultXMLNamespaceDefinition extends AbstractDefinition implements XMLNamespaceDefinition { + + final XMLSchemaCollectionDefinition schemaCollection; + final List types; + + public DefaultXMLNamespaceDefinition(XMLSchemaCollectionDefinition schemaCollection, String name) { + super(schemaCollection.getDatabase(), schemaCollection.getSchema(), name); + + this.schemaCollection = schemaCollection; + this.types = new ArrayList<>(); + + schemaCollection.getNamespaces().add(this); + } + + @Override + public List getTypes() { + return types; + } + + @Override + public XMLSchemaCollectionDefinition getSchemaCollection() { + return schemaCollection; + } +} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLSchemaCollectionDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLSchemaCollectionDefinition.java new file mode 100644 index 0000000000..f5b5845867 --- /dev/null +++ b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLSchemaCollectionDefinition.java @@ -0,0 +1,75 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.meta; + +import static java.util.stream.Collectors.toList; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Lukas Eder + */ +public class DefaultXMLSchemaCollectionDefinition extends AbstractDefinition implements XMLSchemaCollectionDefinition { + + final List namespaces; + List rootElementTypes; + + public DefaultXMLSchemaCollectionDefinition(SchemaDefinition schema, String name) { + super(schema.getDatabase(), schema, name); + + namespaces = new ArrayList<>(); + } + + @Override + public List getNamespaces() { + return namespaces; + } + + @Override + public List getRootElementTypes() { + if (rootElementTypes == null) + rootElementTypes = getNamespaces() + .stream() + .flatMap(n -> n.getTypes().stream()) + .filter(t -> t.isRootElementType()) + .collect(toList()); + + return rootElementTypes; + } +} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLTypeDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLTypeDefinition.java new file mode 100644 index 0000000000..7f57169cf6 --- /dev/null +++ b/jOOQ-meta/src/main/java/org/jooq/meta/DefaultXMLTypeDefinition.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.meta; + +/** + * @author Lukas Eder + */ +public class DefaultXMLTypeDefinition extends AbstractDefinition implements XMLTypeDefinition { + + final XMLNamespaceDefinition namespace; + final int rootElementCount; + + public DefaultXMLTypeDefinition(XMLNamespaceDefinition namespace, String name, int rootElementCount) { + super(namespace.getDatabase(), namespace.getSchema(), name); + + this.namespace = namespace; + this.rootElementCount = rootElementCount; + + namespace.getTypes().add(this); + } + + @Override + public XMLNamespaceDefinition getNamespace() { + return namespace; + } + + @Override + public boolean isRootElementType() { + return rootElementCount > 0; + } + + @Override + public int getRootElementCount() { + return rootElementCount; + } +} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/XMLNamespaceDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/XMLNamespaceDefinition.java new file mode 100644 index 0000000000..9d8d39c2d8 --- /dev/null +++ b/jOOQ-meta/src/main/java/org/jooq/meta/XMLNamespaceDefinition.java @@ -0,0 +1,63 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.meta; + +import java.util.List; + +import org.jetbrains.annotations.NotNull; + +/** + * A definition representing an XML namespace. + * + * @author Lukas Eder + */ +public interface XMLNamespaceDefinition extends Definition { + + /** + * The {@link XMLSchemaCollectionDefinition} that contains this namespace + * definition. + */ + @NotNull + XMLSchemaCollectionDefinition getSchemaCollection(); + + /** + * Get the {@link XMLTypeDefinition} instances belonging to this namespace. + */ + @NotNull + List getTypes(); +} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/XMLSchemaCollectionDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/XMLSchemaCollectionDefinition.java new file mode 100644 index 0000000000..fdf3b1b12a --- /dev/null +++ b/jOOQ-meta/src/main/java/org/jooq/meta/XMLSchemaCollectionDefinition.java @@ -0,0 +1,64 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.meta; + +import java.util.List; + +import org.jetbrains.annotations.NotNull; + +/** + * A definition representing an SCHEMA COLLECTION, i.e. a + * collection of XSDs stored in the database. + * + * @author Lukas Eder + */ +public interface XMLSchemaCollectionDefinition extends Definition { + + /** + * Get the {@link XMLNamespaceDefinition} instances belonging to this schema + * collection. + */ + @NotNull + List getNamespaces(); + + /** + * Get a list of types that have been declared as potential root elements in + * the XSDs. + */ + List getRootElementTypes(); +} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/XMLTypeDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/XMLTypeDefinition.java new file mode 100644 index 0000000000..6c00a76a7d --- /dev/null +++ b/jOOQ-meta/src/main/java/org/jooq/meta/XMLTypeDefinition.java @@ -0,0 +1,64 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.meta; + +import org.jetbrains.annotations.NotNull; + +/** + * A definition representing an XML namespace. + * + * @author Lukas Eder + */ +public interface XMLTypeDefinition extends Definition { + + /** + * Get the namespace to which this type belongs. + */ + @NotNull + XMLNamespaceDefinition getNamespace(); + + /** + * Whether this type can be used as a root element. + */ + boolean isRootElementType(); + + /** + * Get the number of root elements this type is available from. + */ + int getRootElementCount(); +} diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/cubrid/CUBRIDDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/cubrid/CUBRIDDatabase.java index 6678bc50bd..3906e7f8db 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/cubrid/CUBRIDDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/cubrid/CUBRIDDatabase.java @@ -79,6 +79,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; /** * @author Lukas Eder @@ -266,6 +267,12 @@ public class CUBRIDDatabase extends AbstractDatabase { return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/derby/DerbyDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/derby/DerbyDatabase.java index 510221307c..16504faa4d 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/derby/DerbyDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/derby/DerbyDatabase.java @@ -105,6 +105,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; /** * @author Lukas Eder @@ -458,6 +459,12 @@ public class DerbyDatabase extends AbstractDatabase implements ResultQueryDataba return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/firebird/FirebirdDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/firebird/FirebirdDatabase.java index 0f8125f812..2a56a20b0d 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/firebird/FirebirdDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/firebird/FirebirdDatabase.java @@ -119,6 +119,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.meta.firebird.rdb.tables.Rdb$checkConstraints; import org.jooq.meta.firebird.rdb.tables.Rdb$fields; import org.jooq.meta.firebird.rdb.tables.Rdb$functionArguments; @@ -596,6 +597,12 @@ public class FirebirdDatabase extends AbstractDatabase implements ResultQueryDat return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/h2/H2Database.java b/jOOQ-meta/src/main/java/org/jooq/meta/h2/H2Database.java index 5477adbf6f..ca9a11ab28 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/h2/H2Database.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/h2/H2Database.java @@ -130,6 +130,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.meta.hsqldb.information_schema.Tables; import org.jooq.meta.hsqldb.information_schema.tables.CheckConstraints; import org.jooq.meta.hsqldb.information_schema.tables.DomainConstraints; @@ -1104,6 +1105,12 @@ public class H2Database extends AbstractDatabase implements ResultQueryDatabase return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/hsqldb/HSQLDBDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/hsqldb/HSQLDBDatabase.java index 289aed2d1c..224cf50ea7 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/hsqldb/HSQLDBDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/hsqldb/HSQLDBDatabase.java @@ -107,6 +107,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.meta.hsqldb.information_schema.tables.CheckConstraints; import org.jooq.meta.hsqldb.information_schema.tables.Columns; import org.jooq.meta.hsqldb.information_schema.tables.DomainConstraints; @@ -542,6 +543,12 @@ public class HSQLDBDatabase extends AbstractDatabase implements ResultQueryDatab return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Database.java b/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Database.java index 0ee50b59a5..ff3536178e 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Database.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Database.java @@ -70,6 +70,8 @@ public class Database implements Serializable, XMLAppendable @XmlElement(defaultValue = "true") protected Boolean includePackageConstants = true; @XmlElement(defaultValue = "true") + protected Boolean includeXMLSchemaCollections = true; + @XmlElement(defaultValue = "true") protected Boolean includeUDTs = true; @XmlElement(defaultValue = "true") protected Boolean includeDomains = true; @@ -159,6 +161,8 @@ public class Database implements Serializable, XMLAppendable @XmlElement(defaultValue = "true") protected Boolean forcedTypesForBuiltinDataTypeExtensions = true; @XmlElement(defaultValue = "true") + protected Boolean forcedTypesForXMLSchemaCollections = true; + @XmlElement(defaultValue = "true") protected Boolean forceIntegerTypesOnZeroScaleDecimals = true; protected Boolean tableValuedFunctions; @XmlElement(defaultValue = "5") @@ -667,6 +671,30 @@ public class Database implements Serializable, XMLAppendable this.includePackageConstants = value; } + /** + * This flag indicates whether XML schema collections should be included in output produced by this database + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isIncludeXMLSchemaCollections() { + return includeXMLSchemaCollections; + } + + /** + * Sets the value of the includeXMLSchemaCollections property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setIncludeXMLSchemaCollections(Boolean value) { + this.includeXMLSchemaCollections = value; + } + /** * This flag indicates whether udts should be included in output produced by this database * @@ -1683,6 +1711,32 @@ public class Database implements Serializable, XMLAppendable this.forcedTypesForBuiltinDataTypeExtensions = value; } + /** + * Enable some default forced type configurations for XML schema collections, mapping them to JAXB annotated types using the {@link org.jooq.impl.XMLtoJAXBConverter} + *

+ * This feature is available in the commercial distribution only. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isForcedTypesForXMLSchemaCollections() { + return forcedTypesForXMLSchemaCollections; + } + + /** + * Sets the value of the forcedTypesForXMLSchemaCollections property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setForcedTypesForXMLSchemaCollections(Boolean value) { + this.forcedTypesForXMLSchemaCollections = value; + } + /** * Historically, zero-scale decimal types are generated as their most appropriate, corresponding integer type (e.g. NUMBER(2, 0) and less: Byte). This allows for turning off this feature. In case of conflict between this rule and actual {@link #getForcedTypes()}, the latter will win. * @@ -2069,6 +2123,11 @@ public class Database implements Serializable, XMLAppendable return this; } + public Database withIncludeXMLSchemaCollections(Boolean value) { + setIncludeXMLSchemaCollections(value); + return this; + } + public Database withIncludeUDTs(Boolean value) { setIncludeUDTs(value); return this; @@ -2416,6 +2475,11 @@ public class Database implements Serializable, XMLAppendable return this; } + public Database withForcedTypesForXMLSchemaCollections(Boolean value) { + setForcedTypesForXMLSchemaCollections(value); + return this; + } + public Database withForceIntegerTypesOnZeroScaleDecimals(Boolean value) { setForceIntegerTypesOnZeroScaleDecimals(value); return this; @@ -2636,6 +2700,7 @@ public class Database implements Serializable, XMLAppendable builder.append("includePackageRoutines", includePackageRoutines); builder.append("includePackageUDTs", includePackageUDTs); builder.append("includePackageConstants", includePackageConstants); + builder.append("includeXMLSchemaCollections", includeXMLSchemaCollections); builder.append("includeUDTs", includeUDTs); builder.append("includeDomains", includeDomains); builder.append("includeSequences", includeSequences); @@ -2676,6 +2741,7 @@ public class Database implements Serializable, XMLAppendable builder.append("readonlyComputedColumns", readonlyComputedColumns); builder.append("readonlyNonUpdatableColumns", readonlyNonUpdatableColumns); builder.append("forcedTypesForBuiltinDataTypeExtensions", forcedTypesForBuiltinDataTypeExtensions); + builder.append("forcedTypesForXMLSchemaCollections", forcedTypesForXMLSchemaCollections); builder.append("forceIntegerTypesOnZeroScaleDecimals", forceIntegerTypesOnZeroScaleDecimals); builder.append("tableValuedFunctions", tableValuedFunctions); builder.append("logSlowQueriesAfterSeconds", logSlowQueriesAfterSeconds); @@ -2853,6 +2919,15 @@ public class Database implements Serializable, XMLAppendable return false; } } + if (includeXMLSchemaCollections == null) { + if (other.includeXMLSchemaCollections!= null) { + return false; + } + } else { + if (!includeXMLSchemaCollections.equals(other.includeXMLSchemaCollections)) { + return false; + } + } if (includeUDTs == null) { if (other.includeUDTs!= null) { return false; @@ -3213,6 +3288,15 @@ public class Database implements Serializable, XMLAppendable return false; } } + if (forcedTypesForXMLSchemaCollections == null) { + if (other.forcedTypesForXMLSchemaCollections!= null) { + return false; + } + } else { + if (!forcedTypesForXMLSchemaCollections.equals(other.forcedTypesForXMLSchemaCollections)) { + return false; + } + } if (forceIntegerTypesOnZeroScaleDecimals == null) { if (other.forceIntegerTypesOnZeroScaleDecimals!= null) { return false; @@ -3344,6 +3428,7 @@ public class Database implements Serializable, XMLAppendable result = ((prime*result)+((includePackageRoutines == null)? 0 :includePackageRoutines.hashCode())); result = ((prime*result)+((includePackageUDTs == null)? 0 :includePackageUDTs.hashCode())); result = ((prime*result)+((includePackageConstants == null)? 0 :includePackageConstants.hashCode())); + result = ((prime*result)+((includeXMLSchemaCollections == null)? 0 :includeXMLSchemaCollections.hashCode())); result = ((prime*result)+((includeUDTs == null)? 0 :includeUDTs.hashCode())); result = ((prime*result)+((includeDomains == null)? 0 :includeDomains.hashCode())); result = ((prime*result)+((includeSequences == null)? 0 :includeSequences.hashCode())); @@ -3384,6 +3469,7 @@ public class Database implements Serializable, XMLAppendable result = ((prime*result)+((readonlyComputedColumns == null)? 0 :readonlyComputedColumns.hashCode())); result = ((prime*result)+((readonlyNonUpdatableColumns == null)? 0 :readonlyNonUpdatableColumns.hashCode())); result = ((prime*result)+((forcedTypesForBuiltinDataTypeExtensions == null)? 0 :forcedTypesForBuiltinDataTypeExtensions.hashCode())); + result = ((prime*result)+((forcedTypesForXMLSchemaCollections == null)? 0 :forcedTypesForXMLSchemaCollections.hashCode())); result = ((prime*result)+((forceIntegerTypesOnZeroScaleDecimals == null)? 0 :forceIntegerTypesOnZeroScaleDecimals.hashCode())); result = ((prime*result)+((tableValuedFunctions == null)? 0 :tableValuedFunctions.hashCode())); result = ((prime*result)+((logSlowQueriesAfterSeconds == null)? 0 :logSlowQueriesAfterSeconds.hashCode())); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLDatabase.java index 794fb66051..80567ca9ee 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLDatabase.java @@ -106,6 +106,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.meta.mariadb.MariaDBDatabase; import org.jooq.meta.mysql.mysql.enums.ProcType; import org.jooq.tools.csv.CSVReader; @@ -523,6 +524,12 @@ public class MySQLDatabase extends AbstractDatabase implements ResultQueryDataba return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java index 2a45709d66..fb9e312349 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/postgres/PostgresDatabase.java @@ -160,6 +160,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.meta.hsqldb.HSQLDBDatabase; import org.jooq.meta.jaxb.ForcedType; import org.jooq.meta.postgres.information_schema.tables.CheckConstraints; @@ -891,6 +892,12 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/sqlite/SQLiteDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/sqlite/SQLiteDatabase.java index 1ea531f08e..9caa3ed742 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/sqlite/SQLiteDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/sqlite/SQLiteDatabase.java @@ -103,6 +103,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.meta.jaxb.SchemaMappingType; import org.jooq.meta.sqlite.sqlite_master.SQLiteMaster; import org.jooq.tools.JooqLogger; @@ -443,6 +444,12 @@ public class SQLiteDatabase extends AbstractDatabase { return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() throws SQLException { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/xml/XMLDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/xml/XMLDatabase.java index 44c81e0372..c7506d003e 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/xml/XMLDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/xml/XMLDatabase.java @@ -104,6 +104,7 @@ import org.jooq.meta.SchemaDefinition; import org.jooq.meta.SequenceDefinition; import org.jooq.meta.TableDefinition; import org.jooq.meta.UDTDefinition; +import org.jooq.meta.XMLSchemaCollectionDefinition; import org.jooq.tools.JooqLogger; import org.jooq.tools.StringUtils; import org.jooq.tools.jdbc.JDBCUtils; @@ -583,6 +584,12 @@ public class XMLDatabase extends AbstractDatabase { return result; } + @Override + protected List getXMLSchemaCollections0() throws SQLException { + List result = new ArrayList<>(); + return result; + } + @Override protected List getUDTs0() { List result = new ArrayList<>(); diff --git a/jOOQ-meta/src/main/resources/org/jooq/meta/xsd/jooq-codegen-3.17.0.xsd b/jOOQ-meta/src/main/resources/org/jooq/meta/xsd/jooq-codegen-3.17.0.xsd index 041793afcc..c3131fd3e8 100644 --- a/jOOQ-meta/src/main/resources/org/jooq/meta/xsd/jooq-codegen-3.17.0.xsd +++ b/jOOQ-meta/src/main/resources/org/jooq/meta/xsd/jooq-codegen-3.17.0.xsd @@ -634,6 +634,10 @@ Excludes match before includes, i.e. excludes have a higher priority.]]> + + + + @@ -955,7 +959,13 @@ This feature is available in the commercial distribution only.]]>< - + + + +This feature is available in the commercial distribution only.]]> + +