Package org.datanucleus.metadata
Class ColumnMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.ColumnMetaData
- All Implemented Interfaces:
Serializable
Representation of the Meta-Data for a column mapping of a field.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Boolean
Whether the column accepts nulls.protected String
Optional column DDL appended to the column definition defined by DataNucleus.protected String
Default value for the column (when constructing the table with this column).protected boolean
Whether this column is to be inserted when the owning object is inserted.protected String
value to use when inserting this column in the datastore (the column is not mapped to a field/property)protected JdbcType
jdbc-type to use (if any).protected Integer
length to use (if any).protected String
column name.protected Integer
Column position for the table as a whole (0-origin).protected Integer
scale to use (if any).private static final long
protected String
sql-type to use (if any).protected String
target column name (for matching across a FK).protected String
target field/property name (for matching across a FK).protected boolean
Whether this column should be marked as UNIQUE.protected boolean
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_JDBC_TYPE, EXTENSION_CLASS_MULTITENANT, 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_INDEX_COLUMN_ORDERING, EXTENSION_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_ATTACH, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_CREATE_TIMESTAMP, EXTENSION_MEMBER_CREATE_USER, EXTENSION_MEMBER_ENUM_VALUE_GETTER, 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_UPDATE_TIMESTAMP, EXTENSION_MEMBER_UPDATE_USER, EXTENSION_MEMBER_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, metaDataState, parent, VENDOR_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ColumnMetaData
(ColumnMetaData colmd) Creates a ColumnMetaData by copying contents fromcolmd
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getName()
getScale()
boolean
boolean
boolean
setAllowsNull
(Boolean allowsNull) setAllowsNull
(String allowsNull) void
setColumnDdl
(String columnDdl) setDefaultValue
(String defaultValue) setInsertable
(boolean insertable) setInsertable
(String insertable) setInsertValue
(String insertValue) setJdbcType
(String jdbcTypeName) setJdbcType
(JdbcType type) setPosition
(int pos) setPosition
(String pos) setSqlType
(String sqlType) setTargetMember
(String targetMember) setUnique
(boolean unique) setUpdateable
(boolean updateable) setUpdateable
(String updateable) Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setInitialised, setParent, setPopulated, setUsed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
column name. -
target
target column name (for matching across a FK). -
targetMember
target field/property name (for matching across a FK). -
jdbcType
jdbc-type to use (if any). -
sqlType
sql-type to use (if any). Takes priority over jdbc-type. -
length
length to use (if any). Also known as "precision" when for floating point types. -
scale
scale to use (if any). -
allowsNull
Whether the column accepts nulls. -
defaultValue
Default value for the column (when constructing the table with this column). -
insertValue
value to use when inserting this column in the datastore (the column is not mapped to a field/property) -
insertable
protected boolean insertableWhether this column is to be inserted when the owning object is inserted. TODO Merge this with AbstractMemberMetaData.isInsertable. -
updateable
protected boolean updateableWhether this column can be updated when the owning object is updated. TODO Merge this with AbstractMemberMetaData.isUpdateable. -
unique
protected boolean uniqueWhether this column should be marked as UNIQUE. -
columnDdl
Optional column DDL appended to the column definition defined by DataNucleus. -
position
Column position for the table as a whole (0-origin).
-
-
Constructor Details
-
ColumnMetaData
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 Details
-
getDefaultValue
-
setDefaultValue
-
getColumnDdl
-
setColumnDdl
-
getInsertable
public boolean getInsertable() -
setInsertable
-
setInsertable
-
getInsertValue
-
setInsertValue
-
getJdbcType
-
getJdbcTypeName
-
setJdbcType
-
setJdbcType
-
getLength
-
setLength
-
setLength
-
getName
-
setName
-
getScale
-
setScale
-
setScale
-
getSqlType
-
setSqlType
-
getTarget
-
setTarget
-
getTargetMember
-
setTargetMember
-
getPosition
-
setPosition
-
setPosition
-
getUnique
public boolean getUnique() -
setUnique
-
setUnique
-
getUpdateable
public boolean getUpdateable() -
setUpdateable
-
setUpdateable
-
isAllowsNull
public boolean isAllowsNull() -
getAllowsNull
-
setAllowsNull
-
setAllowsNull
-