[jOOQ/jOOQ#17592] Missing Generated annotations on nested Path classes
This commit is contained in:
parent
0596e787ac
commit
ccd7b94f6c
@ -7241,6 +7241,7 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
final String pathClassName = getStrategy().getJavaClassName(table, Mode.PATH);
|
||||
|
||||
out.javadoc("A subtype implementing {@link %s} for simplified path-based joins.", Path.class);
|
||||
printClassAnnotations(out, table, Mode.PATH);
|
||||
out.println("%sclass %s(path: %s[%s <: %s], childPath: %s[%s <: %s, %s], parentPath: %s[%s <: %s, %s]) extends %s(path, childPath, parentPath) with %s[%s]",
|
||||
visibility(), pathClassName, Table.class, wildcard(), Record.class, ForeignKey.class, wildcard(), Record.class, recordType, InverseForeignKey.class, wildcard(), Record.class, recordType, className, Path.class, recordType);
|
||||
}
|
||||
@ -7623,6 +7624,7 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
if (scala) {}
|
||||
else if (kotlin) {
|
||||
out.javadoc("A subtype implementing {@link %s} for simplified path-based joins.", Path.class);
|
||||
printClassAnnotations(out, table, Mode.PATH);
|
||||
out.println("%sopen class %s : %s, %s<%s> {",
|
||||
visibility(), pathClassName, className, Path.class, recordType);
|
||||
out.println("%sconstructor(path: %s<out %s>, childPath: %s<out %s, %s>?, parentPath: %s<out %s, %s>?): super(path, childPath, parentPath)", visibility(), Table.class, Record.class, ForeignKey.class, Record.class, recordType, InverseForeignKey.class, Record.class, recordType);
|
||||
@ -7634,6 +7636,7 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
}
|
||||
else {
|
||||
out.javadoc("A subtype implementing {@link %s} for simplified path-based joins.", Path.class);
|
||||
printClassAnnotations(out, table, Mode.PATH);
|
||||
out.println("%sstatic class %s extends %s implements %s<%s> {", visibility(), pathClassName, className, Path.class, recordType);
|
||||
out.printSerial();
|
||||
out.println("%s<O extends %s> %s(%s<O> path, %s<O, %s> childPath, %s<O, %s> parentPath) {", visibility(), Record.class, pathClassName, Table.class, ForeignKey.class, recordType, InverseForeignKey.class, recordType);
|
||||
@ -11282,13 +11285,16 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
out.println(")");
|
||||
}
|
||||
|
||||
if (scala) {}
|
||||
else if (kotlin)
|
||||
out.println("@Suppress(\"UNCHECKED_CAST\")");
|
||||
else if (Internal.javaVersion() >= 21)
|
||||
out.println("@%s({ \"all\", \"unchecked\", \"rawtypes\", \"this-escape\" })", out.ref("java.lang.SuppressWarnings"));
|
||||
else
|
||||
out.println("@%s({ \"all\", \"unchecked\", \"rawtypes\" })", out.ref("java.lang.SuppressWarnings"));
|
||||
// [#17592] Path classes are nested, and thus in scope of the enclosing class's warning suppression.
|
||||
if (!(definition instanceof TableDefinition && mode == Mode.PATH)) {
|
||||
if (scala) {}
|
||||
else if (kotlin)
|
||||
out.println("@Suppress(\"UNCHECKED_CAST\")");
|
||||
else if (Internal.javaVersion() >= 21)
|
||||
out.println("@%s({ \"all\", \"unchecked\", \"rawtypes\", \"this-escape\" })", out.ref("java.lang.SuppressWarnings"));
|
||||
else
|
||||
out.println("@%s({ \"all\", \"unchecked\", \"rawtypes\" })", out.ref("java.lang.SuppressWarnings"));
|
||||
}
|
||||
|
||||
out.annotations(definition);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user