primaryKey
protected boolean primaryKey
Defines whether the attribute is a part of the table primary key.
Serializable
, ConfigurationNode
, CayenneMapEntry
, XMLSerializable
public class DbAttribute extends Attribute implements ConfigurationNode
Modifier and Type | Field | Description |
---|---|---|
protected int |
attributePrecision |
|
protected boolean |
generated |
Defines whether this column value is generated by the database.
|
protected boolean |
mandatory |
Defines whether the attribute allows nulls.
|
protected int |
maxLength |
|
protected boolean |
primaryKey |
Defines whether the attribute is a part of the table primary key.
|
protected int |
scale |
|
protected int |
type |
Defines JDBC type of the column.
|
Constructor | Description |
---|---|
DbAttribute() |
|
DbAttribute(String name) |
|
DbAttribute(String name,
int type,
DbEntity entity) |
Modifier and Type | Method | Description |
---|---|---|
<T> T |
acceptVisitor(ConfigurationNodeVisitor<T> visitor) |
|
void |
encodeAsXML(XMLEncoder encoder,
ConfigurationNodeVisitor delegate) |
Prints itself as XML to the provided XMLEncoder.
|
String |
getAliasedName(String alias) |
|
int |
getAttributePrecision() |
|
DbEntity |
getEntity() |
Returns parent entity that holds this attribute.
|
int |
getMaxLength() |
Returns the length of database column described by this attribute.
|
int |
getScale() |
Returns the number of digits after period for decimal attributes.
|
int |
getType() |
Returns the SQL type of the column.
|
boolean |
isForeignKey() |
Returns
true if the DB column represented by this attribute
is a foreign key, referencing another table. |
boolean |
isGenerated() |
Returns true if this column value is generated by the database.
|
boolean |
isMandatory() |
|
boolean |
isPrimaryKey() |
|
void |
setAttributePrecision(int attributePrecision) |
|
void |
setGenerated(boolean generated) |
Updates attribute "generated" property.
|
void |
setMandatory(boolean mandatory) |
|
void |
setMaxLength(int maxLength) |
Sets the length of character or binary type or max num of digits for
DECIMAL.
|
void |
setPrimaryKey(boolean primaryKey) |
Updates attribute "primaryKey" property.
|
void |
setScale(int scale) |
|
void |
setType(int type) |
Sets the SQL type for the column.
|
String |
toString() |
Attribute
acceptVisitor
in interface ConfigurationNode
encodeAsXML
in interface XMLSerializable
encodeAsXML
in class Attribute
Types
Types
true
if the DB column represented by this attribute
is a foreign key, referencing another table.