|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.armax.ax.devtools.uml.AXmodelChecker
de.armax.ax.devtools.generator.AXojbHelper
Helper class for generation of OJB or Hibernate related code with AXgen
.
This class is configured via the "ojbhelper.properties" file which must be located on the classpath
This class serves also as a model checker (see AXmodelChecker
and
AXgenCheck
) to check a model prior to code generation. It delegates
model checker calls to an instance of AXdefaultModelChecker
.
See the example properties file for configuration details
Field Summary |
Fields inherited from class de.armax.ax.devtools.uml.AXmodelChecker |
RESULT_ERRORS, RESULT_OK, RESULT_WARNINGS |
Method Summary | |
void |
addModelCheckerListener(AXmodelCheckerListener listener)
|
int |
check(AXmodel model)
AXmodelChecker method delegated to AXdefaultModelChecker . |
AXattribute |
getAccessibleAttributeByName(AXclass clasz,
java.lang.String name,
boolean excludeImplemented)
|
java.lang.String |
getAll1ToNAssocsListString(AXclass clasz)
|
java.lang.String |
getAllAttributesListString(AXclass clasz)
|
java.lang.String |
getAllMToNAssocsListString(AXclass clasz)
|
java.lang.String |
getAllXTo1AssocsListString(AXclass clasz)
|
java.lang.String |
getAllXToNAssocsListString(AXclass clasz)
|
java.lang.String |
getCascadeType(AXassociation assoc)
Get the hibernate cascade type (none, delete, autoupdate or all). |
java.lang.String |
getColumnPrefix(AXclass cls)
Get the column prefix for a given class. |
java.lang.String |
getConversionAttribute(AXassociation assoc)
This convenience method returns the XML attribute for OJB type conversion (conversion="foo.bar.FooToBarFieldConversion") preceded by a single blank. |
java.lang.String |
getConversionAttribute(AXattribute attribute)
This convenience method returns the XML attribute for OJB type conversion (conversion="foo.bar.FooToBarFieldConversion") preceded by a single blank. |
java.lang.String |
getConversionClassName(AXassociation assoc)
Looks up the conversion class in the properties file. |
java.lang.String |
getConversionClassName(AXattribute attribute)
Looks up the conversion class in the properties file. |
java.lang.String |
getDbColumn(AXattribute attrib)
Get the db column for a given attribute. |
java.lang.String |
getDbColumn(AXclass owner,
java.lang.String attributeName)
Get the db column for an attribute specified by its name and the owning class. |
java.lang.String |
getDbType(AXassociation assoc)
Get the db-type for the given assoc The type defaults to java.lang.String, the length defaults to 50 |
java.lang.String |
getDbType(AXattribute attrib)
Get the db-type for the given attribute Length defaults to 50 |
java.lang.String |
getDbType(java.lang.String type,
int length)
Get the db type for the given type This method tries first to find a db type for the specified type directly. |
int |
getErrorCount()
AXmodelChecker method delegated to AXdefaultModelChecker . |
java.lang.String |
getHibernateType(AXattribute attribute)
Get the hibernate type for a given attribute. |
java.lang.String |
getHibernateType(java.lang.String type)
Get the hibernate type for a given java type. |
static AXojbHelper |
getInstance()
|
java.lang.String |
getJdbcType(AXassociation assoc)
|
java.lang.String |
getJdbcType(AXattribute attribute)
|
java.lang.String |
getJdbcType(java.lang.String type)
This method first looks for a JDBC type mapping in the properties. |
java.lang.String |
getMaxValue(AXattribute attribute)
|
java.lang.String |
getMinValue(AXattribute attribute)
|
java.lang.String |
getNamespaceName(ru.novosoft.uml.foundation.core.MNamespace namespace)
|
java.lang.String |
getSqlAdditionalCommand()
Returns the value of the property "additioanl.sql.command" followed by a new line character if such a property exists. |
java.lang.String |
getSqlCommandlineEnd()
|
java.lang.String |
getSqlCreateMiddlefix()
Returns the SQL create middlefix looked up in the properties file if it exists (followed by a single blank). |
java.lang.String |
getSufficientlyQualifiedCasted(AXclassifier type,
AXclass reference,
java.lang.String value)
|
java.lang.String |
getTimestamp()
|
java.lang.String |
getUser()
|
int |
getWarningCount()
AXmodelChecker method delegated to AXdefaultModelChecker . |
java.lang.String |
getWrappedVariable(AXclassifier type,
java.lang.String value)
|
boolean |
hasMinMaxValues(AXattribute attribute)
|
boolean |
isWithoutLock()
Returns true if an attribute without.lock exists and its value is "true" |
void |
removeModelCheckerListener(AXmodelCheckerListener listener)
|
Methods inherited from class de.armax.ax.devtools.uml.AXmodelChecker |
fireErrorEvent, fireFinishedEvent, fireWarningEvent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static AXojbHelper getInstance()
public java.lang.String getTimestamp()
public java.lang.String getUser()
public AXattribute getAccessibleAttributeByName(AXclass clasz, java.lang.String name, boolean excludeImplemented)
public java.lang.String getWrappedVariable(AXclassifier type, java.lang.String value)
public java.lang.String getSufficientlyQualifiedCasted(AXclassifier type, AXclass reference, java.lang.String value)
public java.lang.String getJdbcType(AXassociation assoc)
public java.lang.String getJdbcType(AXattribute attribute)
public java.lang.String getJdbcType(java.lang.String type)
This method first looks for a JDBC type mapping in the properties. If no corresponding mapping is found, the default JDBC types for the native types, their Wrapper classes and the java.sql.Date, java.sql.Time and java.sql.Timestamp classes are used.
type
-
java.lang.IllegalArgumentException
- if no mapping can be foundpublic boolean hasMinMaxValues(AXattribute attribute)
public java.lang.String getMinValue(AXattribute attribute)
public java.lang.String getMaxValue(AXattribute attribute)
public java.lang.String getSqlAdditionalCommand()
Returns the value of the property "additioanl.sql.command" followed by a new line character if such a property exists. Otherwise an empty String is returned
public java.lang.String getSqlCommandlineEnd()
public java.lang.String getSqlCreateMiddlefix()
Returns the SQL create middlefix looked up in the properties file if it exists (followed by a single blank).
If the property does not exist, an empty String is returned.
public java.lang.String getDbType(AXassociation assoc)
Get the db-type for the given assoc
The type defaults to java.lang.String, the length defaults to 50
assoc
- public java.lang.String getDbType(AXattribute attrib)
Get the db-type for the given attribute
Length defaults to 50
attrib
- public java.lang.String getDbType(java.lang.String type, int length)
Get the db type for the given type
This method tries first to find a db type for the specified type directly. If this fails, it tries to get a db type for the corresponding JDBC type. If this fails too, the corresponding JDBC type is returned
type
- length
-
java.lang.IllegalArgumentException
- if no db type is found and type can not be converted
to a JDBC type.public java.lang.String getConversionAttribute(AXattribute attribute)
This convenience method returns the XML attribute for OJB type conversion
(conversion="foo.bar.FooToBarFieldConversion") preceded by a single blank.
if the conversion class name returned by getConversionClassName(AXattribute)
is not
null. Otherwise it returns an empty String
attribute
- public java.lang.String getConversionAttribute(AXassociation assoc)
This convenience method returns the XML attribute for OJB type conversion
(conversion="foo.bar.FooToBarFieldConversion") preceded by a single blank.
if the conversion class name returned by getConversionClassName(AXassociation)
is not
null. Otherwise it returns an empty String
assoc
- public java.lang.String getConversionClassName(AXattribute attribute)
Looks up the conversion class in the properties file.
public java.lang.String getConversionClassName(AXassociation assoc)
Looks up the conversion class in the properties file.
assoc
- public boolean isWithoutLock()
Returns true if an attribute without.lock exists and its value is "true"
public java.lang.String getNamespaceName(ru.novosoft.uml.foundation.core.MNamespace namespace)
public java.lang.String getHibernateType(AXattribute attribute)
Get the hibernate type for a given attribute.
attribute
- public java.lang.String getHibernateType(java.lang.String type)
Get the hibernate type for a given java type.
type
- public java.lang.String getCascadeType(AXassociation assoc)
Get the hibernate cascade type (none, delete, autoupdate or all).
assoc
- public java.lang.String getColumnPrefix(AXclass cls)
Get the column prefix for a given class.
cls
- public java.lang.String getDbColumn(AXattribute attrib)
Get the db column for a given attribute.
attrib
- public java.lang.String getDbColumn(AXclass owner, java.lang.String attributeName)
Get the db column for an attribute specified by its name and the owning class.
owner
- attributeName
- public int check(AXmodel model)
AXmodelChecker method delegated to AXdefaultModelChecker
.
check
in class AXmodelChecker
public int getErrorCount()
AXmodelChecker method delegated to AXdefaultModelChecker
.
getErrorCount
in class AXmodelChecker
public int getWarningCount()
AXmodelChecker method delegated to AXdefaultModelChecker
.
getWarningCount
in class AXmodelChecker
public void addModelCheckerListener(AXmodelCheckerListener listener)
addModelCheckerListener
in class AXmodelChecker
public void removeModelCheckerListener(AXmodelCheckerListener listener)
removeModelCheckerListener
in class AXmodelChecker
public java.lang.String getAllAttributesListString(AXclass clasz)
public java.lang.String getAllMToNAssocsListString(AXclass clasz)
public java.lang.String getAll1ToNAssocsListString(AXclass clasz)
public java.lang.String getAllXToNAssocsListString(AXclass clasz)
public java.lang.String getAllXTo1AssocsListString(AXclass clasz)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |