java.lang.Object
org.jooq.codegen.GenerationTool
The GenerationTool takes care of generating Java code from a database schema.
It takes its configuration parameters from an XML file passed in either as a
JAXB-annotated Configuration object, or from the file system when
passed as an argument to main(String[]).
See http://www.jooq.org/xsd/ for the latest XSD specification.
- Author:
- Lukas Eder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longcopyLarge(InputStream input, OutputStream output) Copy bytes from a large (over 2GB)InputStreamto anOutputStream.static voidstatic voidgenerate(Configuration configuration) static Configurationload(InputStream in) Load a jOOQ codegen configuration file from an input streamstatic voidstatic voidmain(Configuration configuration) Deprecated.voidrun(Configuration configuration) voidsetClassLoader(ClassLoader loader) The class loader to use with this generation tool.voidsetConnection(Connection connection) The JDBC connection to use with this generation tool.voidsetDataSource(DataSource dataSource) The JDBC data source to use with this generation tool.
-
Field Details
-
DEFAULT_TARGET_ENCODING
- See Also:
-
DEFAULT_TARGET_DIRECTORY
- See Also:
-
DEFAULT_TARGET_PACKAGENAME
- See Also:
-
-
Constructor Details
-
GenerationTool
public GenerationTool()
-
-
Method Details
-
setClassLoader
The class loader to use with this generation tool.If set, all classes are loaded with this class loader
-
setConnection
The JDBC connection to use with this generation tool.If set, the configuration XML's
<jdbc/>configuration is ignored, and this connection is used for meta data inspection, instead. -
setDataSource
The JDBC data source to use with this generation tool.If set, the configuration XML's
<jdbc/>configuration is ignored, and this connection is used for meta data inspection, instead. -
main
- Throws:
Exception
-
main
Deprecated.- Usegenerate(Configuration)instead- Throws:
Exception
-
generate
- Throws:
Exception
-
generate
- Throws:
Exception
-
run
- Throws:
Exception
-
copyLarge
Copy bytes from a large (over 2GB)InputStreamto anOutputStream.This method buffers the input internally, so there is no need to use a
BufferedInputStream.- Parameters:
input- theInputStreamto read fromoutput- theOutputStreamto write to- Returns:
- the number of bytes copied
- Throws:
NullPointerException- if the input or output is nullIOException- if an I/O error occurs- Since:
- Commons IO 1.3
-
load
Load a jOOQ codegen configuration file from an input stream- Throws:
IOException
-
generate(Configuration)instead