javax.rad.persist
Class ColumnMetaData

java.lang.Object
  extended by javax.rad.persist.ColumnMetaData
All Implemented Interfaces:
Serializable, Cloneable

public class ColumnMetaData
extends Object
implements Serializable, Cloneable

A ColumnMetaData is a description of the data type and other attributes of a table storage column. (persists on server)

See Also:
IDataType, Serialized Form

Constructor Summary
ColumnMetaData()
          Constructs a ColumnMetaData with defaults.
ColumnMetaData(String pName)
          Constructs a ColumnMetaData with a specific name.
ColumnMetaData(String pName, int pDataTypeIdentifier)
          Constructs a ColumnMetaData with a specific name and data type identifier.
 
Method Summary
 ColumnMetaData clone()
          
static ColumnDefinition createColumnDefinition(ColumnMetaData pColumnMetaData)
          It converts a server ColumnMetaData to an client ColumnDefinition and returns it.
static ColumnMetaData createColumnMetaData(ColumnDefinition pColumnDefinition)
          It returns the ColumnMetaData to the corresponding ColumnDefinition.
static IDataType createDataType(ColumnMetaData pColumnMetaData)
          It creates the corresponding IDataType to the meta data column.
 boolean equals(Object pObject)
          
 Object[] getAllowedValues()
          Gets the allowed values for this column.
 int getDataType()
          Returns the used data type for this ColumnMetaData.
static String getDefaultLabel(String pName)
          It returns an default label for the pName.
 Object getDefaultValue()
          Gets the default value of this column.
 String getLabel()
          Returns the default label.
 StorageReferenceDefinition getLinkReference()
          Returns the link reference for a server side dropdown list (automatic linked celleditor).
 String getName()
          Returns the column name.
 int getPrecision()
          Returns the precision/size of this column.
 int getScale()
          Returns the scale of this column.
 int hashCode()
          
 boolean isAutoIncrement()
          Returns true if this ColumnMetaData is an auto increment column.
 boolean isNullable()
          Returns true if values in this column may be null.
 boolean isSigned()
          Returns if this ColumnMetaData is signed.
 boolean isWritable()
          Returns whether this column is writeable.
 void setAllowedValues(Object[] pValues)
          Sets the allowed values for this column.
 void setAutoIncrement(boolean autoIncrement)
          Sets if this ColumnMetaData is an auto increment column.
 void setDataType(int pDataTypeIdentifier)
          Sets the used data type for this ColumnMetaData.
 void setDefaultValue(Object pValue)
          Sets the default value of this column.
 void setLabel(String pLabel)
          Sets default label.
 void setLinkReference(StorageReferenceDefinition pLinkReference)
          Sets the link reference for an server side Dropdown list (automatic linked celleditor).
 void setName(String pName)
          Set the name of the column.
 void setNullable(boolean pNullable)
          Sets whether values in this column may be null.
 void setPrecision(int pPrecision)
          Sets the precision/size of this column.
 void setScale(int pScale)
          Sets the scale of this column.
 void setSigned(boolean pSigned)
          Sets if this ColumnMetaData is signed.
 void setWritable(boolean pWriteable)
          Sets whether this column is writeable.
 String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnMetaData

public ColumnMetaData()
Constructs a ColumnMetaData with defaults.


ColumnMetaData

public ColumnMetaData(String pName)
Constructs a ColumnMetaData with a specific name.

Parameters:
pName - the column name

ColumnMetaData

public ColumnMetaData(String pName,
                      int pDataTypeIdentifier)
Constructs a ColumnMetaData with a specific name and data type identifier.

Parameters:
pName - the column name
pDataTypeIdentifier - the data type identifier
Method Detail

toString

public String toString()

Overrides:
toString in class Object

clone

public ColumnMetaData clone()

Overrides:
clone in class Object

equals

public boolean equals(Object pObject)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

setName

public void setName(String pName)
Set the name of the column.

Parameters:
pName - column name

getName

public String getName()
Returns the column name.

Returns:
the column name

getLabel

public String getLabel()
Returns the default label.

Returns:
the default label.

setLabel

public void setLabel(String pLabel)
Sets default label.

Parameters:
pLabel - the default label. to set

setDataType

public void setDataType(int pDataTypeIdentifier)
Sets the used data type for this ColumnMetaData.

Parameters:
pDataTypeIdentifier - the data type identifier for this ColumnMetaData.

getDataType

public int getDataType()
Returns the used data type for this ColumnMetaData.

Returns:
the data type identifier for this ColumnMetaData.

setNullable

public void setNullable(boolean pNullable)
Sets whether values in this column may be null.

Parameters:
pNullable - true if values in this column may be null.

isNullable

public boolean isNullable()
Returns true if values in this column may be null.

Returns:
true if values in this column may be null.

getPrecision

public int getPrecision()
Returns the precision/size of this column.

Returns:
the precision/size of this column.

setPrecision

public void setPrecision(int pPrecision)
Sets the precision/size of this column.

Parameters:
pPrecision - the precision/size of this column.

getScale

public int getScale()
Returns the scale of this column.

Returns:
the scale of this column.

setScale

public void setScale(int pScale)
Sets the scale of this column.

Parameters:
pScale - the scale of this column.

setWritable

public void setWritable(boolean pWriteable)
Sets whether this column is writeable.

Parameters:
pWriteable - true if column is writeable.

isWritable

public boolean isWritable()
Returns whether this column is writeable.

Returns:
true if column is writeable.

isSigned

public boolean isSigned()
Returns if this ColumnMetaData is signed.

Returns:
if this ColumnMetaData is signed.

setSigned

public void setSigned(boolean pSigned)
Sets if this ColumnMetaData is signed.

Parameters:
pSigned - true, if signed.

isAutoIncrement

public boolean isAutoIncrement()
Returns true if this ColumnMetaData is an auto increment column.

Returns:
true if this ColumnMetaData is an auto increment column.

setAutoIncrement

public void setAutoIncrement(boolean autoIncrement)
Sets if this ColumnMetaData is an auto increment column.

Parameters:
autoIncrement - the bAutoIncrement to set

getLinkReference

public StorageReferenceDefinition getLinkReference()
Returns the link reference for a server side dropdown list (automatic linked celleditor).

Returns:
the link reference for an server side dropdown list (automatic linked celleditor).

setLinkReference

public void setLinkReference(StorageReferenceDefinition pLinkReference)
Sets the link reference for an server side Dropdown list (automatic linked celleditor).

Parameters:
pLinkReference - the link reference to set

createColumnDefinition

public static ColumnDefinition createColumnDefinition(ColumnMetaData pColumnMetaData)
                                               throws ModelException
It converts a server ColumnMetaData to an client ColumnDefinition and returns it.

Parameters:
pColumnMetaData - the server column meta data to convert.
Returns:
the ColumnDefinition for the ColumnMetaData.
Throws:
ModelException - if the ColumnDefintion couldn't created

createDataType

public static IDataType createDataType(ColumnMetaData pColumnMetaData)
It creates the corresponding IDataType to the meta data column.

Parameters:
pColumnMetaData - the MetaDataColumn to use.
Returns:
to the meta data column the corresponding IDataType.

createColumnMetaData

public static ColumnMetaData createColumnMetaData(ColumnDefinition pColumnDefinition)
It returns the ColumnMetaData to the corresponding ColumnDefinition.

Parameters:
pColumnDefinition - the ColumnDefinition to use.
Returns:
the ColumnMetaData to the corresponding ColumnDefinition.

getDefaultLabel

public static String getDefaultLabel(String pName)
It returns an default label for the pName.

Parameters:
pName - the Column Name to use.
Returns:
the default column label

setDefaultValue

public void setDefaultValue(Object pValue)
Sets the default value of this column.

Parameters:
pValue - the default value

getDefaultValue

public Object getDefaultValue()
Gets the default value of this column.

Returns:
the default value or null if the column has no default value

setAllowedValues

public void setAllowedValues(Object[] pValues)
Sets the allowed values for this column.

Parameters:
pValues - the allowed values or null when any value is allowed

getAllowedValues

public Object[] getAllowedValues()
Gets the allowed values for this column.

Returns:
an Object[] with values, possible for the column.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.