org.datanucleus.metadata
Class ColumnMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.ColumnMetaData
All Implemented Interfaces:
java.io.Serializable

public class ColumnMetaData
extends MetaData

Representation of the Meta-Data for a column mapping of a field.

See Also:
Serialized Form

Field Summary
protected  java.lang.Boolean allowsNull
          Whether the column accepts nulls.
protected  java.lang.String columnDdl
          Optional column DDL appended to the column definition defined by DataNucleus.
protected  java.lang.String defaultValue
          Default value for the column (when constructing the table with this column).
protected  boolean insertable
          Whether this column is to be inserted when the owning object is inserted.
protected  java.lang.String insertValue
          value to use when inserting this column in the datastore (the column is not mapped to a field/property)
protected  java.lang.String jdbcType
          jdbc-type to use (if any).
protected  java.lang.Integer length
          length to use (if any).
protected  java.lang.String name
          column name.
protected  java.lang.Integer position
          Column position for the table as a whole (0-origin).
protected  java.lang.Integer scale
          scale to use (if any).
protected  java.lang.String sqlType
          sql-type to use (if any).
protected  java.lang.String target
          target column name (for matching across a FK).
protected  java.lang.String targetMember
          target field/property name (for matching across a FK).
protected  boolean unique
          unique tag value.
protected  boolean updateable
          Whether this column can be updated when the owning object is updated.
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
ColumnMetaData()
          Default constructor.
ColumnMetaData(ColumnMetaData colmd)
          Creates a ColumnMetaData by copying contents from colmd.
 
Method Summary
 java.lang.Boolean getAllowsNull()
           
 java.lang.String getColumnDdl()
           
 java.lang.String getDefaultValue()
           
 boolean getInsertable()
           
 java.lang.String getInsertValue()
           
 java.lang.String getJdbcType()
           
 java.lang.Integer getLength()
           
 java.lang.String getName()
           
 java.lang.Integer getPosition()
           
 java.lang.Integer getScale()
           
 java.lang.String getSqlType()
           
 java.lang.String getTarget()
           
 java.lang.String getTargetMember()
           
 boolean getUnique()
           
 boolean getUpdateable()
           
 boolean isAllowsNull()
           
 ColumnMetaData setAllowsNull(java.lang.Boolean allowsNull)
           
 ColumnMetaData setAllowsNull(java.lang.String allowsNull)
           
 void setColumnDdl(java.lang.String columnDdl)
           
 ColumnMetaData setDefaultValue(java.lang.String defaultValue)
           
 ColumnMetaData setInsertable(boolean insertable)
           
 ColumnMetaData setInsertable(java.lang.String insertable)
           
 ColumnMetaData setInsertValue(java.lang.String insertValue)
           
 ColumnMetaData setJdbcType(java.lang.String jdbcType)
           
 ColumnMetaData setLength(java.lang.Integer length)
           
 ColumnMetaData setLength(java.lang.String length)
           
 ColumnMetaData setName(java.lang.String name)
           
 ColumnMetaData setPosition(int pos)
           
 ColumnMetaData setPosition(java.lang.String pos)
           
 ColumnMetaData setScale(java.lang.Integer scale)
           
 ColumnMetaData setScale(java.lang.String scale)
           
 ColumnMetaData setSqlType(java.lang.String sqlType)
           
 ColumnMetaData setTarget(java.lang.String target)
           
 ColumnMetaData setTargetMember(java.lang.String targetMember)
           
 ColumnMetaData setUnique(boolean unique)
           
 ColumnMetaData setUnique(java.lang.String unique)
           
 ColumnMetaData setUpdateable(boolean updateable)
           
 ColumnMetaData setUpdateable(java.lang.String updateable)
           
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object using a prefix
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
column name.


target

protected java.lang.String target
target column name (for matching across a FK).


targetMember

protected java.lang.String targetMember
target field/property name (for matching across a FK).


jdbcType

protected java.lang.String jdbcType
jdbc-type to use (if any).


sqlType

protected java.lang.String sqlType
sql-type to use (if any). Takes priority over jdbc-type.


length

protected java.lang.Integer length
length to use (if any). Also known as "precision" when for floating point types.


scale

protected java.lang.Integer scale
scale to use (if any).


allowsNull

protected java.lang.Boolean allowsNull
Whether the column accepts nulls.


defaultValue

protected java.lang.String defaultValue
Default value for the column (when constructing the table with this column).


insertValue

protected java.lang.String insertValue
value to use when inserting this column in the datastore (the column is not mapped to a field/property)


insertable

protected boolean insertable
Whether this column is to be inserted when the owning object is inserted. JPA 1.0 attribute.


updateable

protected boolean updateable
Whether this column can be updated when the owning object is updated. JPA 1.0 attribute.


unique

protected boolean unique
unique tag value. JPA 1.0 attribute.


columnDdl

protected java.lang.String columnDdl
Optional column DDL appended to the column definition defined by DataNucleus.


position

protected java.lang.Integer position
Column position for the table as a whole (0-origin).

Constructor Detail

ColumnMetaData

public ColumnMetaData(ColumnMetaData colmd)
Creates a ColumnMetaData by copying contents from colmd.

Parameters:
colmd - MetaData for the column

ColumnMetaData

public ColumnMetaData()
Default constructor. Set the fields using setters, before populate().

Method Detail

getDefaultValue

public java.lang.String getDefaultValue()

setDefaultValue

public ColumnMetaData setDefaultValue(java.lang.String defaultValue)

getColumnDdl

public java.lang.String getColumnDdl()

setColumnDdl

public void setColumnDdl(java.lang.String columnDdl)

getInsertable

public boolean getInsertable()

setInsertable

public ColumnMetaData setInsertable(boolean insertable)

setInsertable

public ColumnMetaData setInsertable(java.lang.String insertable)

getInsertValue

public java.lang.String getInsertValue()

setInsertValue

public ColumnMetaData setInsertValue(java.lang.String insertValue)

getJdbcType

public java.lang.String getJdbcType()

setJdbcType

public ColumnMetaData setJdbcType(java.lang.String jdbcType)

getLength

public java.lang.Integer getLength()

setLength

public ColumnMetaData setLength(java.lang.Integer length)

setLength

public ColumnMetaData setLength(java.lang.String length)

getName

public java.lang.String getName()

setName

public ColumnMetaData setName(java.lang.String name)

getScale

public java.lang.Integer getScale()

setScale

public ColumnMetaData setScale(java.lang.Integer scale)

setScale

public ColumnMetaData setScale(java.lang.String scale)

getSqlType

public java.lang.String getSqlType()

setSqlType

public ColumnMetaData setSqlType(java.lang.String sqlType)

getTarget

public java.lang.String getTarget()

setTarget

public ColumnMetaData setTarget(java.lang.String target)

getTargetMember

public java.lang.String getTargetMember()

setTargetMember

public ColumnMetaData setTargetMember(java.lang.String targetMember)

getPosition

public java.lang.Integer getPosition()

setPosition

public ColumnMetaData setPosition(int pos)

setPosition

public ColumnMetaData setPosition(java.lang.String pos)

getUnique

public boolean getUnique()

setUnique

public ColumnMetaData setUnique(boolean unique)

setUnique

public ColumnMetaData setUnique(java.lang.String unique)

getUpdateable

public boolean getUpdateable()

setUpdateable

public ColumnMetaData setUpdateable(boolean updateable)

setUpdateable

public ColumnMetaData setUpdateable(java.lang.String updateable)

isAllowsNull

public boolean isAllowsNull()

getAllowsNull

public java.lang.Boolean getAllowsNull()

setAllowsNull

public ColumnMetaData setAllowsNull(java.lang.Boolean allowsNull)

setAllowsNull

public ColumnMetaData setAllowsNull(java.lang.String allowsNull)

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object using a prefix

Overrides:
toString in class MetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2011. All Rights Reserved.