Package org.datanucleus.metadata
Class ColumnMetaData
- java.lang.Object
-
- org.datanucleus.metadata.MetaData
-
- org.datanucleus.metadata.ColumnMetaData
-
- All Implemented Interfaces:
Serializable
public class ColumnMetaData extends MetaData
Representation of the Meta-Data for a column mapping of a field.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Boolean
allowsNull
Whether the column accepts nulls.protected String
columnDdl
Optional column DDL appended to the column definition defined by DataNucleus.protected 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 String
insertValue
value to use when inserting this column in the datastore (the column is not mapped to a field/property)protected JdbcType
jdbcType
jdbc-type to use (if any).protected Integer
length
length to use (if any).protected String
name
column name.protected Integer
position
Column position for the table as a whole (0-origin).protected Integer
scale
scale to use (if any).protected String
sqlType
sql-type to use (if any).protected String
target
target column name (for matching across a FK).protected String
targetMember
target field/property name (for matching across a FK).protected boolean
unique
Whether this column should be marked as UNIQUE.protected boolean
updateable
Whether this column can be updated when the owning object is updated.-
Fields inherited from class org.datanucleus.metadata.MetaData
EXTENSION_CLASS_CREATETIMESTAMP, EXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_CREATEUSER, EXTENSION_CLASS_CREATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_CREATEUSER_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH, EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_DISABLE, EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE, EXTENSION_CLASS_READ_ONLY, EXTENSION_CLASS_SOFTDELETE, EXTENSION_CLASS_SOFTDELETE_COLUMN_NAME, EXTENSION_CLASS_UPDATETIMESTAMP, EXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_UPDATEUSER, EXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_UPDATEUSER_COLUMN_NAME, EXTENSION_CLASS_VERSION_FIELD_NAME, EXTENSION_CLASS_VIEW_DEFINITION, EXTENSION_CLASS_VIEW_IMPORTS, EXTENSION_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_CASCADE_UPDATE, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_ENUM_GETTER_BY_VALUE, EXTENSION_MEMBER_ENUM_VALUE_GETTER, EXTENSION_MEMBER_FETCH_FK_ONLY, EXTENSION_MEMBER_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_INSERTABLE, EXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_LIST_ORDERING, EXTENSION_MEMBER_RELATION_DISCRIM_COLUMN, EXTENSION_MEMBER_RELATION_DISCRIM_PK, EXTENSION_MEMBER_RELATION_DISCRIM_VALUE, EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL, EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED, EXTENSION_MEMBER_TYPE_CONVERTER_NAME, EXTENSION_MEMBER_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME
-
-
Constructor Summary
Constructors Constructor Description ColumnMetaData()
Default constructor.ColumnMetaData(ColumnMetaData colmd)
Creates a ColumnMetaData by copying contents fromcolmd
.
-
Method Summary
-
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setParent
-
-
-
-
Field Detail
-
name
protected String name
column name.
-
target
protected String target
target column name (for matching across a FK).
-
targetMember
protected String targetMember
target field/property name (for matching across a FK).
-
jdbcType
protected JdbcType jdbcType
jdbc-type to use (if any).
-
sqlType
protected String sqlType
sql-type to use (if any). Takes priority over jdbc-type.
-
length
protected Integer length
length to use (if any). Also known as "precision" when for floating point types.
-
scale
protected Integer scale
scale to use (if any).
-
allowsNull
protected Boolean allowsNull
Whether the column accepts nulls.
-
defaultValue
protected String defaultValue
Default value for the column (when constructing the table with this column).
-
insertValue
protected 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. TODO Merge this with AbstractMemberMetaData.isInsertable.
-
updateable
protected boolean updateable
Whether this column can be updated when the owning object is updated. TODO Merge this with AbstractMemberMetaData.isUpdateable.
-
unique
protected boolean unique
Whether this column should be marked as UNIQUE.
-
columnDdl
protected String columnDdl
Optional column DDL appended to the column definition defined by DataNucleus.
-
position
protected 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 fromcolmd
.- Parameters:
colmd
- MetaData for the column
-
ColumnMetaData
public ColumnMetaData()
Default constructor. Set the fields using setters, before populate().
-
-
Method Detail
-
getDefaultValue
public String getDefaultValue()
-
setDefaultValue
public ColumnMetaData setDefaultValue(String defaultValue)
-
getColumnDdl
public String getColumnDdl()
-
setColumnDdl
public void setColumnDdl(String columnDdl)
-
getInsertable
public boolean getInsertable()
-
setInsertable
public ColumnMetaData setInsertable(boolean insertable)
-
setInsertable
public ColumnMetaData setInsertable(String insertable)
-
getInsertValue
public String getInsertValue()
-
setInsertValue
public ColumnMetaData setInsertValue(String insertValue)
-
getJdbcType
public JdbcType getJdbcType()
-
getJdbcTypeName
public String getJdbcTypeName()
-
setJdbcType
public ColumnMetaData setJdbcType(JdbcType type)
-
setJdbcType
public ColumnMetaData setJdbcType(String jdbcTypeName)
-
getLength
public Integer getLength()
-
setLength
public ColumnMetaData setLength(Integer length)
-
setLength
public ColumnMetaData setLength(String length)
-
getName
public String getName()
-
setName
public ColumnMetaData setName(String name)
-
getScale
public Integer getScale()
-
setScale
public ColumnMetaData setScale(Integer scale)
-
setScale
public ColumnMetaData setScale(String scale)
-
getSqlType
public String getSqlType()
-
setSqlType
public ColumnMetaData setSqlType(String sqlType)
-
getTarget
public String getTarget()
-
setTarget
public ColumnMetaData setTarget(String target)
-
getTargetMember
public String getTargetMember()
-
setTargetMember
public ColumnMetaData setTargetMember(String targetMember)
-
getPosition
public Integer getPosition()
-
setPosition
public ColumnMetaData setPosition(int pos)
-
setPosition
public ColumnMetaData setPosition(String pos)
-
getUnique
public boolean getUnique()
-
setUnique
public ColumnMetaData setUnique(boolean unique)
-
setUnique
public ColumnMetaData setUnique(String unique)
-
getUpdateable
public boolean getUpdateable()
-
setUpdateable
public ColumnMetaData setUpdateable(boolean updateable)
-
setUpdateable
public ColumnMetaData setUpdateable(String updateable)
-
isAllowsNull
public boolean isAllowsNull()
-
getAllowsNull
public Boolean getAllowsNull()
-
setAllowsNull
public ColumnMetaData setAllowsNull(Boolean allowsNull)
-
setAllowsNull
public ColumnMetaData setAllowsNull(String allowsNull)
-
-