|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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(String name,
TableMap containingTable)
Constructor. |
Method Summary | |
---|---|
void |
addInheritanceMap(InheritanceMap map)
Add an associated inheritance mapping. |
String |
getColumnName()
Get the name of a column. |
String |
getDefault()
A string representing the default value defined for this column. |
String |
getDescription()
Returns the column description info. |
String |
getFullTableName()
Get the name of the table this column is in. |
String |
getFullyQualifiedName()
Deprecated. use getSqlExpression() instead. |
String |
getInheritance()
Gets the inheritance type used. |
InheritanceMap |
getInheritanceMap(String key)
Get the inheritance map with the specified key. |
InheritanceMap[] |
getInheritanceMaps()
Get the inheritance information associated with this column, |
String |
getJavaName()
Gets the Java Name for this column as defined in XML or created by generator code. |
String |
getJavaNamingMethod()
Returns the Java naming method for this column. |
String |
getJavaType()
Returns the java type of this column. |
String |
getOption(String key)
Returns the value of an option. |
Map<String,String> |
getOptions()
Returns an unmodifiable map of all options. |
int |
getPosition()
Returns the position (one based) of this column in the table. |
int |
getScale()
Gets the scale set for this column (if any) as set in the XML database definition. |
String |
getSchemaName()
Get the name of the schema of the table this column is in. |
int |
getSize()
The "precision" value from the XML size="<precision>[,<scale>]" attribute. |
String |
getSqlExpression()
Returns the SQL expression for the fully qualified column name. |
TableMap |
getTable()
Returns the map for the table this column belongs to. |
String |
getTableName()
Get the name of the table this column is in. |
String |
getTorqueType()
Get the name of the Torque type of this column. |
Object |
getType()
Get the type of this column. |
boolean |
isAutoIncrement()
Returns whether this column is an autoincrement column. |
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 String |
normalizeName(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(String defaultValue)
Sets the default value for this column. |
void |
setDescription(String description)
Sets the description for this column. |
void |
setInheritance(String inheritanceType)
Sets the inheritance type. |
void |
setJavaName(String name)
Sets the Java Name for this column. |
void |
setJavaNamingMethod(String javaNamingMethod)
Sets the java naming method for this column. |
void |
setJavaType(String javaType)
Sets the java type of this column. |
void |
setNotNull(boolean nn)
Set if this column may be null. |
void |
setOption(String key,
String value)
Sets an option. |
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(String torqueType)
Set the Torque type of this column. |
void |
setType(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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ColumnMap(String name, TableMap containingTable)
name
- The name of the column.containingTable
- TableMap of the table this column is in.Method Detail |
---|
protected String normalizeName(String name)
name
- The name to check
public String getColumnName()
getColumnName
in interface Column
@Deprecated public String getFullyQualifiedName()
public String getTableName()
getTableName
in interface Column
public String getFullTableName()
getFullTableName
in interface Column
public String getSchemaName()
getSchemaName
in interface Column
public void setType(Object type)
type
- An Object specifying the type.public void setTorqueType(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 Object getType()
public 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 int getScale()
public void setScale(int scale)
scale
- The scale to set.public String getJavaName()
public void setJavaName(String name)
name
- the Java Name.public boolean isAutoIncrement()
public void setAutoIncrement(boolean autoIncrement)
autoIncrement
- whether this colimn is an autoincrement column.public String getDefault()
public void setDefault(String defaultValue)
defaultValue
- The defaultValue to set.public String getDescription()
public void setDescription(String description)
description
- The description to set.public InheritanceMap[] getInheritanceMaps()
public void addInheritanceMap(InheritanceMap map)
map
- The inheritanceMap to associate with this column.public String getInheritance()
public void setInheritance(String inheritanceType)
inheritanceType
- The inheritance type 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(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 String getJavaNamingMethod()
public void setJavaNamingMethod(String javaNamingMethod)
javaNamingMethod
- The javaNamingMethod to set.public TableMap getTable()
public int getPosition()
public void setPosition(int position)
position
- The position to set.public String getJavaType()
public void setJavaType(String javaType)
javaType
- The javaType to set.public Map<String,String> getOptions()
public void setOption(String key, String value)
key
- the key of the optionvalue
- the value of the option.public String getOption(String key)
key
- the key of the option.
public String getSqlExpression()
getSqlExpression
in interface Column
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |