JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource.jdbc
Class MetaData

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--com.klg.jclass.datasource.DataSourceTreeNode
              |
              +--com.klg.jclass.datasource.BaseMetaData
                    |
                    +--com.klg.jclass.datasource.jdbc.MetaData
All Implemented Interfaces:
Cloneable, MetaDataModel, MutableTreeNode, Serializable, TreeNode

public class MetaData
extends BaseMetaData
implements Serializable

This MetaData connects to a data source through JDBC. Each instance of this MetaData will have a particular query associated with it. This MetaData will execute that query and cache the results.

When used in the context of the JClass HiGrid, multiple result sets will be cached. These result sets will be based on the same query but with different parameters. When used in JClass HiGrid, this control will be a node in the MetaTree describing the relationships between SQL queries.

Transaction support is built on top of JDBC transactions. To turn on transaction support, "auto commit" must be disabled on the JDBC Connection which is passed into this object. Alternatively, calling setAutoCommit(false) on this MetaData object does the same. Since the same Connection can be shared among one or more MetaData objects calling MetaData.setAutoCommit(false) is redundant on all but the first.

Commits and rollbacks happen on a per Connection basis. If all MetaData objects share the same Connection, modifications spanning levels will be committed as group within one transaction. If multiple Connections objects are used however, say for example, one per MetaData object, RootMetaData.rollbackTransaction() will recurse and rollback transaction on all those MetaData objects which have not yet been successfully committed. If they have been committed, they are not rolledback and their changes are permanent. Those on which a successful commitTransaction has not occurred will be rolled back.

The default is to accept the JDBC default which is "auto commit" is "true". This means that unless the auto commit on the Connection is explicitly set to "false" (by calling setAutoCommit(false) on the Connection object directly or indirectly through MetaData.setAutoCommit(false), each statement will be commit upon completion.

See Also:
Serialized Form

Field Summary
static int DEFAULT_DESIGN_TIME_MAX_ROWS
           
protected static int designTimeMaxRows
           
protected  String driverTable
          The table which drives a row when there is more than one table for a row.
protected  com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection
          Encapsulates JDBC connection.
protected  Vector join_columns
          These are the keys columns used by this control to link to its parent.
protected static int NOT_FOUND
           
protected  int numColumns
          Number of colums for this ds.
protected  boolean open
          Returns true if this instance been initialized.
protected  com.klg.jclass.datasource.jdbc.MetaData parent_control
          This data control's parent.
protected  com.klg.jclass.datasource.util.SqlParser parser
           
protected  com.klg.jclass.datasource.jdbc.PersistorModel persistor
          Class responsible for saving changes to db
protected  String query
          The query statement is used to populate this DataTable
protected  PreparedStatement query_statement
          The JDBC version of the query.
protected  Vector tableColumnIndexes
          Vector of column indexes for a table.
protected  Vector tables
          Vector of database tables for this level.
protected  Hashtable tableToPrimaryKeyMap
          Primary keys.
 
Fields inherited from class com.klg.jclass.datasource.BaseMetaData
binding, bufferSize, cacheChildren, columns, commitPolicy, counter, currentBookmark, currentDataTable, dataModel, deletePermissions, description, idxToColumnMap, initialHashtableSize, insertPermissions, maxRows, metaDataID, provider, showDeletedRows, storeClass, updatePermissions
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Fields inherited from interface com.klg.jclass.datasource.MetaDataModel
COMMIT_LEAVING_ANCESTOR, COMMIT_LEAVING_RECORD, COMMIT_MANUALLY, TYPE_BIG_DECIMAL, TYPE_BOOLEAN, TYPE_BYTE, TYPE_BYTE_ARRAY, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_SHORT, TYPE_SQL_DATE, TYPE_SQL_TIME, TYPE_SQL_TIMESTAMP, TYPE_STRING, TYPE_UTIL_DATE
 
Constructor Summary
MetaData(com.klg.jclass.datasource.DataModel dataModel, com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection)
          General purpose MetaData Constructor.
MetaData(com.klg.jclass.datasource.DataModel dataModel, com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection, String query)
          Convenience root constructor.
MetaData(com.klg.jclass.datasource.DataModel dataModel, com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection, String query, int maxRows)
          Convenience root constructor which allows max rows to be set.
MetaData(com.klg.jclass.datasource.DataModel dataModel, com.klg.jclass.datasource.MetaDataModel parent, com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection)
          After first calling the Root constructor, call this to add master-detail relationships.
 
Method Summary
 void addColumn(com.klg.jclass.datasource.ColumnModel column)
          Adds a column to the list of column objects.
 void addColumnToIdentifiers(String column_name, int position)
          Adds the column to the internal mapping
 void clear()
          For internal use only.
 void commitTransaction()
          Recursivly Commits the transaction.
 com.klg.jclass.datasource.jdbc.DataTable executeQuery()
          Internal method, passes parent row to new DataTables.
 com.klg.jclass.datasource.jdbc.DataTable executeQuery(long parent_row)
          Execute the query.
protected  void finalize()
          Free any lingering jdbc resources.
 boolean getAutoCommit()
          Default implementation: returns true.
 Vector getColumnIndexesForTable(String table)
          Convenience method: returns this table's column indexes.
 com.klg.jclass.datasource.jdbc.DataTableConnection getDataTableConnection()
          Gets this data control's DataTableConnection.
static int getDesignTimeMaxRows()
          Gets the maximum number of rows returned from a database at design-time.
 String getDriverTable()
          Returns the name of the table used to drive requeries when more than one table contributes columns to a row.
 int getDriverTableIndex()
          Returns the index of the driver table in the list of tables.
 Vector getJoinColumns()
          Return the list of join columns.
 Object getNativeMetaData()
          Return the native meta data object.
 com.klg.jclass.datasource.util.SqlParser getParser()
          Returns the parser of the sql query statement.
 com.klg.jclass.datasource.jdbc.PersistorModel getPersistor()
          Return the PersistorModel instance which is to be used to save changes to the data base.
 String getStatement()
          Return the current query statement.
 Vector getTables()
          Convenience method: returns the tables associated with this level.
 String getWhereClause()
          Return the current "where" clause used for getting data.
 boolean isOpen()
          Returns true if this MetaData object has been initialized.
 boolean isUpdateAllowedOnColumn(String column)
          Returns true if an update is allowed on this column.
 void joinOnParentColumn(String parentColumn, String childColumn)
          Adds a key column which will be used to join to this control's parent.
 com.klg.jclass.datasource.jdbc.DataTable open()
          Initializes by causing the ResultSetMetaData to be loaded.
 void rollbackTransaction()
          Recursivly rolls back the transaction.
 void setAutoCommit(boolean value)
          Sets the auto commit flag.
 void setColumnTableRelations(String table, String[] columnNames)
          Explicitly sets the relationships between tables and columns.
 void setConnection(com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection)
          Sets this data control's connection to DataTableConnection.
static void setDesignTimeMaxRows(int max)
          Sets the maximum number of rows returned from a database at design-time.
 void setDriverTable(String driverTable)
          Sets the name of the table whose primary key will be used to requery a row when more than one table contributes columns to a row.
 void setParameter(int number, Object value, int type)
          Sets a particular parameter in the sql statement.
 void setPersistor(String className)
          Sets the class which is to be used for saving data modifications back to the originating data base.
 void setPrimaryKeys(String table, String[] columnNames)
          Sets the primary keys for a table.
 void setStatement(String query)
          Set the SQL statement used to retrieve data.
 void setWhereClause(String whereClause)
          Change or add a where clause for the existing query statement.
 
Methods inherited from class com.klg.jclass.datasource.BaseMetaData
createByteArrayFromBinaryStream, getBinding, getBufferSize, getCacheChildren, getColumnCount, getColumnIdentifier, getColumnIndex, getColumnMap, getColumnObject, getColumnObjects, getCommitPolicy, getCurrentBookmark, getCurrentDataTable, getDataModel, getDeleteAllowed, getDescription, getInsertAllowed, getJavaColumnType, getMaxRows, getMetaID, getProvider, getShowDeletedRows, getStoreClass, getUpdateAllowed, setBinding, setBufferSize, setCacheChildren, setCommitPolicy, setCurrentBookmark, setCurrentDataTable, setDeleteAllowed, setDescription, setInsertAllowed, setMaxRows, setMetaID, setProviderClassName, setShowDeletedRows, setStoreClass, setUpdateAllowed
 
Methods inherited from class com.klg.jclass.datasource.DataSourceTreeNode
getChildren, getFirstChild, getIterator, getIterator, getIterator, getIterator, getLastChild, getNextChild, getPreviousChild, hasChildren, insert, isChildOf, toString
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstLeaf, getIndex, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Field Detail

DEFAULT_DESIGN_TIME_MAX_ROWS

public static final int DEFAULT_DESIGN_TIME_MAX_ROWS
See Also:
Constant Field Values

ds_connection

protected com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection
Encapsulates JDBC connection.


query_statement

protected transient PreparedStatement query_statement
The JDBC version of the query.


numColumns

protected int numColumns
Number of colums for this ds.


tableToPrimaryKeyMap

protected Hashtable tableToPrimaryKeyMap
Primary keys.

Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this field's or method's return type is based on the corresponding com.sun.java.util class.

parent_control

protected com.klg.jclass.datasource.jdbc.MetaData parent_control
This data control's parent.


join_columns

protected Vector join_columns
These are the keys columns used by this control to link to its parent.


tables

protected Vector tables
Vector of database tables for this level.


query

protected String query
The query statement is used to populate this DataTable


tableColumnIndexes

protected Vector tableColumnIndexes
Vector of column indexes for a table. The table is indexed by its own Vector.


open

protected boolean open
Returns true if this instance been initialized.


driverTable

protected String driverTable
The table which drives a row when there is more than one table for a row.


persistor

protected com.klg.jclass.datasource.jdbc.PersistorModel persistor
Class responsible for saving changes to db


parser

protected com.klg.jclass.datasource.util.SqlParser parser

designTimeMaxRows

protected static int designTimeMaxRows

NOT_FOUND

protected static int NOT_FOUND
Constructor Detail

MetaData

public MetaData(com.klg.jclass.datasource.DataModel dataModel,
                com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection)
General purpose MetaData Constructor. Can be used as an alternate to the convenience root meta data constructor to, say, set query parameters on the root. For example,

     MetaData Orders = new MetaData(this, connection);
     Orders.setStatement("select * from Orders where OrderID < ?");
     Orders.setDescription("Orders");
     Orders.setParameter(1, new Integer(OrderIdParameter), java.sql.Types.INTEGER);
     Orders.setMaxRows(5);
     getMetaDataTree().setRoot(Orders);
     getDataTableTree().setRoot(Orders.executeQuery());
 
As this example shows, this constructor does not automatically add this MetaData object to the meta data tree as do the convenience constructors. It must be added manually. Since in this example we created the root-level node we must also manually set the root of the data table tree.

Your query must include all the primary key columns for each table in the select statement, otherwise update anomalies may occur.

Parameters:
dataModel - the DataModel

MetaData

public MetaData(com.klg.jclass.datasource.DataModel dataModel,
                com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection,
                String query,
                int maxRows)
         throws DataModelException
Convenience root constructor which allows max rows to be set. Useful for design time where only a sampling of rows is required. Sets and executes the query to bootstrap root levels of the MetaDataTree and the DataTableTree. This constructor executes the query and sets the resulting DataTable as the root of the DataTableTree. Call this constructor first, then call the MetaData(DataTableConnection, DataModel, MetaData parent) to build the MetaDataTree hierarchy. Sets "open" to true.

Your query must include all the primary key columns for each table in the select statement, otherwise update anomalies may occur.

Parameters:
dataModel - the DataModel to which this meta data object will be added.
query - the String sql query the results of which will form the root level in the MetaDateTree.
maxRows - an int restricting the number of rows this query can return.
Throws:
DataModelException - If the operation fails.

MetaData

public MetaData(com.klg.jclass.datasource.DataModel dataModel,
                com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection,
                String query)
         throws DataModelException
Convenience root constructor. Sets and executes the query to bootstrap root levels of the MetaDataTree and the DataTableTree. This constructor executes the query and sets the resulting DataTable as the root of the DataTableTree. Call this constructor first, then call the MetaData(DataTableConnection, DataModel, MetaData parent) to build the MetaDataTree hierarchy. Sets "open" to true.

Your query must include all the primary key columns for each table in the select statement, otherwise update anomalies may occur.

Parameters:
dataModel - the DataModel to which this meta data object will be added.
query - the String sql query the results of which will form the root level in the MetaDateTree.
Throws:
DataModelException - If the operation fails.

MetaData

public MetaData(com.klg.jclass.datasource.DataModel dataModel,
                com.klg.jclass.datasource.MetaDataModel parent,
                com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection)
After first calling the Root constructor, call this to add master-detail relationships. After calling setStatement() and joinOnParentColumn(), you must call open().

Parameters:
dataModel - the HiGrid DataModel to which this meta data object will be added.
parent - the MetaData object which will be the master of this detail MetaData object.
Method Detail

setConnection

public void setConnection(com.klg.jclass.datasource.jdbc.DataTableConnection ds_connection)
Sets this data control's connection to DataTableConnection.


getDataTableConnection

public com.klg.jclass.datasource.jdbc.DataTableConnection getDataTableConnection()
Gets this data control's DataTableConnection.

Returns:
this data control's DataTableConnection

setStatement

public void setStatement(String query)
                  throws DataModelException
Set the SQL statement used to retrieve data. The statement can be a select statement or a call to stored procedure. For example, setStatement(" select * from products where id = ? ") or setStatement(" {call sp_product_info(?)} ") Note: the primary keys for each table involved in the select statement must be included in the columns selected.

Parameters:
query - a String, the SQL statement to be executed
Throws:
DataModelException - If set fails.

setWhereClause

public void setWhereClause(String whereClause)
                    throws DataModelException
Change or add a where clause for the existing query statement. After setting the query statement by calling setStatement() you can call this method to change (or add) the where clause of the existing statement. This allows you to dynamcially change the selection criteria at run-time.

If this is a child level, you must preserve the number and order of the join parameters (i.e. the order in which they were added by calls to the joinOnParentColumn method).

For example, if your original query was this:


  select * from OrderDetails where OrderID = ?"
 
calling setWhereClause("where OrderID = ? and ProductID = 'AMPB5'") results in this new query:

  select * from OrderDetails where OrderID = ? and ProductID = 'AMPB5'
 

Parameters:
whereClause - a String which is the new where clause
Throws:
DataModelException - If the set fails.
See Also:
joinOnParentColumn(java.lang.String, java.lang.String)

getWhereClause

public String getWhereClause()
Return the current "where" clause used for getting data. This is a convenience method. It calls getParser().getClause(SqlParser.WHERE).

Returns:
a String, the current where clause
See Also:
SqlParser

getStatement

public String getStatement()
Return the current query statement.

Returns:
a String, the current query statement for getting data
See Also:
setStatement(java.lang.String), setWhereClause(java.lang.String)

joinOnParentColumn

public void joinOnParentColumn(String parentColumn,
                               String childColumn)
Adds a key column which will be used to join to this control's parent. For composite keys (that is, tables are joined on more than one column), call this method once for each key column.

Parameters:
childColumn - a String indicating to which child column the parent column should match, required because parent column names can be different than child column names; if the column is aliased, used the alias, otherwise use the name as it appears in the select statement ([catalog.][schema.][table.]column.)

setParameter

public void setParameter(int number,
                         Object value,
                         int type)
                  throws DataModelException
Sets a particular parameter in the sql statement. Statement can be a SQL statement or a stored procedure. Sets the parameters by their position in the original statement.

Parameters:
number - an int indicating the position of the parameter, starts at 1.
value - the Object which is to be set
Throws:
DataModelException - If setParameter fails.

getTables

public Vector getTables()
Convenience method: returns the tables associated with this level. There can be one or many tables (related by one-to-one relationships) for a level.

Returns:
tables a Vector of tables for this level

getColumnIndexesForTable

public Vector getColumnIndexesForTable(String table)
Convenience method: returns this table's column indexes. Through calls to ResultSetMetaData.getTableName() or by explicitly calling setColumnTableRelationships() each Column object in the columns array has its table name property set. This method returns the ordinal positions of this table's columns in the row.

Parameters:
table - the String name of a table; if aliased, used the alias, otherwise use the table name as it appears in the select statement ([catalog.][schema.]table)
Returns:
a Vector of Integers which are the ordinal positions of this table's columns in the row.

executeQuery

public com.klg.jclass.datasource.jdbc.DataTable executeQuery()
                                                      throws DataModelException
Internal method, passes parent row to new DataTables.

Throws:
DataModelException - If executeQuery fails.

executeQuery

public com.klg.jclass.datasource.jdbc.DataTable executeQuery(long parent_row)
                                                      throws DataModelException
Execute the query. Builds a cached version of the result set data.

Returns:
a DataTable of the new results
Throws:
DataModelException - If executeQuery fails

addColumnToIdentifiers

public void addColumnToIdentifiers(String column_name,
                                   int position)
                            throws DataModelException
Adds the column to the internal mapping

Parameters:
column_name - a String which is the column alias or the column name as it appears in the select statement ([catalog.][schema.][table.]column)
Throws:
DataModelException - If the mapping fails.
See Also:
BaseMetaData.addColumn(com.klg.jclass.datasource.ColumnModel)

clear

public void clear()
Description copied from class: BaseMetaData
For internal use only. Changes the query for this data control. For customizer use during design-time.

Specified by:
clear in interface MetaDataModel
Overrides:
clear in class BaseMetaData

setPrimaryKeys

public void setPrimaryKeys(String table,
                           String[] columnNames)
Sets the primary keys for a table. If both JDBC methods getPrimaryKeys() and getBestRowIdentifier() fail to determine the primary keys for a table, you must explicitly set them by calling this method. An exception will be thrown when the primary keys cannot be determined automatically.

Parameters:
table - a String which is the table alias or table name as it appears in the select statement (([catalog.][schema.]table)

open

public com.klg.jclass.datasource.jdbc.DataTable open()
                                              throws DataModelException
Initializes by causing the ResultSetMetaData to be loaded. Does nothing if already open. Performs checks to see that the number of join_columns equals the number of question mark place holders. Also checks that for unique column names.

Throws:
DataModelException - If the operation fails.

setColumnTableRelations

public void setColumnTableRelations(String table,
                                    String[] columnNames)
                             throws DataModelException
Explicitly sets the relationships between tables and columns. If introspection fails to determine the association between tables and their columns (when there is more than one table to a level), or you wish to override the assocations, say to exculde a column in the update statement, use this method. This method must be called for each table. For example, if SalesOrder and Store are joined in a one-to-one relationship for a level, these would be the necessary calls. In this example the MetaData object is called Orders. Orders.setColumnTableRelations("SalesOrder", new String[] {"id","store_id","cust_id","ship_via","purchase_order_number","order_date","order_total"}); Orders.setColumnTableRelations("Store", new String[] {"store_store_id","address","phone_number","name"}); Or for a single table on a level the call would be, Customer.setColumnTableRelations("Customer", new String[] {"*"}); The "*" means all columns are from the Customer table.

Parameters:
table - a String, the name to which (a subset of the columns belong); use the table name as it appears in the FROM clause; don't use alias
Throws:
DataModelException - If the operation fails.

isOpen

public boolean isOpen()
Returns true if this MetaData object has been initialized.

Returns:
true if this MetaData object has been opened, false otherwise.
See Also:
open

setDriverTable

public void setDriverTable(String driverTable)
Sets the name of the table whose primary key will be used to requery a row when more than one table contributes columns to a row. The default is to use the first table in the list of tables. The driver table is the table whose primary key is used to requery the row, the other tables join to this table.

Parameters:
driverTable - a String, the table alias or name as it appears in the select statement ([catalog.][schema.]table)

getDriverTable

public String getDriverTable()
Returns the name of the table used to drive requeries when more than one table contributes columns to a row. The driver table is the table whose primary key is used to requery the row, the other tables join to this table.

Returns:
a String which is the driver table name.

getDriverTableIndex

public int getDriverTableIndex()
Returns the index of the driver table in the list of tables. Default is to use the first table. The driver table is the table whose primary key is used to requery the row, the other tables join to this table.

Returns:
an int which is the index of the driver table in the tables list.

setAutoCommit

public void setAutoCommit(boolean value)
                   throws DataModelException
Sets the auto commit flag. If the underlying data source supports transactions and this flag is set to false, a transaction will wrap data modifications. The default is to not attempt to wrap modifications in a transaction.

Specified by:
setAutoCommit in interface MetaDataModel
Overrides:
setAutoCommit in class BaseMetaData
Throws:
DataModelException - If the operation fails.

getAutoCommit

public boolean getAutoCommit()
                      throws DataModelException
Default implementation: returns true. Must be overridden in specific implementations if transactions are supported and enabled. Return true if the transaction capabilities of the underlying data source are to be used when saving modifications (transactions are supported and enabled). If the underlying data source supports transactions and this capability has been enabled, data modifications will be wrapped in a transaction which can be committed or rolled back.

Specified by:
getAutoCommit in interface MetaDataModel
Overrides:
getAutoCommit in class BaseMetaData
Throws:
DataModelException - If the operation fails.
See Also:
commitTransaction(), rollbackTransaction()

rollbackTransaction

public void rollbackTransaction()
                         throws DataModelException
Recursivly rolls back the transaction. If the underlying data source supports transactions and transactions have been enabled, calling this method will roll back all pending transactions on the data source, otherwise it does nothing.

Specified by:
rollbackTransaction in interface MetaDataModel
Overrides:
rollbackTransaction in class BaseMetaData
Throws:
DataModelException - If rollback fails.
See Also:
MetaDataModel.getAutoCommit()

commitTransaction

public void commitTransaction()
                       throws DataModelException
Recursivly Commits the transaction. If the underlying data source supports transactions and transactions have been enabled, calling this method will commit all pending transactions on the data source, otherwise it does nothing.

Specified by:
commitTransaction in interface MetaDataModel
Overrides:
commitTransaction in class BaseMetaData
Throws:
DataModelException - If commit fails.
See Also:
MetaDataModel.getAutoCommit()

isUpdateAllowedOnColumn

public boolean isUpdateAllowedOnColumn(String column)
                                throws DataModelException
Returns true if an update is allowed on this column.

Specified by:
isUpdateAllowedOnColumn in interface MetaDataModel
Overrides:
isUpdateAllowedOnColumn in class BaseMetaData
Returns:
true if updates are allowed (by the data model) on this column
Throws:
DataModelException - If primary keys not found.
See Also:
BaseMetaData.getUpdateAllowed(java.lang.String), BaseMetaData.setUpdateAllowed(java.lang.String, boolean)

getParser

public com.klg.jclass.datasource.util.SqlParser getParser()
Returns the parser of the sql query statement. From this you can get the SELECT, FROM, and WHERE clauses of the statement.

Returns:
the parser of the current sql query statement
See Also:
SqlParser

addColumn

public void addColumn(com.klg.jclass.datasource.ColumnModel column)
               throws DataModelException
Adds a column to the list of column objects. Overrides BaseMetaData method of same name.

Specified by:
addColumn in interface MetaDataModel
Overrides:
addColumn in class BaseMetaData
Throws:
DataModelException - If column add fails.
See Also:
BaseMetaData.addColumn(com.klg.jclass.datasource.ColumnModel)

getNativeMetaData

public Object getNativeMetaData()
Return the native meta data object. This is a DataSet in JBuilder and a RelationView in VisualCafe.

Specified by:
getNativeMetaData in interface MetaDataModel
Overrides:
getNativeMetaData in class BaseMetaData
Returns:
this.

setPersistor

public void setPersistor(String className)
                  throws DataModelException
Sets the class which is to be used for saving data modifications back to the originating data base. This class must implement the PersistorModel interface. The default behavior is to use the com.klg.jclass.datasource.jdbc.Persistor class.

Parameters:
className - the name of the class on which a Class.forName(className).newInstance will be done
Throws:
DataModelException - If loading the class fails.

getPersistor

public com.klg.jclass.datasource.jdbc.PersistorModel getPersistor()
Return the PersistorModel instance which is to be used to save changes to the data base.

Returns:
PersistorModel
See Also:
setPersistor(java.lang.String)

setDesignTimeMaxRows

public static void setDesignTimeMaxRows(int max)
Sets the maximum number of rows returned from a database at design-time. It is used to improve the performance at design-time. It has no effect at run-time. (default: 10)

See Also:
Beans.isDesignTime()

getDesignTimeMaxRows

public static int getDesignTimeMaxRows()
Gets the maximum number of rows returned from a database at design-time.

See Also:
setDesignTimeMaxRows(int)

getJoinColumns

public Vector getJoinColumns()
Return the list of join columns.


finalize

protected void finalize()
Free any lingering jdbc resources.

Overrides:
finalize in class Object

Copyright © 2004 Quest Software Inc..
All rights reserved.