Class GenerateQueryDaoClasses
java.lang.Object
com.northconcepts.datapipeline.foundations.tools.GenerateQueryDaoClasses
Generates a class for each query registered with a
JdbcConnection, with a field per result column and static
executeQuery methods. Each query is run with its example parameter values to discover its columns.-
Constructor Summary
ConstructorsConstructorDescriptionGenerateQueryDaoClasses(JdbcConnection jdbcConnection, File baseFolder, String targetPackage) -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate()Runs each query registered with the connection and generates its class, writing a file or printing it perisWriteToFile().getEntityFile(String fileName) Returns the.javafile for the given class name in the target package's folder under the base folder.Class<?> Returns the superclass of the generated classes, or null for none; generated record serialization also calls aRecordSerializablesuperclass.getFieldAsJavaIdentifierName(JavaCodeBuilder code, JdbcQueryColumn column, int index) Returns the unique Java field name for the query column at the given index of the class being generated, creating it on first use.Returns the source of each class generated by the lastgenerate()call, or null before the first call.Returns the writer for progress messages and, when not writing files, the generated source (standard output if not set).booleanbooleanIndicates if generated classes are written as files under the base folder instead of printed to the print writer (default true).setEntitySuperClass(Class<?> entitySuperClass) Sets the superclass of the generated classes, or null for none; generated record serialization also calls aRecordSerializablesuperclass.setMakeIdentifiersSingular(boolean makeIdentifiersSingular) setPrintWriter(PrintWriter printWriter) Sets the writer for progress messages and, when not writing files, the generated source (standard output if not set).setWriteToFile(boolean writeToFile) Indicates if generated classes are written as files under the base folder instead of printed to the print writer (default true).
-
Constructor Details
-
GenerateQueryDaoClasses
public GenerateQueryDaoClasses(JdbcConnection jdbcConnection, File baseFolder, String targetPackage)
-
-
Method Details
-
isMakeIdentifiersSingular
public boolean isMakeIdentifiersSingular() -
setMakeIdentifiersSingular
-
getEntitySuperClass
Returns the superclass of the generated classes, or null for none; generated record serialization also calls aRecordSerializablesuperclass. -
setEntitySuperClass
Sets the superclass of the generated classes, or null for none; generated record serialization also calls aRecordSerializablesuperclass. -
generate
public void generate()Runs each query registered with the connection and generates its class, writing a file or printing it perisWriteToFile(). -
getEntityFile
Returns the.javafile for the given class name in the target package's folder under the base folder. -
getFieldAsJavaIdentifierName
Returns the unique Java field name for the query column at the given index of the class being generated, creating it on first use. -
getPrintWriter
Returns the writer for progress messages and, when not writing files, the generated source (standard output if not set). -
setPrintWriter
Sets the writer for progress messages and, when not writing files, the generated source (standard output if not set). -
isWriteToFile
public boolean isWriteToFile()Indicates if generated classes are written as files under the base folder instead of printed to the print writer (default true). -
setWriteToFile
Indicates if generated classes are written as files under the base folder instead of printed to the print writer (default true). -
getJavaCode
Returns the source of each class generated by the lastgenerate()call, or null before the first call.
-