|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object 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 |
copy(Column from)
Copy information from the given column to this one. |
void |
deref()
|
boolean |
equalsColumn(Column col)
Tests compatibility. |
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. |
int |
getRefCount()
|
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. |
boolean |
isAutoAssigned()
Whether this column is auto-assigned a value on insert. |
boolean |
isCompatible(int type,
int size)
Return true if this column is compatible with the given JDBC type from Types and size. |
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. |
void |
ref()
|
void |
setAutoAssigned(boolean autoAssign)
Whether this column is auto-incrementing. |
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 |
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. |
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. |
String |
toString()
Returns the column name. |
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 |
---|
public Table getTable()
public String getTableName()
public void setTableName(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()
public int getIndex()
public boolean isLob()
public boolean isCompatible(int type, int size)
Types
and size.
public String toString()
toString
in class Object
public String getDescription()
public boolean equalsColumn(Column col)
public void copy(Column from)
public int getRefCount()
public void ref()
public void deref()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |