com.scooterframework.orm.sqldataexpress.object
Class RowInfo

java.lang.Object
  extended by com.scooterframework.orm.sqldataexpress.object.RowInfo
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Cursor

public class RowInfo
extends java.lang.Object
implements java.io.Serializable

RowInfo class holds meta data information about a row.

The table field applies only to the SQL query for a single table. If a query is related to multiple tables (joins), This field records the last table in the join statement. To find the table for an individual column, you need to navigate to the ColumnInfo object.

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_PRIMARY_KEY_COLUMN_NAME
           
 
Constructor Summary
RowInfo()
           
RowInfo(java.lang.String name)
           
RowInfo(java.lang.String name, java.sql.ResultSet rs)
           
RowInfo(java.lang.String name, java.sql.ResultSetMetaData rsmd)
           
 
Method Summary
 java.util.List<ColumnInfo> columns()
          returns a list of ColumnInfo instances.
 java.lang.String getCatalog()
          returns catalog
 java.lang.String getColmnDataTypeName(int index)
          returns column data type name index - the first column is 0, the second is 1, ...
 java.lang.String[] getColmnSqlDataTypeNames()
          returns columnSqlDataTypeNames
 java.lang.String getColumnDefaultForEntryScreen(java.lang.String colName)
          Returns default value for data entry screen.
 java.lang.Object[] getColumnDefaults()
          Returns default values for data entry screen.
 ColumnInfo getColumnInfo(int index)
          returns columnInfo specified by column index.
 ColumnInfo getColumnInfo(java.lang.String columnName)
          returns columnInfo specified by column name.
 java.lang.String getColumnJavaClassName(int index)
          returns column java class name index - the first column is 0, the second is 1, ...
 java.lang.String[] getColumnJavaClassNames()
          returns columnJavaClassNames
 java.lang.String getColumnName(int index)
          returns columnName index - the first column is 0, the second is 1, ...
 java.lang.String[] getColumnNames()
          returns columnNames
 int getColumnPositionIndex(java.lang.String colName)
          returns column position index The index for the first column is 0, the second is 1, ...
 int getColumnSqlDataType(int index)
          returns column data type index - the first column is 0, the second is 1, ...
 java.lang.String getDeleteSqlInJDBCStyle()
          returns delete sql of jdbc style
 int getDimension()
          returns dimension
 java.lang.String getName()
          returns name
 java.lang.String[] getPrimaryKeyColumnNames()
          returns primary key columnNames
 java.util.List<java.lang.String> getReadOnlyColumnNames()
          returns readonly columnNames
 java.lang.String getSchema()
          returns schema
 int[] getSqlDataType()
          returns columnSqlDataTypes
 java.lang.String getTable()
          returns table name
 boolean hasPrimaryKey()
          Indicates if there is primary key defined.
 boolean isAuditedForCreate(java.lang.String colName)
          Checks if a column is set to be audited for create operation.
 boolean isAuditedForCreateOrUpdate(java.lang.String colName)
          Checks if a column is set to be audited for create or update operation.
 boolean isAuditedForUpdate(java.lang.String colName)
          Checks if a column is set to be audited for update operation.
 boolean isDateColumn(java.lang.String colName)
          checks whether a column is a date type column.
 boolean isLongTextColumn(java.lang.String colName, int length)
          checks whether a column's length is longer than a specific length.
 boolean isNumericColumn(java.lang.String colName)
          checks whether a column is a numeric type column.
 boolean isPrimaryKeyColumn(java.lang.String colName)
          checks whether a column is primary key column.
 boolean isReadOnlyColumn(java.lang.String colName)
          Checks whether a column is a readonly column.
 boolean isRequiredColumn(java.lang.String colName)
          checks whether a column is a required column.
 boolean isTimestampColumn(java.lang.String colName)
          checks whether a column is a timestamp type column.
 boolean isValidColumnName(java.lang.String testName)
          checks whether a column name exists
 void setCatalog(java.lang.String catalog)
          sets catalog
 void setColumnInfoList(java.util.List<ColumnInfo> newColumnInfoList)
          sets columnInfo list
 void setPrimaryKeyColumns(java.util.List<java.lang.String> primaryKeyNames)
          sets primary key columns for the row
 void setPrimaryKeyColumns(java.util.Set<java.lang.String> primaryKeyNames)
          sets primary key columns for the row
 void setPrimaryKeyColumns(java.lang.String[] primaryKeyNames)
          sets primary key columns for the row
 void setReadOnlyColumn(java.lang.String columnName)
          sets read-only columns for the row If the input column name is not a valid column name, this operation is ignored.
 void setReadOnlyColumns(java.util.Set<java.lang.String> readOnlyNames)
          sets read-only columns for the row Any column names in the input that are not true column names will be discarded.
 void setResultSetMetaDataForTable(java.sql.ResultSet rs)
          sets meta data for the row
 void setResultSetMetaDataForView(java.sql.ResultSet rs)
          sets meta data for the row
 void setSchema(java.lang.String schema)
          sets schema
 void setTable(java.lang.String table)
          sets table name
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PRIMARY_KEY_COLUMN_NAME

public static final java.lang.String DEFAULT_PRIMARY_KEY_COLUMN_NAME
See Also:
Constant Field Values
Constructor Detail

RowInfo

public RowInfo()

RowInfo

public RowInfo(java.lang.String name)

RowInfo

public RowInfo(java.lang.String name,
               java.sql.ResultSet rs)

RowInfo

public RowInfo(java.lang.String name,
               java.sql.ResultSetMetaData rsmd)
Method Detail

getName

public java.lang.String getName()
returns name


getTable

public java.lang.String getTable()
returns table name


setTable

public void setTable(java.lang.String table)
sets table name


getCatalog

public java.lang.String getCatalog()
returns catalog


setCatalog

public void setCatalog(java.lang.String catalog)
sets catalog


getSchema

public java.lang.String getSchema()
returns schema


setSchema

public void setSchema(java.lang.String schema)
sets schema


setResultSetMetaDataForTable

public void setResultSetMetaDataForTable(java.sql.ResultSet rs)
sets meta data for the row


setResultSetMetaDataForView

public void setResultSetMetaDataForView(java.sql.ResultSet rs)
sets meta data for the row


getDimension

public int getDimension()
returns dimension


getColumnName

public java.lang.String getColumnName(int index)
returns columnName index - the first column is 0, the second is 1, ...


getColumnNames

public java.lang.String[] getColumnNames()
returns columnNames


getPrimaryKeyColumnNames

public java.lang.String[] getPrimaryKeyColumnNames()
returns primary key columnNames


getReadOnlyColumnNames

public java.util.List<java.lang.String> getReadOnlyColumnNames()
returns readonly columnNames


getColumnSqlDataType

public int getColumnSqlDataType(int index)
returns column data type index - the first column is 0, the second is 1, ...


getSqlDataType

public int[] getSqlDataType()
returns columnSqlDataTypes


getColmnDataTypeName

public java.lang.String getColmnDataTypeName(int index)
returns column data type name index - the first column is 0, the second is 1, ...


getColmnSqlDataTypeNames

public java.lang.String[] getColmnSqlDataTypeNames()
returns columnSqlDataTypeNames


getColumnJavaClassName

public java.lang.String getColumnJavaClassName(int index)
returns column java class name index - the first column is 0, the second is 1, ...


getColumnJavaClassNames

public java.lang.String[] getColumnJavaClassNames()
returns columnJavaClassNames


getColumnPositionIndex

public int getColumnPositionIndex(java.lang.String colName)
returns column position index The index for the first column is 0, the second is 1, ...


getColumnInfo

public ColumnInfo getColumnInfo(int index)
returns columnInfo specified by column index. The index for the first column is 0, the second is 1, ...


getColumnInfo

public ColumnInfo getColumnInfo(java.lang.String columnName)
returns columnInfo specified by column name.


columns

public java.util.List<ColumnInfo> columns()
returns a list of ColumnInfo instances.


setColumnInfoList

public void setColumnInfoList(java.util.List<ColumnInfo> newColumnInfoList)
sets columnInfo list


setPrimaryKeyColumns

public void setPrimaryKeyColumns(java.lang.String[] primaryKeyNames)
sets primary key columns for the row


setPrimaryKeyColumns

public void setPrimaryKeyColumns(java.util.List<java.lang.String> primaryKeyNames)
sets primary key columns for the row


setPrimaryKeyColumns

public void setPrimaryKeyColumns(java.util.Set<java.lang.String> primaryKeyNames)
sets primary key columns for the row


setReadOnlyColumn

public void setReadOnlyColumn(java.lang.String columnName)
sets read-only columns for the row If the input column name is not a valid column name, this operation is ignored.


setReadOnlyColumns

public void setReadOnlyColumns(java.util.Set<java.lang.String> readOnlyNames)
sets read-only columns for the row Any column names in the input that are not true column names will be discarded.


hasPrimaryKey

public boolean hasPrimaryKey()
Indicates if there is primary key defined.


isAuditedForCreate

public boolean isAuditedForCreate(java.lang.String colName)
Checks if a column is set to be audited for create operation.

Parameters:
colName - the column name to be checked.
Returns:
true if audited

isAuditedForUpdate

public boolean isAuditedForUpdate(java.lang.String colName)
Checks if a column is set to be audited for update operation.

Parameters:
colName - the column name to be checked.
Returns:
true if audited

isAuditedForCreateOrUpdate

public boolean isAuditedForCreateOrUpdate(java.lang.String colName)
Checks if a column is set to be audited for create or update operation.

Parameters:
colName - the column name to be checked.
Returns:
true if audited

isDateColumn

public boolean isDateColumn(java.lang.String colName)
checks whether a column is a date type column.

Parameters:
colName - the column name to be checked.
Returns:
true if the column is of date type.

isTimestampColumn

public boolean isTimestampColumn(java.lang.String colName)
checks whether a column is a timestamp type column.

Parameters:
colName - the column name to be checked.
Returns:
true if the column is of date type.

isNumericColumn

public boolean isNumericColumn(java.lang.String colName)
checks whether a column is a numeric type column.

Parameters:
colName - the column name to be checked.
Returns:
true if the column is of numeric type.

isPrimaryKeyColumn

public boolean isPrimaryKeyColumn(java.lang.String colName)
checks whether a column is primary key column.

Parameters:
colName - the column name to be checked.
Returns:
true if the column is primary key column.

isReadOnlyColumn

public boolean isReadOnlyColumn(java.lang.String colName)
Checks whether a column is a readonly column.

Parameters:
colName - the column name to be checked.
Returns:
true if the column is readonly

isValidColumnName

public boolean isValidColumnName(java.lang.String testName)
checks whether a column name exists

Parameters:
testName - the column name to be checked.
Returns:
true if the column is valid.

isRequiredColumn

public boolean isRequiredColumn(java.lang.String colName)
checks whether a column is a required column. Data for a required column cannot be set to null.

Parameters:
colName - the column name to be checked.
Returns:
true if the column is required.

isLongTextColumn

public boolean isLongTextColumn(java.lang.String colName,
                                int length)
checks whether a column's length is longer than a specific length.

Parameters:
colName - the column name to be checked.
length - the specific length.
Returns:
true if the column's length is longer than the specific length.

getColumnDefaultForEntryScreen

public java.lang.String getColumnDefaultForEntryScreen(java.lang.String colName)
Returns default value for data entry screen.

Parameters:
colName - the column name.
Returns:
string of default values

getColumnDefaults

public java.lang.Object[] getColumnDefaults()
Returns default values for data entry screen.

Returns:
string of default values

getDeleteSqlInJDBCStyle

public java.lang.String getDeleteSqlInJDBCStyle()
returns delete sql of jdbc style


toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
String