Class DBClassGenerator<T extends GenerationTarget>
java.lang.Object
no.sikt.graphitron.generators.abstractions.AbstractClassGenerator
no.sikt.graphitron.generators.abstractions.AbstractSchemaClassGenerator<T>
no.sikt.graphitron.generators.abstractions.DBClassGenerator<T>
- All Implemented Interfaces:
ClassGenerator
- Direct Known Subclasses:
FetchDBClassGenerator,UpdateDBClassGenerator
public abstract class DBClassGenerator<T extends GenerationTarget>
extends AbstractSchemaClassGenerator<T>
Superclass for any select query generator classes.
-
Field Summary
FieldsFields inherited from class no.sikt.graphitron.generators.abstractions.AbstractSchemaClassGenerator
processedSchema -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSpec(String className, List<? extends MethodGenerator> generators) voidwriteToFile(TypeSpec generatedClass, String path, String packagePath, String directoryOverride) Create theJavaFilefor this class, add any common static imports and write it to file.writeToString(TypeSpec generatedClass) Create theJavaFilefor this class, add any common static imports and render the file as a string.Methods inherited from class no.sikt.graphitron.generators.abstractions.AbstractSchemaClassGenerator
generateMethods inherited from class no.sikt.graphitron.generators.abstractions.AbstractClassGenerator
generateAllAsMap, generateAllToDirectory, getGeneratedClassName, getSpec, setDependencies, writeToFileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface no.sikt.graphitron.generators.abstractions.ClassGenerator
generateAll
-
Field Details
-
DEFAULT_SAVE_DIRECTORY_NAME
- See Also:
-
FILE_NAME_SUFFIX
- See Also:
-
-
Constructor Details
-
DBClassGenerator
-
-
Method Details
-
getDefaultSaveDirectoryName
- Returns:
- The final directory path within the package where the classes are ultimately saved.
-
getSpec
- Specified by:
getSpecin interfaceClassGenerator- Overrides:
getSpecin classAbstractClassGenerator- Parameters:
className- The name of the class.generators- List of method generators that this class should use to generate its methods.- Returns:
- A completed
TypeSpec.Builderfor this class, where all methods have already been added.
-
getStaticImports
-
writeToFile
public void writeToFile(TypeSpec generatedClass, String path, String packagePath, String directoryOverride) Description copied from interface:ClassGeneratorCreate theJavaFilefor this class, add any common static imports and write it to file.- Specified by:
writeToFilein interfaceClassGenerator- Overrides:
writeToFilein classAbstractClassGenerator- Parameters:
generatedClass- A complete javapoetTypeSpec.path- The path to the output directory.packagePath- The package path that this class should be written to.directoryOverride- Override the directory within the package where the class is saved to.
-
writeToString
Description copied from interface:ClassGeneratorCreate theJavaFilefor this class, add any common static imports and render the file as a string.- Specified by:
writeToStringin interfaceClassGenerator- Overrides:
writeToStringin classAbstractClassGenerator- Parameters:
generatedClass- A complete javapoetTypeSpec.
-
getFileNameSuffix
- Returns:
- The suffix that is to be added to the end of file names generated by this class.
-