|
||||||||||
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(DBIdentifier name,
Table table)
|
|
Column(String name,
Table table)
Deprecated. |
Method Summary | |
---|---|
void |
copy(Column from)
Copy information from the given column to this one. |
boolean |
equalsColumn(Column col)
Tests compatibility. |
String |
getComment()
|
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. |
DBIdentifier |
getFullDBIdentifier()
|
String |
getFullName()
Deprecated. use getFullDBIdentifier() |
DBIdentifier |
getIdentifier()
|
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()
Deprecated. use getIdentifier() |
QualifiedDBIdentifier |
getQualifiedPath()
|
DBIdentifier |
getSchemaIdentifier()
|
String |
getSchemaName()
Deprecated. |
int |
getSize()
Return the column's size. |
Table |
getTable()
Return the table for the column. |
DBIdentifier |
getTableIdentifier()
|
String |
getTableName()
Deprecated. |
String |
getTarget()
Deprecated. use getTargetIdentifier() |
String |
getTargetField()
The name of the field this column joins to, if any. |
DBIdentifier |
getTargetIdentifier()
|
int |
getType()
Return the column's SQL type. |
DBIdentifier |
getTypeIdentifier()
|
String |
getTypeName()
Deprecated. |
VersionStrategy |
getVersionStrategy()
|
boolean |
hasComment()
|
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 |
isImplicitRelation()
Affirms if this instance represents an implicit relation. |
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 |
isUni1MFK()
Sets a marker to indicate that this instance represents a uni-directional one to many relation using the foreign key strategy. |
boolean |
isXML()
Whether this column is of XML type. |
(package private) void |
remove()
Called when the column is removed from its table. |
void |
resetTableIdentifier(DBIdentifier table)
|
void |
resetTableName(String name)
Deprecated. |
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. |
void |
setIdentifier(DBIdentifier name)
|
void |
setImplicitRelation(boolean flag)
Sets a marker to imply a logical relation that can not have any physical manifest in the database. |
(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)
Deprecated. use setIdentifier(DBIdentifier 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 |
setSchemaIdentifier(DBIdentifier name)
|
void |
setSchemaName(String name)
Deprecated. use setSchemaIdentifier(DBIdentifier name) |
void |
setSize(int size)
Set the column's size. |
void |
setTableIdentifier(DBIdentifier name)
|
void |
setTableName(String name)
Deprecated. |
void |
setTarget(String target)
Deprecated. use setTargetIdentifier(DBIdentifier target) |
void |
setTargetField(String target)
The name of the field this column joins to, if any. |
void |
setTargetIdentifier(DBIdentifier target)
|
void |
setType(int sqlType)
Set the column's SQL type. |
void |
setTypeIdentifier(DBIdentifier typeName)
|
void |
setTypeName(String typeName)
Deprecated. |
void |
setUni1MFK(boolean isUni1MFK)
Affirms if this instance represents a uni-directional one to many relation using the foreign key strategy. |
void |
setVersionStrategy(VersionStrategy strategy)
|
void |
setXML(boolean xml)
Whether this column is of XML type. |
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 tablepublic Column(DBIdentifier name, Table table)
Method Detail |
---|
void remove()
public Table getTable()
public String getTableName()
public DBIdentifier getTableIdentifier()
public void setTableName(String name)
public void setTableIdentifier(DBIdentifier name)
public void resetTableName(String name)
public void resetTableIdentifier(DBIdentifier table)
public String getSchemaName()
public DBIdentifier getSchemaIdentifier()
public void setSchemaName(String name)
public void setSchemaIdentifier(DBIdentifier name)
public String getName()
public DBIdentifier getIdentifier()
public void setName(String name)
public void setIdentifier(DBIdentifier name)
public String getFullName()
public DBIdentifier getFullDBIdentifier()
public QualifiedDBIdentifier getQualifiedPath()
public int getType()
Types
.
public void setType(int sqlType)
Types
.
public String getTypeName()
public DBIdentifier getTypeIdentifier()
public void setTypeName(String typeName)
public void setTypeIdentifier(DBIdentifier 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 DBIdentifier getTargetIdentifier()
public void setTarget(String target)
public void setTargetIdentifier(DBIdentifier 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 void setXML(boolean xml)
public VersionStrategy getVersionStrategy()
public void setVersionStrategy(VersionStrategy strategy)
public boolean hasComment()
public String getComment()
public void setComment(String comment)
public boolean isImplicitRelation()
public void setImplicitRelation(boolean flag)
public boolean isUni1MFK()
public void setUni1MFK(boolean isUni1MFK)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |