| java.lang.Object com.versant.core.jdbc.metadata.JdbcColumn
JdbcColumn | final public class JdbcColumn implements Serializable(Code) | | A column in a JDBC table.
|
Field Summary | |
public boolean | autoinc | public String | comment Comment info for the SQL script (e.g. | public transient JdbcConverter | converter This is responsible for getting a suitable java value for this column
from a ResultSet and setting the java value of this column on a
PreparedStatement. | public boolean | equalityTest Can values from this column be compared for equality with Java values?
Non-exact data types should have false here (e.g. | public boolean | foreignKey | public transient Class | javaType The java type of this column. | public int | javaTypeCode The java type code of this column from MDStatics. | public int | jdbcType The JDBC type of this column from java.sql.Types. | public int | length The length (or precision) of this column. | public String | name The JDBC name of this column. | public boolean | nulls | public boolean | partOfIndex | public boolean | pk | public transient JdbcSimpleField | refField The name of the field this column references. | public int | scale The scale of this column (number of digits after the decimal point). | public boolean | shared Should this column not be created when generating the schema? This
is used when columns are shared between one or more fields. | public String | sqlType The actual SQL type of this column for create scripts etc. | public transient JdbcTable | table The table this column belongs to. |
Method Summary | |
public void | addColumnNames(String tableName, JdbcNameGenerator nameGen) If the column or its component columns have names then add them to
nameGen. | public static void | addColumnNames(String tableName, JdbcColumn[] cols, JdbcNameGenerator namegen) If the column or its component columns have names then add them to
nameGen. | public static void | appendEqualsParam(CharBuf s, JdbcColumn[] cols, SqlDriver driver) /**
Append a 'cola = ? [and colb = ?' string for an array of simple cols
to s. | public void | appendNames(CharBuf s) Append a comma list of our column name(s) to s. | public void | appendParams(CharBuf s) Append a comma param list to s (e.g. | public static JdbcColumn[] | concat(JdbcColumn[] a, JdbcColumn[] b) Combine two arrays of JdbcColumn's into one. | public static JdbcColumn[] | concat(JdbcColumn[] a, JdbcColumn b) Combine an arrays of JdbcColumn's and a single column into one. | public JdbcColumn | copy() Duplicate this column but leave the name, table and refField fields of
the duplicates null. | public LiteralExp | createClassIdLiteralExp(Object val) | public static SqlExp | createEqualsParamExp(JdbcColumn[] scols, SelectExp se) Get a 'cola = ? [and colb = ?]' expression for an array of simple
columns from se. | public SqlExp | createEqualsParamExp(SelectExp se) Create a col = ? expression. | public static InExp | createInParamExp(JdbcColumn[] scols, SelectExp se, int size) | public boolean | equals(Object o) | public Object | get(ResultSet rs, int index) Get the value of this column from a ResultSet. | public String[] | getColumnNames() Get the names of all our component columns. | public void | getColumnNames(String[] names) Get the names of all our component columns into the array. | public static String[] | getColumnNames(JdbcColumn[] cols) Get the names of all the simple columns in an array of columns. | public int | getInt(ResultSet rs, int index) Get the value of this column from the ResultSet as an int. | public Class | getJavaType() | public String | getShortName() | public String | getTypeString() | public int | hashCode() | public boolean | isForUpdate() | public void | set(PreparedStatement ps, int index, Object value) Set a value for this column on a PreparedStatement. | public void | set(PreparedStatement ps, int index, int value) Set a value for this column on a PreparedStatement. | public void | setColumnNames(String[] names) Set the names of all our component columns from the array. | public static void | setColumnNames(JdbcColumn[] cols, String[] names) Set the names of all the simple columns in an array of columns. | public void | setJavaType(Class javaType) Set the javaType and the javaTypeCode. | public void | setNulls(boolean nulls) Set the nulls value for all of our columns. | public void | setShared(boolean shared) | public void | setTable(JdbcTable t) Set our table field and recursively all our columns. | public static String | toNameString(JdbcColumn[] cols) Format an array of columns as a comma separated String of the names. | public static SqlExp | toSqlExp(JdbcColumn[] cols, SelectExp se) Flatten cols into a list of expressions to select all the cols. | public static SqlExp | toSqlExp(JdbcColumn[] cols, SelectExp se, SqlExp sList) Flatten cols into a list of expressions to select all the cols. | public SqlExp | toSqlExp(SelectExp se) Get a list of expressions to select all our simple cols. | public String | toString() | public void | updateFrom(JdbcJavaTypeMapping m, JdbcTypeRegistry jdbcTypeRegistry) Set our properties based on the info in the mapping. |
autoinc | public boolean autoinc(Code) | | Is this an autoincrement column?
|
comment | public String comment(Code) | | Comment info for the SQL script (e.g. what field this column is for).
|
converter | public transient JdbcConverter converter(Code) | | This is responsible for getting a suitable java value for this column
from a ResultSet and setting the java value of this column on a
PreparedStatement. It may be null in which case the ResultSet should
be accessed directly using one of the getXXX or setXXX methods.
|
equalityTest | public boolean equalityTest(Code) | | Can values from this column be compared for equality with Java values?
Non-exact data types should have false here (e.g. float and double).
|
foreignKey | public boolean foreignKey(Code) | | Is this column part of a foreign key reference to another table?
|
javaType | public transient Class javaType(Code) | | The java type of this column. This is used to select converters
etc and when the state of this column needs to be stored. For a column
for a persistent field this will just be the type of the field.
|
jdbcType | public int jdbcType(Code) | | The JDBC type of this column from java.sql.Types.
|
length | public int length(Code) | | The length (or precision) of this column.
|
nulls | public boolean nulls(Code) | | Does this column allow nulls?
|
partOfIndex | public boolean partOfIndex(Code) | | Is this column part of an index?
|
pk | public boolean pk(Code) | | Is this column part of the primary key for its table?
|
refField | public transient JdbcSimpleField refField(Code) | | The name of the field this column references. This is used for columns
that reference composite primary key classes to identify which
primary key field the column is for.
|
scale | public int scale(Code) | | The scale of this column (number of digits after the decimal point).
|
shared | public boolean shared(Code) | | Should this column not be created when generating the schema? This
is used when columns are shared between one or more fields.
|
sqlType | public String sqlType(Code) | | The actual SQL type of this column for create scripts etc.
|
table | public transient JdbcTable table(Code) | | The table this column belongs to.
|
JdbcColumn | public JdbcColumn()(Code) | | |
appendEqualsParam | public static void appendEqualsParam(CharBuf s, JdbcColumn[] cols, SqlDriver driver)(Code) | | /**
Append a 'cola = ? [and colb = ?' string for an array of simple cols
to s.
|
appendNames | public void appendNames(CharBuf s)(Code) | | Append a comma list of our column name(s) to s.
|
appendParams | public void appendParams(CharBuf s)(Code) | | Append a comma param list to s (e.g. ?, ?).
|
concat | public static JdbcColumn[] concat(JdbcColumn[] a, JdbcColumn b)(Code) | | Combine an arrays of JdbcColumn's and a single column into one. If
the single column is null then the array is returned as is.
|
copy | public JdbcColumn copy()(Code) | | Duplicate this column but leave the name, table and refField fields of
the duplicates null.
|
createClassIdLiteralExp | public LiteralExp createClassIdLiteralExp(Object val)(Code) | | Create a Literal Exp for a classIdColumn
|
createEqualsParamExp | public static SqlExp createEqualsParamExp(JdbcColumn[] scols, SelectExp se)(Code) | | Get a 'cola = ? [and colb = ?]' expression for an array of simple
columns from se.
|
getColumnNames | public String[] getColumnNames()(Code) | | Get the names of all our component columns.
|
getColumnNames | public void getColumnNames(String[] names)(Code) | | Get the names of all our component columns into the array.
|
getColumnNames | public static String[] getColumnNames(JdbcColumn[] cols)(Code) | | Get the names of all the simple columns in an array of columns.
|
hashCode | public int hashCode()(Code) | | |
isForUpdate | public boolean isForUpdate()(Code) | | Must this column be included in update and insert statements?
|
setColumnNames | public void setColumnNames(String[] names)(Code) | | Set the names of all our component columns from the array.
|
setColumnNames | public static void setColumnNames(JdbcColumn[] cols, String[] names)(Code) | | Set the names of all the simple columns in an array of columns.
|
setJavaType | public void setJavaType(Class javaType)(Code) | | Set the javaType and the javaTypeCode.
|
setNulls | public void setNulls(boolean nulls)(Code) | | Set the nulls value for all of our columns.
|
setShared | public void setShared(boolean shared)(Code) | | |
setTable | public void setTable(JdbcTable t)(Code) | | Set our table field and recursively all our columns.
|
toNameString | public static String toNameString(JdbcColumn[] cols)(Code) | | Format an array of columns as a comma separated String of the names.
|
toSqlExp | public static SqlExp toSqlExp(JdbcColumn[] cols, SelectExp se, SqlExp sList)(Code) | | Flatten cols into a list of expressions to select all the cols. Add the sqlExp
to the end of the created list.
|
toSqlExp | public SqlExp toSqlExp(SelectExp se)(Code) | | Get a list of expressions to select all our simple cols.
|
updateFrom | public void updateFrom(JdbcJavaTypeMapping m, JdbcTypeRegistry jdbcTypeRegistry)(Code) | | Set our properties based on the info in the mapping. This is useful
when a column is based on another column instead of being created
by resolving the mapping (e.g. reference fields).
|
|
|