MetadataColumnpublic class MetadataColumn extends Object Object to hold onto column metadata in a TopLink database field. |
Fields Summary |
---|
protected String | m_attributeName | protected DatabaseField | m_databaseField | protected AnnotatedElement | m_annotatedElement | public static final int | DEFAULT_SCALE | public static final int | DEFAULT_LENGTH | public static final int | DEFAULT_PRECISION | public static final String | DEFAULT_NAME | public static final String | DEFAULT_TABLE | public static final String | DEFAULT_COLUMN_DEFINITION | public static final boolean | DEFAULT_UNIQUE | public static final boolean | DEFAULT_NULLABLE | public static final boolean | DEFAULT_UPDATABLE | public static final boolean | DEFAULT_INSERTABLE |
Constructors Summary |
---|
public MetadataColumn(AttributeOverride attributeOverride, AnnotatedElement annotatedElement)INTERNAL:
Called for attribute overrides.
this(attributeOverride.column(), attributeOverride.name(), annotatedElement);
| public MetadataColumn(Column column, MetadataAccessor accessor)INTERNAL:
Called for basic mappings.
this(column, accessor.getAttributeName(), accessor.getAnnotatedElement());
| public MetadataColumn(Column column, String attributeName, AnnotatedElement annotatedElement)INTERNAL:
this(attributeName, annotatedElement);
if (column != null) {
// Apply the values from the column annotation.
m_databaseField.setUnique(column.unique());
m_databaseField.setNullable(column.nullable());
m_databaseField.setUpdatable(column.updatable());
m_databaseField.setInsertable(column.insertable());
m_databaseField.setScale(column.scale());
m_databaseField.setLength(column.length());
m_databaseField.setPrecision(column.precision());
m_databaseField.setName(column.name());
m_databaseField.setTableName(column.table());
m_databaseField.setColumnDefinition(column.columnDefinition());
}
| public MetadataColumn(String attributeName, AnnotatedElement annotatedElement)INTERNAL:
Initialize the database field with the default values.
m_attributeName = attributeName;
m_annotatedElement = annotatedElement;
m_databaseField = new DatabaseField();
// Apply default values.
m_databaseField.setUnique(DEFAULT_UNIQUE);
m_databaseField.setNullable(DEFAULT_NULLABLE);
m_databaseField.setUpdatable(DEFAULT_UPDATABLE);
m_databaseField.setInsertable(DEFAULT_INSERTABLE);
m_databaseField.setScale(DEFAULT_SCALE);
m_databaseField.setLength(DEFAULT_LENGTH);
m_databaseField.setPrecision(DEFAULT_PRECISION);
m_databaseField.setName(DEFAULT_NAME);
m_databaseField.setTableName(DEFAULT_TABLE);
m_databaseField.setColumnDefinition(DEFAULT_COLUMN_DEFINITION);
|
|