[jOOQ/jOOQ#10801] Add JavaGenerator.printDaoConstructorAnnotations() to allow for custom annotations in generated DAO constructors
This commit is contained in:
parent
aa33496cde
commit
e4aa7c1eed
@ -4077,9 +4077,7 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
if (!scala && !kotlin) {
|
||||
out.javadoc("Create a new %s with an attached configuration", className);
|
||||
|
||||
if (generateSpringAnnotations())
|
||||
out.println("@%s", out.ref("org.springframework.beans.factory.annotation.Autowired"));
|
||||
|
||||
printDaoConstructorAnnotations(table, out);
|
||||
out.println("%s%s(%s configuration) {", visibility(), className, Configuration.class);
|
||||
out.println("super(%s, %s.class, configuration);", tableIdentifier, pType);
|
||||
out.println("}");
|
||||
@ -4216,6 +4214,15 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
out.println("}");
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses may override this method to provide alternative DAO
|
||||
* constructor annotations, such as DI annotations. [#10801]
|
||||
*/
|
||||
protected void printDaoConstructorAnnotations(TableDefinition table, JavaWriter out) {
|
||||
if (generateSpringAnnotations())
|
||||
out.println("@%s", out.ref("org.springframework.beans.factory.annotation.Autowired"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses may override this method to provide dao class footer code.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user