[jOOQ/jOOQ#9663] Regenerated test code
This commit is contained in:
parent
de72c3192b
commit
349b73f540
@ -1103,17 +1103,22 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
|
||||
private void printCreateUniqueKey(JavaWriter out, UniqueKeyDefinition uniqueKey) {
|
||||
if (scala)
|
||||
out.print("%s.createUniqueKey(%s, \"%s\", [[%s]])",
|
||||
out.print("%s.createUniqueKey(%s, \"%s\", Array([[%s]]).asInstanceOf[Array[%s[%s, _] ] ], %s)",
|
||||
Internal.class,
|
||||
out.ref(getStrategy().getFullJavaIdentifier(uniqueKey.getTable()), 2),
|
||||
escapeString(uniqueKey.getOutputName()),
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(uniqueKey.getKeyColumns()), colRefSegments(null)));
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(uniqueKey.getKeyColumns()), colRefSegments(null)),
|
||||
TableField.class,
|
||||
out.ref(getStrategy().getJavaClassName(uniqueKey.getTable(), Mode.RECORD)),
|
||||
uniqueKey.enforced());
|
||||
else
|
||||
out.print("%s.createUniqueKey(%s, \"%s\", [[%s]])",
|
||||
out.print("%s.createUniqueKey(%s, \"%s\", new %s[] { [[%s]] }, %s)",
|
||||
Internal.class,
|
||||
out.ref(getStrategy().getFullJavaIdentifier(uniqueKey.getTable()), 2),
|
||||
escapeString(uniqueKey.getOutputName()),
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(uniqueKey.getKeyColumns()), colRefSegments(null)));
|
||||
TableField.class,
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(uniqueKey.getKeyColumns()), colRefSegments(null)),
|
||||
uniqueKey.enforced());
|
||||
}
|
||||
|
||||
protected void printForeignKey(JavaWriter out, int foreignKeyCounter, ForeignKeyDefinition foreignKey) {
|
||||
@ -1134,7 +1139,7 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
}
|
||||
|
||||
if (scala)
|
||||
out.tab(2).println("val %s : %s[%s, %s] = %s.createForeignKey(%s, %s, \"%s\", [[%s]])",
|
||||
out.tab(2).println("val %s : %s[%s, %s] = %s.createForeignKey(%s, %s, \"%s\", Array([[%s]]).asInstanceOf[Array[%s[%s, _] ] ], %s)",
|
||||
getStrategy().getJavaIdentifier(foreignKey),
|
||||
ForeignKey.class,
|
||||
out.ref(getStrategy().getFullJavaClassName(foreignKey.getKeyTable(), Mode.RECORD)),
|
||||
@ -1143,9 +1148,12 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
out.ref(getStrategy().getFullJavaIdentifier(foreignKey.getReferencedKey()), 2),
|
||||
out.ref(getStrategy().getFullJavaIdentifier(foreignKey.getKeyTable()), 2),
|
||||
escapeString(foreignKey.getOutputName()),
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(foreignKey.getKeyColumns()), colRefSegments(null)));
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(foreignKey.getKeyColumns()), colRefSegments(null)),
|
||||
TableField.class,
|
||||
out.ref(getStrategy().getJavaClassName(foreignKey.getTable(), Mode.RECORD)),
|
||||
foreignKey.enforced());
|
||||
else
|
||||
out.tab(2).println("public static final %s<%s, %s> %s = %s.createForeignKey(%s, %s, \"%s\", [[%s]]);",
|
||||
out.tab(2).println("public static final %s<%s, %s> %s = %s.createForeignKey(%s, %s, \"%s\", new %s[] { [[%s]] }, %s);",
|
||||
ForeignKey.class,
|
||||
out.ref(getStrategy().getFullJavaClassName(foreignKey.getKeyTable(), Mode.RECORD)),
|
||||
out.ref(getStrategy().getFullJavaClassName(foreignKey.getReferencedTable(), Mode.RECORD)),
|
||||
@ -1154,7 +1162,9 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
out.ref(getStrategy().getFullJavaIdentifier(foreignKey.getReferencedKey()), 2),
|
||||
out.ref(getStrategy().getFullJavaIdentifier(foreignKey.getKeyTable()), 2),
|
||||
escapeString(foreignKey.getOutputName()),
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(foreignKey.getKeyColumns()), colRefSegments(null)));
|
||||
TableField.class,
|
||||
out.ref(getStrategy().getFullJavaIdentifiers(foreignKey.getKeyColumns()), colRefSegments(null)),
|
||||
foreignKey.enforced());
|
||||
}
|
||||
|
||||
protected void generateRecords(SchemaDefinition schema) {
|
||||
@ -4249,7 +4259,7 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
|
||||
String separator = " ";
|
||||
for (CheckConstraintDefinition c : cc) {
|
||||
out.tab(3).println("%s%s.createCheck(this, %s.name(\"%s\"), \"%s\")", separator, Internal.class, DSL.class, c.getName().replace("\"", "\\\""), c.getCheckClause().replace("\"", "\\\""));
|
||||
out.tab(3).println("%s%s.createCheck(this, %s.name(\"%s\"), \"%s\", %s)", separator, Internal.class, DSL.class, c.getName().replace("\"", "\\\""), c.getCheckClause().replace("\"", "\\\""), c.enforced());
|
||||
separator = ", ";
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ public final class Internal {
|
||||
@SafeVarargs
|
||||
|
||||
public static final <R extends Record> UniqueKey<R> createUniqueKey(Table<R> table, TableField<R, ?>... fields) {
|
||||
return new UniqueKeyImpl<>(table, fields, true);
|
||||
return createUniqueKey(table, null, fields, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,7 +110,14 @@ public final class Internal {
|
||||
@SafeVarargs
|
||||
|
||||
public static final <R extends Record> UniqueKey<R> createUniqueKey(Table<R> table, String name, TableField<R, ?>... fields) {
|
||||
return new UniqueKeyImpl<>(table, name, fields, true);
|
||||
return createUniqueKey(table, name, fields, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory method for unique keys.
|
||||
*/
|
||||
public static final <R extends Record> UniqueKey<R> createUniqueKey(Table<R> table, String name, TableField<R, ?>[] fields, boolean enforced) {
|
||||
return new UniqueKeyImpl<>(table, name, fields, enforced);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +137,14 @@ public final class Internal {
|
||||
@SafeVarargs
|
||||
|
||||
public static final <R extends Record, U extends Record> ForeignKey<R, U> createForeignKey(UniqueKey<U> key, Table<R> table, String name, TableField<R, ?>... fields) {
|
||||
ForeignKey<R, U> result = new ReferenceImpl<>(key, table, name, fields, true);
|
||||
return createForeignKey(key, table, name, fields, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory method for foreign keys.
|
||||
*/
|
||||
public static final <R extends Record, U extends Record> ForeignKey<R, U> createForeignKey(UniqueKey<U> key, Table<R> table, String name, TableField<R, ?>[] fields, boolean enforced) {
|
||||
ForeignKey<R, U> result = new ReferenceImpl<>(key, table, name, fields, enforced);
|
||||
|
||||
if (key instanceof UniqueKeyImpl)
|
||||
((UniqueKeyImpl<U>) key).references.add(result);
|
||||
@ -167,7 +181,14 @@ public final class Internal {
|
||||
* Factory method for check constraints.
|
||||
*/
|
||||
public static final <R extends Record> Check<R> createCheck(Table<R> table, Name name, String condition) {
|
||||
return new CheckImpl<>(table, name, DSL.condition(condition), true);
|
||||
return createCheck(table, name, condition, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory method for check constraints.
|
||||
*/
|
||||
public static final <R extends Record> Check<R> createCheck(Table<R> table, Name name, String condition, boolean enforced) {
|
||||
return new CheckImpl<>(table, name, DSL.condition(condition), enforced);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user