From b3a044b6218f1af2ae5decca1b80e8f0512b6dac Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 7 Jun 2022 12:01:24 +0200 Subject: [PATCH] [jOOQ/jOOQ#13069] Revert prototype --- .../org/jooq/codegen/AbstractGenerator.java | 55 --- .../java/org/jooq/codegen/GenerationTool.java | 10 - .../main/java/org/jooq/codegen/Generator.java | 60 --- .../java/org/jooq/codegen/JavaGenerator.java | 383 ------------------ .../java/org/jooq/meta/jaxb/Generate.java | 230 ----------- .../org/jooq/meta/xsd/jooq-codegen-3.17.0.xsd | 40 -- .../main/java/org/jooq/impl/TableImpl.java | 284 ------------- 7 files changed, 1062 deletions(-) diff --git a/jOOQ-codegen/src/main/java/org/jooq/codegen/AbstractGenerator.java b/jOOQ-codegen/src/main/java/org/jooq/codegen/AbstractGenerator.java index 6d86ca2a81..72f5cc8d07 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/AbstractGenerator.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/AbstractGenerator.java @@ -71,11 +71,6 @@ abstract class AbstractGenerator implements Generator { boolean generateRelations = true; boolean generateImplicitJoinPathsToOne = true; boolean generateImplicitJoinPathsAsKotlinProperties = true; - boolean generateExistsConvenienceOneToMany = false; - boolean generateExistsConvenienceManyToMany = false; - boolean generateRowConvenienceToOne = false; - boolean generateMultisetConvenienceOneToMany = false; - boolean generateMultisetConvenienceManyToMany = false; boolean generateInstanceFields = true; VisibilityModifier generateVisibilityModifier = VisibilityModifier.DEFAULT; boolean generateGeneratedAnnotation = false; @@ -311,56 +306,6 @@ abstract class AbstractGenerator implements Generator { this.generateImplicitJoinPathsAsKotlinProperties = generateImplicitJoinPathsAsKotlinProperties; } - @Override - public boolean generateExistsConvenienceOneToMany() { - return generateExistsConvenienceOneToMany && generateRelations(); - } - - @Override - public void setGenerateExistsConvenienceOneToMany(boolean generateExistsConvenienceOneToMany) { - this.generateExistsConvenienceOneToMany = generateExistsConvenienceOneToMany; - } - - @Override - public boolean generateExistsConvenienceManyToMany() { - return generateExistsConvenienceManyToMany && generateRelations(); - } - - @Override - public void setGenerateExistsConvenienceManyToMany(boolean generateExistsConvenienceManyToMany) { - this.generateExistsConvenienceManyToMany = generateExistsConvenienceManyToMany; - } - - @Override - public boolean generateRowConvenienceToOne() { - return generateRowConvenienceToOne && generateRelations(); - } - - @Override - public void setGenerateRowConvenienceToOne(boolean generateRowConvenienceToOne) { - this.generateRowConvenienceToOne = generateRowConvenienceToOne; - } - - @Override - public boolean generateMultisetConvenienceOneToMany() { - return generateMultisetConvenienceOneToMany && generateRelations(); - } - - @Override - public void setGenerateMultisetConvenienceOneToMany(boolean generateMultisetConvenienceOneToMany) { - this.generateMultisetConvenienceOneToMany = generateMultisetConvenienceOneToMany; - } - - @Override - public boolean generateMultisetConvenienceManyToMany() { - return generateMultisetConvenienceManyToMany && generateRelations(); - } - - @Override - public void setGenerateMultisetConvenienceManyToMany(boolean generateMultisetConvenienceManyToMany) { - this.generateMultisetConvenienceManyToMany = generateMultisetConvenienceManyToMany; - } - @Override public boolean generateTableValuedFunctions() { return generateTableValuedFunctions; 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 257e259a0f..287abda3e3 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/GenerationTool.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/GenerationTool.java @@ -720,16 +720,6 @@ public class GenerationTool { generator.setGenerateImplicitJoinPathsToOne(g.getGenerate().isImplicitJoinPathsToOne()); if (g.getGenerate().isImplicitJoinPathsAsKotlinProperties() != null) generator.setGenerateImplicitJoinPathsAsKotlinProperties(g.getGenerate().isImplicitJoinPathsAsKotlinProperties()); - if (g.getGenerate().isExistsConvenienceOneToMany() != null) - generator.setGenerateExistsConvenienceOneToMany(g.getGenerate().isExistsConvenienceOneToMany()); - if (g.getGenerate().isExistsConvenienceManyToMany() != null) - generator.setGenerateExistsConvenienceManyToMany(g.getGenerate().isExistsConvenienceManyToMany()); - if (g.getGenerate().isRowConvenienceToOne() != null) - generator.setGenerateRowConvenienceToOne(g.getGenerate().isRowConvenienceToOne()); - if (g.getGenerate().isMultisetConvenienceOneToMany() != null) - generator.setGenerateMultisetConvenienceOneToMany(g.getGenerate().isMultisetConvenienceOneToMany()); - if (g.getGenerate().isMultisetConvenienceManyToMany() != null) - generator.setGenerateMultisetConvenienceManyToMany(g.getGenerate().isMultisetConvenienceManyToMany()); if (g.getGenerate().isDeprecated() != null) generator.setGenerateDeprecated(g.getGenerate().isDeprecated()); if (g.getGenerate().isDeprecationOnUnknownTypes() != null) diff --git a/jOOQ-codegen/src/main/java/org/jooq/codegen/Generator.java b/jOOQ-codegen/src/main/java/org/jooq/codegen/Generator.java index 6dcbeff481..c56a6f172a 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/Generator.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/Generator.java @@ -143,66 +143,6 @@ public interface Generator { */ void setGenerateImplicitJoinPathsAsKotlinProperties(boolean generateImplicitJoinPathsAsKotlinProperties); - /** - * Whether EXISTS convenience syntax for one-to-many - * relationships should be generated. - */ - boolean generateExistsConvenienceOneToMany(); - - /** - * Whether EXISTS convenience syntax for one-to-many - * relationships should be generated. - */ - void setGenerateExistsConvenienceOneToMany(boolean generateExistsConvenienceOneToMany); - - /** - * Whether EXISTS convenience syntax for many-to-many - * relationships should be generated. - */ - boolean generateExistsConvenienceManyToMany(); - - /** - * Whether EXISTS convenience syntax for many-to-many - * relationships should be generated. - */ - void setGenerateExistsConvenienceManyToMany(boolean generateExistsConvenienceManyToMany); - - /** - * Whether ROW convenience syntax for to-one relationships - * should be generated. - */ - boolean generateRowConvenienceToOne(); - - /** - * Whether ROW convenience syntax for to-one relationships - * should be generated. - */ - void setGenerateRowConvenienceToOne(boolean generateRowConvenienceToOne); - - /** - * Whether MULTISET convenience syntax for one-to-many - * relationships should be generated. - */ - boolean generateMultisetConvenienceOneToMany(); - - /** - * Whether MULTISET convenience syntax for one-to-many - * relationships should be generated. - */ - void setGenerateMultisetConvenienceOneToMany(boolean generateMultisetConvenienceOneToMany); - - /** - * Whether MULTISET convenience syntax for many-to-many - * relationships should be generated. - */ - boolean generateMultisetConvenienceManyToMany(); - - /** - * Whether MULTISET convenience syntax for many-to-many - * relationships should be generated. - */ - void setGenerateMultisetConvenienceManyToMany(boolean generateMultisetConvenienceManyToMany); - /** * Whether table-valued functions should be generated as tables. */ 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 3ca4d35658..072b49d4fd 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/JavaGenerator.java @@ -6533,389 +6533,6 @@ public class JavaGenerator extends AbstractGenerator { } } } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } List cc = table.getCheckConstraints(); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Generate.java b/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Generate.java index 71e7804579..23368e6220 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Generate.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/jaxb/Generate.java @@ -42,16 +42,6 @@ public class Generate implements Serializable, XMLAppendable protected Boolean implicitJoinPathsUseTableNameForUnambiguousFKs = true; @XmlElement(defaultValue = "true") protected Boolean implicitJoinPathsAsKotlinProperties = true; - @XmlElement(defaultValue = "false") - protected Boolean existsConvenienceOneToMany = false; - @XmlElement(defaultValue = "false") - protected Boolean existsConvenienceManyToMany = false; - @XmlElement(defaultValue = "false") - protected Boolean rowConvenienceToOne = false; - @XmlElement(defaultValue = "false") - protected Boolean multisetConvenienceOneToMany = false; - @XmlElement(defaultValue = "false") - protected Boolean multisetConvenienceManyToMany = false; @XmlElement(defaultValue = "true") protected Boolean deprecated = true; @XmlElement(defaultValue = "true") @@ -396,146 +386,6 @@ public class Generate implements Serializable, XMLAppendable this.implicitJoinPathsAsKotlinProperties = value; } - /** - * Generate EXISTS convenience syntax for one-to-many relationships. - *

- * This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. - *

- * This feature is available in the commercial distribution only. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isExistsConvenienceOneToMany() { - return existsConvenienceOneToMany; - } - - /** - * Sets the value of the existsConvenienceOneToMany property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setExistsConvenienceOneToMany(Boolean value) { - this.existsConvenienceOneToMany = value; - } - - /** - * Generate EXISTS convenience syntax for many-to-many relationships. A many-to-many relationship is achieved when a child table has 2 non-nullable foreign keys that are part of a unique key. - *

- * This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. - *

- * This feature is available in the commercial distribution only. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isExistsConvenienceManyToMany() { - return existsConvenienceManyToMany; - } - - /** - * Sets the value of the existsConvenienceManyToMany property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setExistsConvenienceManyToMany(Boolean value) { - this.existsConvenienceManyToMany = value; - } - - /** - * Generate ROW convenience syntax for to-one relationships. - *

- * This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. - *

- * This feature is available in the commercial distribution only. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isRowConvenienceToOne() { - return rowConvenienceToOne; - } - - /** - * Sets the value of the rowConvenienceToOne property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRowConvenienceToOne(Boolean value) { - this.rowConvenienceToOne = value; - } - - /** - * Generate MULTISET convenience syntax for one-to-many relationships. - *

- * This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. - *

- * This feature is available in the commercial distribution only. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isMultisetConvenienceOneToMany() { - return multisetConvenienceOneToMany; - } - - /** - * Sets the value of the multisetConvenienceOneToMany property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setMultisetConvenienceOneToMany(Boolean value) { - this.multisetConvenienceOneToMany = value; - } - - /** - * Generate MULTISET convenience syntax for many-to-many relationships. A many-to-many relationship is achieved when a child table has 2 non-nullable foreign keys that are part of a unique key. - *

- * This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. - *

- * This feature is available in the commercial distribution only. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isMultisetConvenienceManyToMany() { - return multisetConvenienceManyToMany; - } - - /** - * Sets the value of the multisetConvenienceManyToMany property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setMultisetConvenienceManyToMany(Boolean value) { - this.multisetConvenienceManyToMany = value; - } - /** * Generate deprecated code for backwards compatibility * @@ -2693,31 +2543,6 @@ public class Generate implements Serializable, XMLAppendable return this; } - public Generate withExistsConvenienceOneToMany(Boolean value) { - setExistsConvenienceOneToMany(value); - return this; - } - - public Generate withExistsConvenienceManyToMany(Boolean value) { - setExistsConvenienceManyToMany(value); - return this; - } - - public Generate withRowConvenienceToOne(Boolean value) { - setRowConvenienceToOne(value); - return this; - } - - public Generate withMultisetConvenienceOneToMany(Boolean value) { - setMultisetConvenienceOneToMany(value); - return this; - } - - public Generate withMultisetConvenienceManyToMany(Boolean value) { - setMultisetConvenienceManyToMany(value); - return this; - } - public Generate withDeprecated(Boolean value) { setDeprecated(value); return this; @@ -3234,11 +3059,6 @@ public class Generate implements Serializable, XMLAppendable builder.append("implicitJoinPathsToOne", implicitJoinPathsToOne); builder.append("implicitJoinPathsUseTableNameForUnambiguousFKs", implicitJoinPathsUseTableNameForUnambiguousFKs); builder.append("implicitJoinPathsAsKotlinProperties", implicitJoinPathsAsKotlinProperties); - builder.append("existsConvenienceOneToMany", existsConvenienceOneToMany); - builder.append("existsConvenienceManyToMany", existsConvenienceManyToMany); - builder.append("rowConvenienceToOne", rowConvenienceToOne); - builder.append("multisetConvenienceOneToMany", multisetConvenienceOneToMany); - builder.append("multisetConvenienceManyToMany", multisetConvenienceManyToMany); builder.append("deprecated", deprecated); builder.append("deprecationOnUnknownTypes", deprecationOnUnknownTypes); builder.append("instanceFields", instanceFields); @@ -3405,51 +3225,6 @@ public class Generate implements Serializable, XMLAppendable return false; } } - if (existsConvenienceOneToMany == null) { - if (other.existsConvenienceOneToMany!= null) { - return false; - } - } else { - if (!existsConvenienceOneToMany.equals(other.existsConvenienceOneToMany)) { - return false; - } - } - if (existsConvenienceManyToMany == null) { - if (other.existsConvenienceManyToMany!= null) { - return false; - } - } else { - if (!existsConvenienceManyToMany.equals(other.existsConvenienceManyToMany)) { - return false; - } - } - if (rowConvenienceToOne == null) { - if (other.rowConvenienceToOne!= null) { - return false; - } - } else { - if (!rowConvenienceToOne.equals(other.rowConvenienceToOne)) { - return false; - } - } - if (multisetConvenienceOneToMany == null) { - if (other.multisetConvenienceOneToMany!= null) { - return false; - } - } else { - if (!multisetConvenienceOneToMany.equals(other.multisetConvenienceOneToMany)) { - return false; - } - } - if (multisetConvenienceManyToMany == null) { - if (other.multisetConvenienceManyToMany!= null) { - return false; - } - } else { - if (!multisetConvenienceManyToMany.equals(other.multisetConvenienceManyToMany)) { - return false; - } - } if (deprecated == null) { if (other.deprecated!= null) { return false; @@ -4282,11 +4057,6 @@ public class Generate implements Serializable, XMLAppendable result = ((prime*result)+((implicitJoinPathsToOne == null)? 0 :implicitJoinPathsToOne.hashCode())); result = ((prime*result)+((implicitJoinPathsUseTableNameForUnambiguousFKs == null)? 0 :implicitJoinPathsUseTableNameForUnambiguousFKs.hashCode())); result = ((prime*result)+((implicitJoinPathsAsKotlinProperties == null)? 0 :implicitJoinPathsAsKotlinProperties.hashCode())); - result = ((prime*result)+((existsConvenienceOneToMany == null)? 0 :existsConvenienceOneToMany.hashCode())); - result = ((prime*result)+((existsConvenienceManyToMany == null)? 0 :existsConvenienceManyToMany.hashCode())); - result = ((prime*result)+((rowConvenienceToOne == null)? 0 :rowConvenienceToOne.hashCode())); - result = ((prime*result)+((multisetConvenienceOneToMany == null)? 0 :multisetConvenienceOneToMany.hashCode())); - result = ((prime*result)+((multisetConvenienceManyToMany == null)? 0 :multisetConvenienceManyToMany.hashCode())); result = ((prime*result)+((deprecated == null)? 0 :deprecated.hashCode())); result = ((prime*result)+((deprecationOnUnknownTypes == null)? 0 :deprecationOnUnknownTypes.hashCode())); result = ((prime*result)+((instanceFields == null)? 0 :instanceFields.hashCode())); 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 f285d176e6..041793afcc 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 @@ -1854,46 +1854,6 @@ This flag allows for turning off this default behaviour.]]> - - EXISTS convenience syntax for one-to-many relationships. -

-This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. -

-This feature is available in the commercial distribution only.]]> - - - - EXISTS convenience syntax for many-to-many relationships. A many-to-many relationship is achieved when a child table has 2 non-nullable foreign keys that are part of a unique key. -

-This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. -

-This feature is available in the commercial distribution only.]]> - - - - ROW convenience syntax for to-one relationships. -

-This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. -

-This feature is available in the commercial distribution only.]]> - - - - MULTISET convenience syntax for one-to-many relationships. -

-This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. -

-This feature is available in the commercial distribution only.]]> - - - - MULTISET convenience syntax for many-to-many relationships. A many-to-many relationship is achieved when a child table has 2 non-nullable foreign keys that are part of a unique key. -

-This is EXPERIMENTAL functionality. Please expect the API and implementations to change, in the future. -

-This feature is available in the commercial distribution only.]]> - - diff --git a/jOOQ/src/main/java/org/jooq/impl/TableImpl.java b/jOOQ/src/main/java/org/jooq/impl/TableImpl.java index f50417da26..b46003e0a9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/TableImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/TableImpl.java @@ -299,290 +299,6 @@ implements return null; } - - /** - * Create a ROW to-one parent table expression from this table. - */ - @org.jooq.Internal - @NotNull - protected Field toOneRow( - ForeignKey path, - Function, ? extends TableLike> f - ) { - - if (CONFIG.commercial()) { - - - - - - - - - - - - - - - - - - - - } - - throw new DataAccessException("The to-one ROW convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); - } - - /** - * Create a MULTISET one-to-many child table expression from - * this table. - */ - @org.jooq.Internal - @NotNull - protected Field> oneToManyMultiset( - ForeignKey path, - Function, ? extends TableLike> f - ) { - if (CONFIG.commercial()) { - - - - - - - - - - - - - - - - - - - - } - - throw new DataAccessException("The one-to-many MULTISET convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); - } - - /** - * Create a MULTISET many-to-many child table expression from - * this table. - */ - @org.jooq.Internal - @NotNull - protected Field> manyToManyMultiset( - ForeignKey path1, - ForeignKey path2, - Function, ? extends TableLike> f - ) { - if (CONFIG.commercial()) { - - - - - - - - - - - - - - - - - - - - } - - throw new DataAccessException("The many-to-many MULTISET convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); - } - - /** - * Create a MULTISET one-to-many child table expression from - * this table. - */ - @org.jooq.Internal - @NotNull - protected Condition oneToManyExists( - ForeignKey path, - Function, ? extends TableLike> f - ) { - if (CONFIG.commercial()) { - - - - - - - - - - - - - - - - - - - - } - - throw new DataAccessException("The one-to-many EXISTS convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); - } - - /** - * Create a MULTISET many-to-many child table expression from - * this table. - */ - @org.jooq.Internal - @NotNull - protected Condition manyToManyExists( - ForeignKey path1, - ForeignKey path2, - Function, ? extends TableLike> f - ) { - if (CONFIG.commercial()) { - - - - - - - - - - - - - - - - - - - - } - - throw new DataAccessException("The many-to-many EXISTS convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** * Check if this table already aliases another one.