|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.cortex.PropertyList atg.cortex.ResultSetProcessor atg.cortex.Query atg.cortex.Cortex
public class Cortex
A Cortex is a subclass of Query in which some properties have been marked as "keys". These keys allow a bean to uniquely identify a set of rows in a set of tables. This allows functions such as inserting, deleting, updating, and selecting to be performed on an object-by-object basis.
Note that this implementation assumes that the columns are confined to a single table, that each property maps to at most one column, and each column maps to at most one property.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
Cortex()
Creates and returns a new Cortex |
Method Summary | |
---|---|
void |
addKey(java.lang.String pKeyPropertyName)
Adds the specified property as one of the primary keys. |
int |
delete(java.sql.Connection pConnection)
Deletes all rows from the class' table. |
int |
delete(java.util.Dictionary pSelector,
boolean pIsAnd,
java.sql.Connection pConnection)
Deletes all rows from the class' tables whose values match the specified selector. |
int |
delete(java.lang.Object[] pObjects,
java.sql.Connection pConnection)
Deletes all rows from the class' table whose primary key matches the primary key of the specified objects. |
int |
delete(java.lang.Object pObject,
java.sql.Connection pConnection)
Deletes all rows from the class' tables whose primary key matches the primary key of the specified object. |
ColumnProperty |
getColumnFromProperty(java.lang.String pPropertyName)
Returns the ColumnProperty corresponding to the specified property, or null if not found. |
java.lang.String |
getColumnNameFromProperty(java.lang.String pPropertyName)
Returns the full column name corresponding to the specified property, or null if not found. |
java.lang.String |
getKey(int pIndex)
Returns the name of the property acting as the key at the specified index. |
int |
getKeyCount()
Returns the number of keys |
java.util.Dictionary |
getPropertyToColumnMap()
Returns the Dictionary mapping property name to ColumnProperty. |
int |
insert(java.util.Dictionary pInsertValues,
java.sql.Connection pConnection)
Inserts a new set row into the class' table, using only the property names and values specified in the given Dictionary. |
int |
insert(java.lang.Object[] pObjects,
java.sql.Connection pConnection)
Inserts a new set of rows into the class' tables. |
int |
insert(java.lang.Object[] pObjects,
java.lang.String[] pPropertyNames,
java.sql.Connection pConnection)
Inserts a new set of rows into the class' tables. |
int |
insert(java.lang.Object pObject,
java.sql.Connection pConnection)
Inserts a new row into the class' tables. |
int |
insert(java.lang.Object pObject,
java.lang.String[] pPropertyNames,
java.sql.Connection pConnection)
Inserts a new row into the class' tables. |
java.lang.Object[] |
select(java.sql.Connection pConnection)
Selects all rows from this Cortex's table. |
java.lang.Object[] |
select(java.util.Dictionary pSelector,
boolean pIsAnd,
java.sql.Connection pConnection)
Searches for the rows in the database that match the specified selector. |
java.lang.Object[] |
select(java.lang.Object[] pObjects,
java.sql.Connection pConnection)
Searches for the specified rows in the database, where each row is selected by the corresponding object in the specified array. |
java.lang.Object |
select(java.lang.Object pObject,
java.sql.Connection pConnection)
Searches for the specified row in the database. |
int |
update(java.util.Dictionary pSelector,
boolean pIsAnd,
java.util.Dictionary pUpdateValues,
java.sql.Connection pConnection)
Updates all rows from the class' tables whose values match the specified selector. |
int |
update(java.lang.Object[] pObjects,
java.sql.Connection pConnection)
Updates all rows in the class' tables whose primary key matches the primary key of the specified objects. |
int |
update(java.lang.Object[] pObjects,
java.lang.String[] pPropertyNames,
java.sql.Connection pConnection)
Updates all rows in the class' tables whose primary key matches the primary key of the specified objects. |
int |
update(java.lang.Object pObject,
java.sql.Connection pConnection)
Updates all rows in the class' tables whose primary key matches the primary key of the specified object. |
int |
update(java.lang.Object pObject,
java.lang.String[] pPropertyNames,
java.sql.Connection pConnection)
Updates all rows in the class' tables whose primary key matches the primary key of the specified object. |
Methods inherited from class atg.cortex.Query |
---|
addColumnProperties, addColumnProperty, getColumnProperties, getColumnProperty, getColumnPropertyCount, getSelectStatement, getTableName, getTableNames |
Methods inherited from class atg.cortex.ResultSetProcessor |
---|
processResultSet, processResultSet, processResultSetRow, processResultSetRow, processResultSetRow |
Methods inherited from class atg.cortex.PropertyList |
---|
addProperties, addProperty, getBeanClass, getBeanClasses, getClassProperties, getProperties, getProperty, getPropertyCount, getPropertyToClassTable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public Cortex()
Method Detail |
---|
public void addKey(java.lang.String pKeyPropertyName)
public int getKeyCount()
public java.lang.String getKey(int pIndex)
public java.util.Dictionary getPropertyToColumnMap()
public ColumnProperty getColumnFromProperty(java.lang.String pPropertyName)
public java.lang.String getColumnNameFromProperty(java.lang.String pPropertyName)
public int insert(java.lang.Object pObject, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the object whose fields are to be to be insertedpConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int insert(java.lang.Object[] pObjects, java.sql.Connection pConnection) throws java.sql.SQLException
pObjects
- the objects whose fields are to be to be insertedpConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int insert(java.lang.Object pObject, java.lang.String[] pPropertyNames, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the object whose fields are to be to be insertedpPropertyNames
- an array of the names of the properties to
be updated.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int insert(java.lang.Object[] pObjects, java.lang.String[] pPropertyNames, java.sql.Connection pConnection) throws java.sql.SQLException
pObjects
- the objects whose fields are to be to be insertedpPropertyNames
- an array of the names of the properties to
be updated.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int insert(java.util.Dictionary pInsertValues, java.sql.Connection pConnection) throws java.sql.SQLException
pInsertValues
- a dictionary of values to be inserted. The
keys of the dictionary are the property names to be inserted, and
the values are the new values to be set for the columns
corresponding to those property names.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int delete(java.sql.Connection pConnection) throws java.sql.SQLException
pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int delete(java.lang.Object pObject, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the object specifying the primary key value of the
objects to be deleted.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int delete(java.lang.Object[] pObjects, java.sql.Connection pConnection) throws java.sql.SQLException
pObjects
- the object specifying the primary key value of the
objects to be deleted.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int delete(java.util.Dictionary pSelector, boolean pIsAnd, java.sql.Connection pConnection) throws java.sql.SQLException
pSelector
- the Dictionary mapping property name to the
value to be matched for that property. Primitive values, such as
"int", should be specified in object form - i.e., "Integer".pIsAnd
- flag indicating whether the entries of the selector
will be placed in an AND clause or OR clause. If true, then only
those rows that match all of the selector criteria will be
returned. Otherwise, rows that match any of the selector
criteria will be returned.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int update(java.lang.Object pObject, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the object specifying the primary key value of the
objects to be deleted, along with the new values to update into
the rows.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int update(java.lang.Object[] pObjects, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the objects specifying the primary key value of the
objects to be updated, along with the new values to update into
the rows.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int update(java.lang.Object pObject, java.lang.String[] pPropertyNames, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the object specifying the primary key value of the
objects to be deleted, along with the new values to update into
the rows.pPropertyNames
- an array of the names of the properties to
be updated.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int update(java.lang.Object[] pObjects, java.lang.String[] pPropertyNames, java.sql.Connection pConnection) throws java.sql.SQLException
pObjects
- the list of objects specifying the primary key
value of the objects to be deleted, along with the new values to
update into the rows.pPropertyNames
- an array of the names of the properties to
be updated.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic int update(java.util.Dictionary pSelector, boolean pIsAnd, java.util.Dictionary pUpdateValues, java.sql.Connection pConnection) throws java.sql.SQLException
pSelector
- the Dictionary mapping property name to the
value to be matched for that property. Primitive values, such as
"int", should be specified in object form - i.e., "Integer".pIsAnd
- flag indicating whether the entries of the selector
will be placed in an AND clause or OR clause. If true, then only
those rows that match all of the selector criteria will be
returned. Otherwise, rows that match any of the selector
criteria will be returned.pUpdateValues
- a dictionary of values to be updated. The
keys of the dictionary are the property names to be updated, and
the values are the new values to be set for the columns
corresponding to those property names.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic java.lang.Object[] select(java.sql.Connection pConnection) throws java.sql.SQLException
pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic java.lang.Object select(java.lang.Object pObject, java.sql.Connection pConnection) throws java.sql.SQLException
pObject
- the object specifying the primary key value of the
object to be found.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic java.lang.Object[] select(java.lang.Object[] pObjects, java.sql.Connection pConnection) throws java.sql.SQLException
pObjects
- the objects specifying the primary key value of
the objects to be found. Each object in the array is used to
select one row from the database, which is returned as a single
object in the return value.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurspublic java.lang.Object[] select(java.util.Dictionary pSelector, boolean pIsAnd, java.sql.Connection pConnection) throws java.sql.SQLException
pSelector
- the Dictionary mapping property name to the
value to be matched for that property. Primitive values, such as
"int", should be specified in object form - i.e., "Integer".pIsAnd
- flag indicating whether the entries of the selector
will be placed in an AND clause or OR clause. If true, then only
those rows that match all of the selector criteria will be
returned. Otherwise, rows that match any of the selector
criteria will be returned.pConnection
- the JDBC connection to use to perform the operation
java.sql.SQLException
- if a database access error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |