diff --git a/jOOQ/src/main/java/org/jooq/conf/Settings.java b/jOOQ/src/main/java/org/jooq/conf/Settings.java index 98acbbe77a..7edd012713 100644 --- a/jOOQ/src/main/java/org/jooq/conf/Settings.java +++ b/jOOQ/src/main/java/org/jooq/conf/Settings.java @@ -93,6 +93,9 @@ public class Settings @XmlElement(defaultValue = "DEFAULT") @XmlSchemaType(name = "string") protected RenderImplicitJoinType renderImplicitJoinType = RenderImplicitJoinType.DEFAULT; + @XmlElement(defaultValue = "DEFAULT") + @XmlSchemaType(name = "string") + protected RenderImplicitJoinType renderImplicitJoinToManyType = RenderImplicitJoinType.DEFAULT; @XmlElement(defaultValue = "IMPLICIT_NULL") @XmlSchemaType(name = "string") protected RenderDefaultNullability renderDefaultNullability = RenderDefaultNullability.IMPLICIT_NULL; @@ -1027,6 +1030,32 @@ public class Settings this.renderImplicitJoinType = value; } + /** + * The join type to be generated by implicit joins for to-many paths in {@link org.jooq.Select} queries. + *
+ * The DEFAULT is SCALAR_SUBQUERY if the join path is implicit only, i.e. absent from
+ * the FROM clause, to prevent accidental cartesian products, or LEFT_JOIN if declared
+ * explicitly in the FROM clause. In DML statements, it is always SCALAR_SUBQUERY,
+ * unless DML joins are supported.
+ *
+ */
+ public RenderImplicitJoinType getRenderImplicitJoinToManyType() {
+ return renderImplicitJoinToManyType;
+ }
+
+ /**
+ * The join type to be generated by implicit joins for to-many paths in {@link org.jooq.Select} queries.
+ *
+ * The DEFAULT is SCALAR_SUBQUERY if the join path is implicit only, i.e. absent from
+ * the FROM clause, to prevent accidental cartesian products, or LEFT_JOIN if declared
+ * explicitly in the FROM clause. In DML statements, it is always SCALAR_SUBQUERY,
+ * unless DML joins are supported.
+ *
+ */
+ public void setRenderImplicitJoinToManyType(RenderImplicitJoinType value) {
+ this.renderImplicitJoinToManyType = value;
+ }
+
/**
* Whether the {@link org.jooq.Nullability#DEFAULT} nullablity should be rendered in generated DDL, and how it should be rendered.
*
@@ -6232,6 +6261,20 @@ public class Settings
return this;
}
+ /**
+ * The join type to be generated by implicit joins for to-many paths in {@link org.jooq.Select} queries.
+ *
+ * The DEFAULT is SCALAR_SUBQUERY if the join path is implicit only, i.e. absent from
+ * the FROM clause, to prevent accidental cartesian products, or LEFT_JOIN if declared
+ * explicitly in the FROM clause. In DML statements, it is always SCALAR_SUBQUERY,
+ * unless DML joins are supported.
+ *
+ */
+ public Settings withRenderImplicitJoinToManyType(RenderImplicitJoinType value) {
+ setRenderImplicitJoinToManyType(value);
+ return this;
+ }
+
/**
* Whether the {@link org.jooq.Nullability#DEFAULT} nullablity should be rendered in generated DDL, and how it should be rendered.
*
@@ -7646,6 +7689,7 @@ public class Settings
builder.append("renderImplicitWindowRange", renderImplicitWindowRange);
builder.append("renderScalarSubqueriesForStoredFunctions", renderScalarSubqueriesForStoredFunctions);
builder.append("renderImplicitJoinType", renderImplicitJoinType);
+ builder.append("renderImplicitJoinToManyType", renderImplicitJoinToManyType);
builder.append("renderDefaultNullability", renderDefaultNullability);
builder.append("renderCoalesceToEmptyStringInConcat", renderCoalesceToEmptyStringInConcat);
builder.append("renderOrderByRownumberForEmulatedPagination", renderOrderByRownumberForEmulatedPagination);
@@ -8065,6 +8109,15 @@ public class Settings
return false;
}
}
+ if (renderImplicitJoinToManyType == null) {
+ if (other.renderImplicitJoinToManyType!= null) {
+ return false;
+ }
+ } else {
+ if (!renderImplicitJoinToManyType.equals(other.renderImplicitJoinToManyType)) {
+ return false;
+ }
+ }
if (renderDefaultNullability == null) {
if (other.renderDefaultNullability!= null) {
return false;
@@ -9894,6 +9947,7 @@ public class Settings
result = ((prime*result)+((renderImplicitWindowRange == null)? 0 :renderImplicitWindowRange.hashCode()));
result = ((prime*result)+((renderScalarSubqueriesForStoredFunctions == null)? 0 :renderScalarSubqueriesForStoredFunctions.hashCode()));
result = ((prime*result)+((renderImplicitJoinType == null)? 0 :renderImplicitJoinType.hashCode()));
+ result = ((prime*result)+((renderImplicitJoinToManyType == null)? 0 :renderImplicitJoinToManyType.hashCode()));
result = ((prime*result)+((renderDefaultNullability == null)? 0 :renderDefaultNullability.hashCode()));
result = ((prime*result)+((renderCoalesceToEmptyStringInConcat == null)? 0 :renderCoalesceToEmptyStringInConcat.hashCode()));
result = ((prime*result)+((renderOrderByRownumberForEmulatedPagination == null)? 0 :renderOrderByRownumberForEmulatedPagination.hashCode()));
diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractContext.java b/jOOQ/src/main/java/org/jooq/impl/AbstractContext.java
index 25a30ca2bd..25a866f2a6 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AbstractContext.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AbstractContext.java
@@ -1261,7 +1261,7 @@ abstract class AbstractContextDEFAULT is dependent on the nullability of the foreign key (SCALAR_SUBQUERY, unless DML joins are supported.]]>
+
+ DEFAULT is SCALAR_SUBQUERY if the join path is implicit only, i.e. absent from
+the FROM clause, to prevent accidental cartesian products, or LEFT_JOIN if declared
+explicitly in the FROM clause. In DML statements, it is always SCALAR_SUBQUERY,
+unless DML joins are supported.]]>