|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.AbstractMojo org.apache.torque.mojo.TexenTaskMojo org.apache.torque.mojo.DataModelTaskMojo org.apache.torque.mojo.OMMojo
public class OMMojo
Generates the sources for the persistence classes from the schema.xml files.
Field Summary | |
---|---|
static String |
ADD_GET_BY_NAME_METHOD_CONTEXT_PROPERTY
The context property where the generation of the getByName- Methods can be turned on and off. |
static String |
ADD_INTAKE_RETRIEVABLE_CONTEXT_PROPERTY
The context property where it is configured whether the data objects implement a Retrievable interface. |
static String |
ADD_SAVE_METHOD_CONTEXT_PROPERTY
The context property where the generation of the save methods can be turned on and off. |
static String |
ADD_TIME_STAMP_CONTEXT_PROPERTY
The context property which determines whether time stamps are put into generated files. |
static String |
BASE_PREFIX_CONTEXT_PROPERTY
The context property for the prefix of the class name for the generated base classes, |
static String |
BEAN_EXTENDS_CLASS_PROPERTY
The context property which determines the fully qualifed class name that the base beans will extend. |
static String |
BEAN_SUFFIX_CONTEXT_PROPERTY
The context property which determines the name suffix of generated bean classes. |
static String |
COMPLEX_OBJECT_MODEL_CONTEXT_PROPERTY
The context property where it is configured whether methods are generated to easily retrieve foreign key relationships. |
static String |
CORRECT_GETTERS_CONTEXT_PROPERTY
The context property which determines whether isXXX methods are generated for boolean properties instead of getXXX methods. |
static String |
ENABLE_JAVA_5_FEATURES_CONTEXT_PROPERTY
The context property which determines whether java5 generics and easy iteration are used in generated code. |
static String |
GENERATE_BEANS_CONTEXT_PROPERTY
The context property which determines whether bean classes should be generated. |
static String |
OBJECT_IS_CACHING_CONTEXT_PROPERTY
The context property which determines whether foreign key relationships are cached. |
static String |
RETRIEVABLE_INTERFACE_CONTEXT_PROPERTY
The context property where it is configured whether the data objects implement a Retrievable interface. |
static String |
SAVE_EXCEPTION_CONTEXT_PROPERTY
The context property where the exception thown by save methods can be configured. |
static String |
SILENT_DB_FETCH_CONTEXT_PROPERTY
The context property which determines whether empty cached foreign key relations should be filled automatically. |
static String |
SUBPACKAGE_BASE_BEAN_CONTEXT_PROPERTY
The context property for the subpackage of the generated base bean classes. |
static String |
SUBPACKAGE_BASE_CONTEXT_PROPERTY
The context property for the subpackage of the generated base Object, Peer, and Manager classes. |
static String |
SUBPACKAGE_BEAN_CONTEXT_PROPERTY
The context property for the subpackage of the generated bean classes. |
static String |
SUBPACKAGE_MANAGER_CONTEXT_PROPERTY
The context property for the subpackage of the generated manager classes. |
static String |
SUBPACKAGE_MAP_CONTEXT_PROPERTY
The context property for the subpackage of the generated database Map classes. |
static String |
SUBPACKAGE_OBJECT_CONTEXT_PROPERTY
The context property for the subpackage of the generated data object classes. |
static String |
SUBPACKAGE_PEER_CONTEXT_PROPERTY
The context property for the subpackage of the generated peer classes. |
static String |
TARGET_PACKAGE_CONTEXT_PROPERTY
The context property for the target package. |
static String |
USE_MANAGERS_CONTEXT_PROPERTY
The context property which determines whether manager classes are generated. |
Fields inherited from class org.apache.torque.mojo.DataModelTaskMojo |
---|
TARGET_DATABASE_CONTEXT_PROPERTY |
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
OMMojo()
Creates a new TorqueOMMojo object. |
Method Summary | |
---|---|
void |
execute()
Generates the OM classes for a Torque project and adds them to the compile sources of the project. |
String |
getBaseOutputDir()
Returns where the sources for the persistence base classes will be generated. |
String |
getBasePrefix()
Returns the prefix for the base classes. |
String |
getBaseReportFile()
Returns the location where the report file for the base persistence classes will be generated. |
String |
getBeanExtendsClass()
Returns the fully qualified class that the generated base bean classes will extend. |
String |
getBeanSuffix()
Returns the suffix for the names of the bean classes. |
protected String |
getControlTemplate()
Returns the path to the control template. |
protected org.apache.commons.configuration.PropertiesConfiguration |
getMojoContextProperties()
Returns the context properties for the Texen task. |
String |
getRetrievableInterface()
Returns the fully qualified class name of the Retrievable interface which should be implemented by the generated data objects. |
String |
getSaveException()
Returns the class name of the Exception which should be thrown by the save methods of the generated data objects. |
String |
getSubpackageBase()
Gets the subpackage for the base Object, Peer, and Manager classes. |
String |
getSubpackageBaseBean()
Gets the subpackage for the base peer, object, and manager classes. |
String |
getSubpackageBean()
Gets the subpackage for the bean classes. |
String |
getSubpackageManager()
Gets the subpackage for the manager classes. |
String |
getSubpackageMap()
Gets the subpackage for the database map classes. |
String |
getSubpackageObject()
Gets the subpackage for the data object classes. |
String |
getSubpackagePeer()
Gets the subpackage for the peer classes. |
boolean |
isAddGetByNameMethod()
Returns whether Torque adds methods to get database fields by name/position. |
boolean |
isAddRetrievableInterface()
Returns whether the data objects will implement an Retrievable interface. |
boolean |
isAddSaveMethod()
Returns whether Torque will add save methods to the data objects. |
boolean |
isAddTimeStamp()
Returns whether Torque puts time stamps in generated om files. |
boolean |
isComplexObjectModel()
Returns whether Torque generates data objects with collection support and methods to easily retrieve foreign key relationships. |
boolean |
isCorrectGetters()
Returns whether Torque generates isXXX getter methods for boolean columns. |
boolean |
isEnableJava5Features()
Returns whether Java5 generics and iteration shorthand will be used in generated code. |
boolean |
isGenerateBeans()
Returns whether bean classes will be generated. |
boolean |
isObjectIsCaching()
Returns whether data objects cache their foreign key relationships. |
boolean |
isSilentDbFetch()
Returns whether Torque silently fetches foreign key relation collections if the collection is not yet initialized. |
boolean |
isUseManagers()
Returns whether Torque will generate Manager classes that use JCS for caching. |
void |
setAddGetByNameMethod(boolean addGetByNameMethod)
Sets whether Torque should add methods to get database fields by name/position. |
void |
setAddRetrievableInterface(boolean addRetrievableInterface)
Sets whether the data objects should implement an Retrievable interface. |
void |
setAddSaveMethod(boolean addSaveMethod)
Sets whether Torque should add save methods to the data objects. |
void |
setAddTimeStamp(boolean addTimeStamp)
Sets whether Torque puts time stamps in generated om files. |
void |
setBaseOutputDir(String baseOutputDir)
Sets where the sources for the persistence base classes will be generated. |
void |
setBasePrefix(String basePrefix)
Sets the prefix for the names of the base classes. |
void |
setBaseReportFile(String baseReportFile)
Sets the location where the report file for the base persistence classes will be generated. |
void |
setBeanExtendsClass(String beanExtendsClass)
Sets the optional fully qualified class name that the generated base bean classes will extend. |
void |
setBeanSuffix(String beanSuffix)
Sets the suffix for the names of the bean classes. |
void |
setComplexObjectModel(boolean complexObjectModel)
Sets whether Torque generates data objects with collection support and methods to easily retrieve foreign key relationships. |
void |
setCorrectGetters(boolean correctGetters)
Sets whether Torque generates isXXX getter methods for boolean columns. |
void |
setEnableJava5Features(boolean enableJava5Features)
Sets whether Java5 generics and iteration shorthand should be used in generated code. |
void |
setGenerateBeans(boolean generateBeans)
Sets whether bean classes should be generated. |
void |
setObjectIsCaching(boolean objectIsCaching)
Sets whether data objects cache their foreign key relationships. |
void |
setRetrievableInterface(String retrievableInterface)
Sets the fully qualified class name of the Retrievable interface which should be implemented by the generated data objects. |
void |
setSaveException(String saveException)
Sets the class name of the Exception which should be thrown by the save methods of the generated data objects. |
void |
setSilentDbFetch(boolean silentDbFetch)
Sets whether Torque should silently fetches foreign key relation collections if the collection is not yet initialized. |
void |
setSubpackageBase(String subpackageBase)
Sets the subpackage for the base Object, Peer, and Manager classes. |
void |
setSubpackageBaseBean(String subpackageBaseBean)
Sets the subpackage for the base bean classes. |
void |
setSubpackageBean(String subpackageBean)
Sets the subpackage for the bean classes. |
void |
setSubpackageManager(String subpackageManager)
Sets the subpackage for the manager classes. |
void |
setSubpackageMap(String subpackageMap)
Sets the subpackage for the database map classes. |
void |
setSubpackageObject(String subpackageObject)
Sets the subpackage for the data object classes. |
void |
setSubpackagePeer(String subpackagePeer)
Sets the subpackage for the peer classes. |
void |
setUseManagers(boolean useManagers)
Sets whether Torque should generate Manager classes that use JCS for caching. |
Methods inherited from class org.apache.torque.mojo.DataModelTaskMojo |
---|
configureTask, getReportFile, getSchemaDir, getSchemaExcludes, getSchemaIncludes, getSqlDbMap, getTargetDatabase, getTargetPackage, isRunOnlyOnSchemaChange, schemaChanged, setReportFile, setRunOnlyOnSchemaChange, setSchemaDir, setSchemaExcludes, setSchemaIncludes, setSqlDbMap, setTargetDatabase, setTargetPackage |
Methods inherited from class org.apache.torque.mojo.TexenTaskMojo |
---|
generateContextProperties, getAntProject, getContextPropertiesPath, getGeneratorTask, getOutputDir, getProject, getTemplatePath, getUseClasspath, getUserContextProperties, setContextPropertiesPath, setGeneratorTask, setOutputDir, setProject, setTemplatePath, setUseClasspath, setUserContextProperties |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TARGET_PACKAGE_CONTEXT_PROPERTY
public static final String BASE_PREFIX_CONTEXT_PROPERTY
public static final String BEAN_SUFFIX_CONTEXT_PROPERTY
public static final String BEAN_EXTENDS_CLASS_PROPERTY
public static final String SUBPACKAGE_MAP_CONTEXT_PROPERTY
public static final String SUBPACKAGE_BASE_CONTEXT_PROPERTY
public static final String SUBPACKAGE_BASE_BEAN_CONTEXT_PROPERTY
public static final String SUBPACKAGE_BEAN_CONTEXT_PROPERTY
public static final String SUBPACKAGE_MANAGER_CONTEXT_PROPERTY
public static final String SUBPACKAGE_OBJECT_CONTEXT_PROPERTY
public static final String SUBPACKAGE_PEER_CONTEXT_PROPERTY
public static final String ADD_GET_BY_NAME_METHOD_CONTEXT_PROPERTY
public static final String ADD_INTAKE_RETRIEVABLE_CONTEXT_PROPERTY
public static final String RETRIEVABLE_INTERFACE_CONTEXT_PROPERTY
public static final String ADD_SAVE_METHOD_CONTEXT_PROPERTY
public static final String SAVE_EXCEPTION_CONTEXT_PROPERTY
public static final String COMPLEX_OBJECT_MODEL_CONTEXT_PROPERTY
public static final String SILENT_DB_FETCH_CONTEXT_PROPERTY
public static final String USE_MANAGERS_CONTEXT_PROPERTY
public static final String OBJECT_IS_CACHING_CONTEXT_PROPERTY
public static final String CORRECT_GETTERS_CONTEXT_PROPERTY
public static final String ENABLE_JAVA_5_FEATURES_CONTEXT_PROPERTY
public static final String ADD_TIME_STAMP_CONTEXT_PROPERTY
public static final String GENERATE_BEANS_CONTEXT_PROPERTY
Constructor Detail |
---|
public OMMojo()
Method Detail |
---|
public void execute() throws org.apache.maven.plugin.MojoExecutionException
execute
in interface org.apache.maven.plugin.Mojo
execute
in class DataModelTaskMojo
org.apache.maven.plugin.MojoExecutionException
- If an error occurs during generation.TexenTaskMojo.execute()
,
Mojo.execute()
protected String getControlTemplate()
getControlTemplate
in class DataModelTaskMojo
protected org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
getMojoContextProperties
in class TexenTaskMojo
public String getBasePrefix()
public void setBasePrefix(String basePrefix)
basePrefix
- the prefix for the base classes.public String getBeanSuffix()
public void setBeanExtendsClass(String beanExtendsClass)
beanExtendsClass
- the fully qualified class or
null/"" if none is used.public String getBeanExtendsClass()
public void setBeanSuffix(String beanSuffix)
beanSuffix
- the suffix for the bean classes.public String getSubpackageMap()
public void setSubpackageMap(String subpackageMap)
subpackageMap
- the subpackage for the database map classes.public String getSubpackageBase()
public void setSubpackageBase(String subpackageBase)
subpackageBase
- the subpackage for the base Object, Peer,
and Manager classes.public String getSubpackageBaseBean()
public void setSubpackageBaseBean(String subpackageBaseBean)
subpackageBaseBean
- the subpackage for the base bean classes.public String getSubpackageBean()
public void setSubpackageBean(String subpackageBean)
subpackageBean
- the subpackage for the bean classes.public String getSubpackageManager()
public void setSubpackageManager(String subpackageManager)
subpackageManager
- the subpackage for the manager classes.public String getSubpackageObject()
public void setSubpackageObject(String subpackageObject)
subpackageObject
- the subpackage for the data object classes.public String getSubpackagePeer()
public void setSubpackagePeer(String subpackagePeer)
subpackagePeer
- the subpackage for the peer classes.public boolean isAddGetByNameMethod()
public void setAddGetByNameMethod(boolean addGetByNameMethod)
addGetByNameMethod
- whether Torque should add methods to get
database fields by name/position.public boolean isAddRetrievableInterface()
public void setAddRetrievableInterface(boolean addRetrievableInterface)
addRetrievableInterface
- whether the data objects should implement
a Retrievable interface.public boolean isAddSaveMethod()
public void setAddSaveMethod(boolean addSaveMethod)
addSaveMethod
- whether Torque should add save methods to the
data objects.public boolean isAddTimeStamp()
public void setAddTimeStamp(boolean addTimeStamp)
addTimeStamp
- whether Torque puts time stamps in generated
om files.public boolean isComplexObjectModel()
public void setComplexObjectModel(boolean complexObjectModel)
complexObjectModel
- whether Torque generates data objects
with collection support and methods to easily retrieve
foreign key relationships, false otherwise.public boolean isCorrectGetters()
public void setCorrectGetters(boolean correctGetters)
correctGetters
- true if Torque generates isXXX getter methods
for boolean columns, false if Torque generates getXXX getter
methods for boolean columns.public boolean isEnableJava5Features()
public void setEnableJava5Features(boolean enableJava5Features)
enableJava5Features
- true if Java5 generics and iteration
shorthand will be used in generated code, false to generate
1.4-compliant code.public boolean isGenerateBeans()
public void setGenerateBeans(boolean generateBeans)
generateBeans
- whether bean classes should be generated.public boolean isObjectIsCaching()
public void setObjectIsCaching(boolean objectIsCaching)
objectIsCaching
- true if data objects cache their
foreign key relationships, false otherwise.public String getRetrievableInterface()
public void setRetrievableInterface(String retrievableInterface)
retrievableInterface
- the fully qualified class name of the
Retrievable interface.public String getSaveException()
public void setSaveException(String saveException)
saveException
- the class name of the Exception
which should be thrown by the generated save methods.public boolean isSilentDbFetch()
public void setSilentDbFetch(boolean silentDbFetch)
silentDbFetch
- whether Torque should silently fetch
foreign key relation collections if the collection
is not yet initialized.public boolean isUseManagers()
public void setUseManagers(boolean useManagers)
useManagers
- whether Torque should generate Manager classes
that use JCS for caching.public String getBaseOutputDir()
public void setBaseOutputDir(String baseOutputDir)
baseOutputDir
- where the sources for the persistence base classes
will be generated.public String getBaseReportFile()
public void setBaseReportFile(String baseReportFile)
baseReportFile
- the location where the report file for the
base persistence classes will be generated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |