org.jooq.util
Class DefaultGenerator

java.lang.Object
  extended by org.jooq.util.DefaultGenerator
All Implemented Interfaces:
Generator

public class DefaultGenerator
extends Object
implements Generator

A default implementation for code generation. Replace this code with your own logic, if you need your database schema represented in a different way.

Note that you can also extend this class to generate POJO's or other stuff entirely independent of jOOQ.

Author:
Lukas Eder

Constructor Summary
DefaultGenerator()
           
 
Method Summary
 void generate(org.jooq.util.Database database)
          Do the code generation
 boolean generateDeprecated()
          Whether deprecated code should be generated
 boolean generateRelations()
          Whether foreign key relations should be resolved
 GeneratorStrategy getStrategy()
          Get this generator's underlying naming strategy
 String getTargetDirectory()
          The target directory
 String getTargetPackage()
           
 void setGenerateDeprecated(boolean generateDeprecated)
          Whether deprecated code should be generated
 void setGenerateRelations(boolean generateRelations)
          Whether foreign key relations should be resolved
 void setStrategy(GeneratorStrategy strategy)
          Set a naming strategy to this generator
 void setTargetDirectory(String directory)
          Initialise the target directory
 void setTargetPackage(String packageName)
          Initialise the target package name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGenerator

public DefaultGenerator()
Method Detail

setStrategy

public void setStrategy(GeneratorStrategy strategy)
Description copied from interface: Generator
Set a naming strategy to this generator

Specified by:
setStrategy in interface Generator

getStrategy

public GeneratorStrategy getStrategy()
Description copied from interface: Generator
Get this generator's underlying naming strategy

Specified by:
getStrategy in interface Generator

generateDeprecated

public boolean generateDeprecated()
Description copied from interface: Generator
Whether deprecated code should be generated

Specified by:
generateDeprecated in interface Generator

setGenerateDeprecated

public void setGenerateDeprecated(boolean generateDeprecated)
Description copied from interface: Generator
Whether deprecated code should be generated

Specified by:
setGenerateDeprecated in interface Generator

generateRelations

public boolean generateRelations()
Description copied from interface: Generator
Whether foreign key relations should be resolved

Specified by:
generateRelations in interface Generator

setGenerateRelations

public void setGenerateRelations(boolean generateRelations)
Description copied from interface: Generator
Whether foreign key relations should be resolved

Specified by:
setGenerateRelations in interface Generator

setTargetDirectory

public void setTargetDirectory(String directory)
Description copied from interface: Generator
Initialise the target directory

Specified by:
setTargetDirectory in interface Generator

getTargetDirectory

public String getTargetDirectory()
Description copied from interface: Generator
The target directory

Specified by:
getTargetDirectory in interface Generator

setTargetPackage

public void setTargetPackage(String packageName)
Description copied from interface: Generator
Initialise the target package name

Specified by:
setTargetPackage in interface Generator

getTargetPackage

public String getTargetPackage()
Specified by:
getTargetPackage in interface Generator
Returns:
Get the target package for the current configuration

generate

public void generate(org.jooq.util.Database database)
              throws SQLException,
                     IOException
Description copied from interface: Generator
Do the code generation

Specified by:
generate in interface Generator
Throws:
SQLException
IOException


Copyright © 2011. All Rights Reserved.