|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.map.Attribute
org.apache.cayenne.map.DbAttribute
public class DbAttribute
A DbAttribute defines a descriptor for a single database table column.
Field Summary | |
---|---|
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 int |
precision
|
protected boolean |
primaryKey
Defines whether the attribute is a part of the table primary key. |
protected int |
type
Defines JDBC type of the column. |
Fields inherited from class org.apache.cayenne.map.Attribute |
---|
entity, name |
Constructor Summary | |
---|---|
DbAttribute()
|
|
DbAttribute(java.lang.String name)
|
|
DbAttribute(java.lang.String name,
int type,
DbEntity entity)
|
Method Summary | |
---|---|
void |
encodeAsXML(XMLEncoder encoder)
Prints itself as XML to the provided XMLEncoder. |
java.lang.String |
getAliasedName(java.lang.String alias)
|
int |
getMaxLength()
Returns the length of database column described by this attribute. |
int |
getPrecision()
Returns the number of digits after period for DECIMAL. |
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 |
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 |
setPrecision(int precision)
Sets the number of digits after period for DECIMAL. |
void |
setPrimaryKey(boolean primaryKey)
Updates attribute "primaryKey" property. |
void |
setType(int type)
Sets the SQL type for the column. |
Methods inherited from class org.apache.cayenne.map.Attribute |
---|
getEntity, getName, getParent, setEntity, setName, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int type
protected boolean mandatory
protected boolean primaryKey
protected boolean generated
protected int maxLength
protected int precision
Constructor Detail |
---|
public DbAttribute()
public DbAttribute(java.lang.String name)
public DbAttribute(java.lang.String name, int type, DbEntity entity)
Method Detail |
---|
public void encodeAsXML(XMLEncoder encoder)
public java.lang.String getAliasedName(java.lang.String alias)
public int getType()
Types
public void setType(int type)
Types
public boolean isPrimaryKey()
public boolean isForeignKey()
true
if the DB column represented by this attribute is a
foreign key, referencing another table.
public void setPrimaryKey(boolean primaryKey)
public boolean isMandatory()
public void setMandatory(boolean mandatory)
public int getMaxLength()
public void setMaxLength(int maxLength)
public int getPrecision()
public void setPrecision(int precision)
public boolean isGenerated()
public void setGenerated(boolean generated)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |