|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.jdbc.schema.ReferenceCounter org.apache.openjpa.jdbc.schema.Column
public class Column
Represents a database column. Closely aligned with the column
information available from DatabaseMetaData
.
Field Summary | |
---|---|
static int |
FLAG_DIRECT_INSERT
|
static int |
FLAG_DIRECT_UPDATE
|
static int |
FLAG_FK_INSERT
|
static int |
FLAG_FK_UPDATE
|
static int |
FLAG_PK_JOIN
|
static int |
FLAG_UNINSERTABLE
|
static int |
FLAG_UNUPDATABLE
|
Constructor Summary | |
---|---|
Column()
Default constructor. |
|
Column(String name,
Table table)
Constructor. |
Method Summary | ||
---|---|---|
void |
addConstraint(Constraint c)
Adds the given constraint to this column. |
|
void |
copy(Column from)
Copy information from the given column to this one. |
|
boolean |
equalsColumn(Column col)
Tests compatibility. |
|
String |
getComment()
|
|
Set<Constraint> |
getConstraints()
Gets all constrains attached this column. |
|
|
getConstraints(Class<T> type)
Gets all constrains of the given type attached to this column. |
|
int |
getDecimalDigits()
Return the number of decimal digits for the column, if applicable. |
|
Object |
getDefault()
Return the default value set for this column, if any. |
|
String |
getDefaultString()
Return the default value set for the column, if any. |
|
String |
getDescription()
Useful for debugging. |
|
boolean |
getFlag(int flag)
Flags are used for bookkeeping information. |
|
String |
getFullName()
Return the column's full name, in the form <table>.<name>. |
|
int |
getIndex()
Return the column's 0-based index in the owning table. |
|
int |
getJavaType()
The Java type the data in this column is treated as, from JavaTypes or JavaSQLTypes . |
|
String |
getName()
Return the column's name. |
|
String |
getSchemaName()
The column's schema name. |
|
int |
getSize()
Return the column's size. |
|
Table |
getTable()
Return the table for the column. |
|
String |
getTableName()
The column's table name. |
|
String |
getTarget()
The name of the column this column joins to, if any. |
|
String |
getTargetField()
The name of the field this column joins to, if any. |
|
int |
getType()
Return the column's SQL type. |
|
String |
getTypeName()
The database-specific SQL type of this column. |
|
VersionStrategy |
getVersionStrategy()
|
|
boolean |
hasComment()
|
|
boolean |
hasConstraint(Class<? extends Constraint> type)
Affirms if this column has any constraint of given type. |
|
boolean |
isAutoAssigned()
Whether this column is auto-assigned a value on insert. |
|
boolean |
isCompatible(int type,
String typeName,
int size,
int decimals)
Return true if this column is compatible with the given JDBC type from Types and size. |
|
boolean |
isForeignKey()
Affirms if any foreign key constraint is attached to this column. |
|
boolean |
isIndex()
Affirms if any index constraint is attached to this column. |
|
boolean |
isLob()
Whether this column is a LOB. |
|
boolean |
isNotNull()
Return true if this is a NOT NULL column. |
|
boolean |
isNotNullExplicit()
Whether the not-null property has been set. |
|
boolean |
isPrimaryKey()
Return true if this column belongs to the table's primary key. |
|
boolean |
isRelationId()
Whether this column stores some form of serialized identity value for a related record. |
|
boolean |
isUniqueConstraint()
Affirms if any unique constraint is attached to this column. |
|
boolean |
isXML()
Whether this column is an XML type. |
|
(package private) void |
remove()
Called when the column is removed from its table. |
|
void |
removeConstraint(Constraint c)
Removes the given constraint from this column. |
|
void |
resetTableName(String name)
Reset the table name with the fully qualified table name which includes the schema name |
|
void |
setAutoAssigned(boolean autoAssign)
Whether this column is auto-incrementing. |
|
void |
setComment(String comment)
|
|
void |
setDecimalDigits(int digits)
Set the number of decimal digits for the column. |
|
void |
setDefault(Object def)
Set the default value for the column. |
|
void |
setDefaultString(String def)
Set the default value for the column. |
|
void |
setFlag(int flag,
boolean on)
Flags are used for bookkeeping information. |
|
(package private) void |
setIndex(int index)
Set the column's 0-based index in the owning table. |
|
void |
setJavaType(int type)
The Java type the data in this column is treated as, from JavaTypes or JavaSQLTypes . |
|
void |
setName(String name)
Set the column's name. |
|
void |
setNotNull(boolean notNull)
Set whether this is a NOT NULL column. |
|
(package private) void |
setPrimaryKey(boolean pk)
Set whether this column belongs to the table's primary key. |
|
void |
setRelationId(boolean rel)
Whether this column stores some form of serialized identity value for a related record. |
|
void |
setSchemaName(String name)
The column's schema name. |
|
void |
setSize(int size)
Set the column's size. |
|
void |
setTableName(String name)
The column's table name. |
|
void |
setTarget(String target)
The name of the column this column joins to, if any. |
|
void |
setTargetField(String target)
The name of the field this column joins to, if any. |
|
void |
setType(int sqlType)
Set the column's SQL type. |
|
void |
setTypeName(String typeName)
The database-specific SQL type of this column. |
|
void |
setVersionStrategy(VersionStrategy strategy)
|
|
String |
toString()
Returns the column name. |
Methods inherited from class org.apache.openjpa.jdbc.schema.ReferenceCounter |
---|
deref, getRefCount, ref |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FLAG_UNINSERTABLE
public static final int FLAG_UNUPDATABLE
public static final int FLAG_DIRECT_INSERT
public static final int FLAG_DIRECT_UPDATE
public static final int FLAG_FK_INSERT
public static final int FLAG_FK_UPDATE
public static final int FLAG_PK_JOIN
Constructor Detail |
---|
public Column()
public Column(String name, Table table)
name
- the name of the columntable
- the column's tableMethod Detail |
---|
void remove()
public Table getTable()
public String getTableName()
public void setTableName(String name)
public void resetTableName(String name)
public String getSchemaName()
public void setSchemaName(String name)
public String getName()
public void setName(String name)
public String getFullName()
public int getType()
Types
.
public void setType(int sqlType)
Types
.
public String getTypeName()
public void setTypeName(String typeName)
public int getJavaType()
JavaTypes
or JavaSQLTypes
.
public void setJavaType(int type)
JavaTypes
or JavaSQLTypes
.
public int getSize()
public void setSize(int size)
public int getDecimalDigits()
public void setDecimalDigits(int digits)
public String getDefaultString()
public void setDefaultString(String def)
public Object getDefault()
public void setDefault(Object def)
public boolean isNotNull()
public void setNotNull(boolean notNull)
public boolean isNotNullExplicit()
public boolean isAutoAssigned()
public void setAutoAssigned(boolean autoAssign)
public boolean isRelationId()
public void setRelationId(boolean rel)
public String getTarget()
public void setTarget(String target)
public String getTargetField()
public void setTargetField(String target)
public boolean getFlag(int flag)
public void setFlag(int flag, boolean on)
public boolean isPrimaryKey()
void setPrimaryKey(boolean pk)
public int getIndex()
void setIndex(int index)
public boolean isLob()
public boolean isCompatible(int type, String typeName, int size, int decimals)
Types
and size.
public String toString()
toString
in class Object
public String getDescription()
public boolean equalsColumn(Column col)
public void copy(Column from)
public boolean isXML()
public VersionStrategy getVersionStrategy()
public void setVersionStrategy(VersionStrategy strategy)
public boolean hasComment()
public String getComment()
public void setComment(String comment)
public void addConstraint(Constraint c)
public void removeConstraint(Constraint c)
public boolean hasConstraint(Class<? extends Constraint> type)
public Set<Constraint> getConstraints()
public <T extends Constraint> Set<T> getConstraints(Class<T> type)
public boolean isUniqueConstraint()
public boolean isIndex()
public boolean isForeignKey()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |