|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.map.ColumnMap
public class ColumnMap
ColumnMap is used to model a column of a table in a database.
Note that this information should be set via the
Constructor Summary | |
---|---|
ColumnMap(java.lang.String name,
TableMap containingTable)
Constructor. |
Method Summary | |
---|---|
void |
addInheritanceMap(InheritanceMap map)
Add an associated inheritance mapping. |
java.lang.String |
getColumnName()
Get the name of a column. |
java.lang.String |
getDefault()
A string representing the default value defined for this column. |
java.lang.String |
getDescription()
Returns the column description info. |
java.lang.String |
getFullyQualifiedName()
Get the table name + column name. |
java.lang.String |
getInheritance()
Gets the inheritance type used. |
InheritanceMap |
getInheritanceMap(java.lang.String key)
Get the inheritance map with the specified key. |
InheritanceMap[] |
getInheritanceMaps()
Get the inheritance information associated with this column, |
java.lang.String |
getInputValidator()
Returns the input validator class name. |
java.lang.String |
getJavaName()
Gets the Java Name for this column as defined in XML or created by generator code. |
java.lang.String |
getJavaNamingMethod()
Returns the Java naming method for this column. |
java.lang.String |
getJavaType()
Returns the java type of this column. |
int |
getPosition()
Returns the position (one based) of this column in the table. |
java.lang.String |
getRelatedColumnName()
Get the column name that this column is related to. |
java.lang.String |
getRelatedName()
Get the table.column that this column is related to. |
java.lang.String |
getRelatedTableName()
Get the table name that this column is related to. |
int |
getScale()
Gets the scale set for this column (if any) as set in the XML database definition. |
int |
getSize()
The "precision" value from the XML size="<precision>[,<scale>]" attribute. |
TableMap |
getTable()
Returns the map for the table this column belongs to. |
java.lang.String |
getTableName()
Get the name of the table this column is in. |
java.lang.String |
getTorqueType()
Get the name of the Torque type of this column. |
java.lang.Object |
getType()
Get the type of this column. |
boolean |
isAutoIncrement()
Returns whether this column is an autoincrement column. |
boolean |
isForeignKey()
Is this column a foreign key? |
boolean |
isNotNull()
Is null value allowed ? |
boolean |
isPk()
Returns whether this column is a primary key. |
boolean |
isPrimaryKey()
Is this column a primary key? |
boolean |
isProtected()
Returns whether getters and setters are generated with the access modifier "protected" rather than "public". |
boolean |
isUseInheritance()
Returns whether this column uses inheritance subclasses. |
boolean |
isUsePrimitive()
Returns whether this colum uses primitive values rather than objects. |
protected java.lang.String |
normalizeName(java.lang.String name)
Makes sure that the column names don't include table prefixes. |
void |
setAutoIncrement(boolean autoIncrement)
Sets whether this column is an autoincrement column. |
void |
setDefault(java.lang.String defaultValue)
Sets the default value for this column. |
void |
setDescription(java.lang.String description)
Sets the description for this column. |
void |
setForeignKey(java.lang.String fullyQualifiedName)
Set the foreign key for this column. |
void |
setForeignKey(java.lang.String tableName,
java.lang.String columnName)
Set the foreign key for this column. |
void |
setInheritance(java.lang.String inheritanceType)
Sets the inheritance type. |
void |
setInputValidator(java.lang.String inputValidator)
Sets the input validator class name. |
void |
setJavaName(java.lang.String name)
Sets the Java Name for this column. |
void |
setJavaNamingMethod(java.lang.String javaNamingMethod)
Sets the java naming method for this column. |
void |
setJavaType(java.lang.String javaType)
Sets the java type of this column. |
void |
setNotNull(boolean nn)
Set if this column may be null. |
void |
setPk(boolean pk)
Sets whether this column is a primary key. |
void |
setPosition(int position)
Sets the position (one based) of this column in the table. |
void |
setPrimaryKey(boolean pk)
Set if this column is a primary key or not. |
void |
setProtected(boolean isProtected)
Sets whether getters and setters should be generated with the access modifier "protected" rather than "public". |
void |
setScale(int scale)
|
void |
setSize(int size)
Set the size of this column. |
void |
setTorqueType(java.lang.String torqueType)
Set the Torque type of this column. |
void |
setType(java.lang.Object type)
Set the type of this column. |
void |
setUseInheritance(boolean useInheritance)
Sets whether this column uses inheritance subclasses. |
void |
setUsePrimitive(boolean usePrimitive)
Sets whether this colum uses primitive values rather than objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColumnMap(java.lang.String name, TableMap containingTable)
name
- The name of the column.containingTable
- TableMap of the table this column is in.Method Detail |
---|
protected java.lang.String normalizeName(java.lang.String name)
name
- The name to check
public java.lang.String getColumnName()
public java.lang.String getFullyQualifiedName()
public java.lang.String getTableName()
public void setType(java.lang.Object type)
type
- An Object specifying the type.public void setTorqueType(java.lang.String torqueType)
torqueType
- the Torque type of the column.public void setSize(int size)
size
- An int specifying the size.public void setPrimaryKey(boolean pk)
pk
- True if column is a primary key.public void setNotNull(boolean nn)
nn
- True if column may be null.public void setForeignKey(java.lang.String fullyQualifiedName)
fullyQualifiedName
- The name of the table.column that is
foreign.public void setForeignKey(java.lang.String tableName, java.lang.String columnName)
tableName
- The name of the table that is foreign.columnName
- The name of the column that is foreign.public java.lang.Object getType()
public java.lang.String getTorqueType()
public int getSize()
Note that the size="P,S" format should be replaced with size="P" scale="S".
public boolean isPrimaryKey()
public boolean isNotNull()
public boolean isForeignKey()
public java.lang.String getRelatedName()
public java.lang.String getRelatedTableName()
public java.lang.String getRelatedColumnName()
public int getScale()
public void setScale(int scale)
scale
- The scale to set.public java.lang.String getJavaName()
public void setJavaName(java.lang.String name)
name
- the Java Name.public boolean isAutoIncrement()
public void setAutoIncrement(boolean autoIncrement)
autoIncrement
- whether this colimn is an autoincrement column.public java.lang.String getDefault()
public void setDefault(java.lang.String defaultValue)
defaultValue
- The defaultValue to set.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- The description to set.public InheritanceMap[] getInheritanceMaps()
public void addInheritanceMap(InheritanceMap map)
map
- The inheritanceMap to associate with this column.public java.lang.String getInheritance()
public void setInheritance(java.lang.String inheritanceType)
inheritanceType
- The inheritance type to set.public java.lang.String getInputValidator()
public void setInputValidator(java.lang.String inputValidator)
inputValidator
- The inputValidator to set.public boolean isProtected()
public void setProtected(boolean isProtected)
isProtected
- whether getters and setters for this column
are protected.public boolean isPk()
public void setPk(boolean pk)
pk
- whether this column is a primary key.public boolean isUseInheritance()
public void setUseInheritance(boolean useInheritance)
useInheritance
- whether this column uses Inheritance subclasses.public InheritanceMap getInheritanceMap(java.lang.String key)
key
- the key of the inheritance map.
public boolean isUsePrimitive()
public void setUsePrimitive(boolean usePrimitive)
usePrimitive
- whether primitive objects are used
rather than objects.public java.lang.String getJavaNamingMethod()
public void setJavaNamingMethod(java.lang.String javaNamingMethod)
javaNamingMethod
- The javaNamingMethod to set.public TableMap getTable()
public int getPosition()
public void setPosition(int position)
position
- The position to set.public java.lang.String getJavaType()
public void setJavaType(java.lang.String javaType)
javaType
- The javaType to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |