javax.rad.persist
Class ColumnMetaData

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

public class ColumnMetaData
extends java.lang.Object
implements java.io.Serializable, java.lang.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

Field Summary
protected  IDataType cachedDataType
          Cached data type for performance.
 
Constructor Summary
ColumnMetaData()
          Constructs a ColumnMetaData with defaults.
ColumnMetaData(java.lang.String pName)
          Constructs a ColumnMetaData with a specific name.
ColumnMetaData(java.lang.String pName, int pTypeIdentifier)
          Constructs a ColumnMetaData with a specific name and data type identifier.
 
Method Summary
 ColumnMetaData clone()
          
 ColumnDefinition createColumnDefinition()
          It converts a server ColumnMetaData to an client ColumnDefinition and returns it.
 IDataType createDataType()
          It creates the corresponding IDataType to the meta data column.
 boolean equals(java.lang.Object pObject)
          
 java.lang.Object[] getAllowedValues()
          Gets the allowed values for this column.
 IDataType getDataType()
          It gets the corresponding IDataType to the meta data column.
static java.lang.String getDefaultLabel(java.lang.String pName)
          It returns an default label for the pName.
 java.lang.Object getDefaultValue()
          Gets the default value of this column.
 java.lang.String getLabel()
          Returns the default label.
 StorageReferenceDefinition getLinkReference()
          Returns the link reference for a server side dropdown list (automatic linked celleditor).
 java.lang.String getName()
          Returns the column name.
 int getPrecision()
          Returns the precision/size of this column.
 int getScale()
          Returns the scale of this column.
 int getTypeIdentifier()
          Returns the used data type for this ColumnMetaData.
 int hashCode()
          
protected  ColumnDefinition initializeColumnDefinition(ColumnDefinition pColumnDefinition)
          Initializes the ColumnDefinition with the given ColumnMetaData.
 boolean isAutoIncrement()
          Returns true if this ColumnMetaData is an auto increment column.
 boolean isCalculated()
          Returns whether this column is calculated.
 boolean isFetchLargeObjectsLazy()
          If large objects in this column should be lazily fetched, meaning that they are only send to the client if the client actually requests that very value.
 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(java.lang.Object[] pValues)
          Sets the allowed values for this column.
 void setAutoIncrement(boolean autoIncrement)
          Sets if this ColumnMetaData is an auto increment column.
 void setCalculated(boolean pCalculated)
          Sets whether this column is calculated.
 void setDefaultValue(java.lang.Object pValue)
          Sets the default value of this column.
 void setFetchLargeObjectsLazy(boolean pFetchLargeObjectsLazy)
          Sets if large objects in this column should be lazily fetched, meaning that they are only send to the client if the client actually requests that very value.
 void setLabel(java.lang.String pLabel)
          Sets default label.
 void setLinkReference(StorageReferenceDefinition pLinkReference)
          Sets the link reference for an server side Dropdown list (automatic linked celleditor).
 void setName(java.lang.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 setTypeIdentifier(int pTypeIdentifier)
          Sets the used data type for this ColumnMetaData.
 void setWritable(boolean pWriteable)
          Sets whether this column is writeable.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cachedDataType

protected IDataType cachedDataType
Cached data type for performance.

Constructor Detail

ColumnMetaData

public ColumnMetaData()
Constructs a ColumnMetaData with defaults.


ColumnMetaData

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

Parameters:
pName - the column name

ColumnMetaData

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

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

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

clone

public ColumnMetaData clone()

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object pObject)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

setName

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

Parameters:
pName - column name

getName

public java.lang.String getName()
Returns the column name.

Returns:
the column name

getLabel

public java.lang.String getLabel()
Returns the default label.

Returns:
the default label.

setLabel

public void setLabel(java.lang.String pLabel)
Sets default label.

Parameters:
pLabel - the default label. to set

isFetchLargeObjectsLazy

public boolean isFetchLargeObjectsLazy()
If large objects in this column should be lazily fetched, meaning that they are only send to the client if the client actually requests that very value. The definition of "large object" is a matter of implementation of the data access class, and so is if this property is honored or not.

Returns:
true if large objects should be fetched lazy.

setFetchLargeObjectsLazy

public void setFetchLargeObjectsLazy(boolean pFetchLargeObjectsLazy)
Sets if large objects in this column should be lazily fetched, meaning that they are only send to the client if the client actually requests that very value. The definition of "large object" is a matter of implementation of the data access class, and so is if this property is honored or not.

Parameters:
pFetchLargeObjectsLazy - true if large objects should be fetched lazy.

setTypeIdentifier

public void setTypeIdentifier(int pTypeIdentifier)
Sets the used data type for this ColumnMetaData.

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

getTypeIdentifier

public int getTypeIdentifier()
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.

setCalculated

public void setCalculated(boolean pCalculated)
Sets whether this column is calculated.

Parameters:
pCalculated - true if column is calculated.

isCalculated

public boolean isCalculated()
Returns whether this column is calculated.

Returns:
true if column is calculated.

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 ColumnDefinition createColumnDefinition()
                                        throws ModelException
It converts a server ColumnMetaData to an client ColumnDefinition and returns it.

Returns:
the ColumnDefinition for the ColumnMetaData.
Throws:
ModelException - if the ColumnDefintion couldn't created

initializeColumnDefinition

protected ColumnDefinition initializeColumnDefinition(ColumnDefinition pColumnDefinition)
                                               throws ModelException
Initializes the ColumnDefinition with the given ColumnMetaData.

Parameters:
pColumnDefinition - the ColumnDefinition to use.
Returns:
ColumnDefinition the result column definition
Throws:
ModelException - if the ColumnDefintion couldn't created

getDataType

public IDataType getDataType()
It gets the corresponding IDataType to the meta data column.

Returns:
to the meta data column the corresponding IDataType.

createDataType

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

Returns:
to the meta data column the corresponding IDataType.

getDefaultLabel

public static java.lang.String getDefaultLabel(java.lang.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(java.lang.Object pValue)
Sets the default value of this column.

Parameters:
pValue - the default value

getDefaultValue

public java.lang.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(java.lang.Object[] pValues)
Sets the allowed values for this column.

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

getAllowedValues

public java.lang.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.