Java Doc for BasePeer.java in  » Database-ORM » Torque » org » apache » torque » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Torque » org.apache.torque.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.torque.util.BasePeer

BasePeer
abstract public class BasePeer implements Serializable(Code)
This is the base class for all Peer classes in the system. Peer classes are responsible for isolating all of the database access for a specific business object. They execute all of the SQL against the database. Over time this class has grown to include utility methods which ease execution of cross-database queries and the implementation of concrete Peers.
author:
   Frank Y. Kim
author:
   John D. McNally
author:
   Brett McLaughlin
author:
   Stephen Haberman
author:
   Martin Poeschl
author:
   Augustin Vidovic
author:
   Henning P. Schmiedehausen
version:
   $Id: BasePeer.java 591648 2007-11-03 16:34:00Z tfischer $

Inner Class :protected interface ProcessCallback

Field Summary
final public static  StringIGNORE_CASE
     Constant criteria key to remove Case Information from search/ordering criteria.
final public static  StringORDER_BY
     Constant criteria key to reference ORDER BY columns.
final public static  StringTABLE_NAME
     Classes that implement this class should override this value.
final protected static  Loglog
    


Method Summary
public static  voidcorrectBooleans(Criteria criteria, TableMap defaultTableMap)
     Checks all columns in the criteria to see whether booleanchar and booleanint columns are queried with a boolean. If yes, the query values are mapped onto values the database does understand, i.e.
public static  voidcreatePreparedStatement(Criteria criteria, StringBuffer queryString, List params)
     Create a new PreparedStatement.
static  QuerycreateQuery(Criteria criteria)
     Method to create an SQL query based on values in a Criteria.
static  StringcreateQueryDisplayString(Criteria criteria)
     Method to create an SQL query for display only based on values in a Criteria.
Parameters:
  criteria - A Criteria.
public static  StringcreateQueryString(Criteria criteria)
     Method to create an SQL query for actual execution based on values in a Criteria.
Parameters:
  criteria - A Criteria.
public static  voiddeleteAll(Connection con, String table, String column, int value)
     Convenience method that uses straight JDBC to delete multiple rows.
public static  voiddeleteAll(String table, String column, int value)
     Convenience method that uses straight JDBC to delete multiple rows.
public static  voiddoDelete(Criteria criteria)
     Method to perform deletes based on values and keys in a Criteria.
protected static  voiddoDelete(Criteria criteria, String tableName)
     Method to perform deletes based on values and keys in a Criteria. This method is protected because it may cause ambiguity between doDelete(Criteria,Connection) and this method.
public static  voiddoDelete(Criteria criteria, Connection con)
     Method to perform deletes based on values and keys in a Criteria.
public static  voiddoDelete(Criteria criteria, String tableName, Connection con)
     Method to perform deletes based on values and keys in a Criteria.
public static  ObjectKeydoInsert(Criteria criteria)
     Method to perform inserts based on values and keys in a Criteria.

If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned.

If the primary key is included in Criteria then that value will be used to insert the row.

If no primary key is included in Criteria then we will try to figure out the primary key from the database map and insert the row with the next available id using util.db.IDBroker.

If no primary key is defined for the table the values will be inserted as specified in Criteria and -1 will be returned.
Parameters:
  criteria - Object containing values to insert.

public static  ObjectKeydoInsert(Criteria criteria, Connection con)
     Method to perform inserts based on values and keys in a Criteria.

If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned.

If the primary key is included in Criteria then that value will be used to insert the row.

If no primary key is included in Criteria then we will try to figure out the primary key from the database map and insert the row with the next available id using util.db.IDBroker.

If no primary key is defined for the table the values will be inserted as specified in Criteria and null will be returned.
Parameters:
  criteria - Object containing values to insert.
Parameters:
  con - A Connection.

public static  ListdoPSSelect(Criteria criteria, Connection con)
     Performs a SQL select using a PreparedStatement.
public static  ListdoPSSelect(Criteria criteria)
    
public static  ListdoSelect(Criteria criteria)
     Returns all results.
Parameters:
  criteria - A Criteria.
public static  ListdoSelect(Criteria criteria, Connection con)
     Returns all results.
Parameters:
  criteria - A Criteria.
Parameters:
  con - A Connection.
public static  voiddoUpdate(Criteria updateValues)
     Convenience method used to update rows in the DB.
public static  voiddoUpdate(Criteria updateValues, Connection con)
     Convenience method used to update rows in the DB.
public static  voiddoUpdate(Criteria selectCriteria, Criteria updateValues)
     Method used to update rows in the DB.
public static  voiddoUpdate(Criteria criteria, Criteria updateValues, Connection con)
     Method used to update rows in the DB.
public static  ListexecuteQuery(String queryString)
     Utility method which executes a given sql statement.
public static  ListexecuteQuery(String queryString, String dbName)
     Utility method which executes a given sql statement.
public static  ListexecuteQuery(String queryString, String dbName, boolean singleRecord)
     Method for performing a SELECT.
public static  ListexecuteQuery(String queryString, boolean singleRecord, Connection con)
     Method for performing a SELECT.
public static  ListexecuteQuery(String queryString, int start, int numberOfResults, String dbName, boolean singleRecord)
     Method for performing a SELECT.
Parameters:
  queryString - A String with the sql statement to execute.
Parameters:
  start - The first row to return.
Parameters:
  numberOfResults - The number of rows to return.
Parameters:
  dbName - The database to connect to.
Parameters:
  singleRecord - Whether or not we want to select only asingle record.
public static  ListexecuteQuery(String queryString, int start, int numberOfResults, boolean singleRecord, Connection con)
     Method for performing a SELECT.
public static  intexecuteStatement(String statementString)
     Utility method which executes a given sql statement.
public static  intexecuteStatement(String statementString, String dbName)
     Utility method which executes a given sql statement.
public static  intexecuteStatement(String statementString, Connection con)
     Utility method which executes a given sql statement.
public static  MapBuildergetMapBuilder(String name)
     This method returns the MapBuilder specified in the name parameter.
public static  ListgetSelectResults(QueryDataSet qds)
     Returns all records in a QueryDataSet as a List of Record objects.
public static  ListgetSelectResults(QueryDataSet qds, boolean singleRecord)
     Returns all records in a QueryDataSet as a List of Record objects.
public static  ListgetSelectResults(QueryDataSet qds, int numberOfResults, boolean singleRecord)
     Returns numberOfResults records in a QueryDataSet as a List of Record objects.
public static  ListgetSelectResults(QueryDataSet qds, int start, int numberOfResults, boolean singleRecord)
     Returns numberOfResults records in a QueryDataSet as a List of Record objects.
protected static  voidhandleMultipleRecords(DataSet ds)
     If the user specified that (s)he only wants to retrieve a single record and multiple records are retrieved, this method is called to handle the situation.
public static  String[]initColumnNames(Column[] columns)
     Convenience method to create a String array of column names.
Parameters:
  columns - A Column[].
public static  String[]initCriteriaKeys(String tableName, String[] columnNames)
     Convenience method to create a String array of criteria keys.
Parameters:
  tableName - Name of table.
Parameters:
  columnNames - A String[].
public static  Column[]initTableColumns(Schema schema)
     Creates a Column array for a table based on its Schema.
Parameters:
  schema - A Schema object.
public static  SchemainitTableSchema(String tableName)
     Sets up a Schema for a table.
public static  SchemainitTableSchema(String tableName, String dbName)
     Sets up a Schema for a table.

Field Detail
IGNORE_CASE
final public static String IGNORE_CASE(Code)
Constant criteria key to remove Case Information from search/ordering criteria.



ORDER_BY
final public static String ORDER_BY(Code)
Constant criteria key to reference ORDER BY columns.



TABLE_NAME
final public static String TABLE_NAME(Code)
Classes that implement this class should override this value.



log
final protected static Log log(Code)
the log





Method Detail
correctBooleans
public static void correctBooleans(Criteria criteria, TableMap defaultTableMap) throws TorqueException(Code)
Checks all columns in the criteria to see whether booleanchar and booleanint columns are queried with a boolean. If yes, the query values are mapped onto values the database does understand, i.e. 0 and 1 for booleanints and N and Y for booleanchar columns.
Parameters:
  criteria - The criteria to be checked for booleanint and booleancharcolumns.
Parameters:
  defaultTableMap - the table map to be used if the table name isnot given in a column.
throws:
  TorqueException - if the database map for the criteria cannot beretrieved.



createPreparedStatement
public static void createPreparedStatement(Criteria criteria, StringBuffer queryString, List params) throws TorqueException(Code)
Create a new PreparedStatement. It builds a string representation of a query and a list of PreparedStatement parameters.
Parameters:
  criteria -
Parameters:
  queryString -
Parameters:
  params -
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



createQuery
static Query createQuery(Criteria criteria) throws TorqueException(Code)
Method to create an SQL query based on values in a Criteria. Note that final manipulation of the limit and offset are performed when the query is actually executed.
Parameters:
  criteria - A Criteria. the sql query
exception:
  TorqueException - Trouble creating the query string.



createQueryDisplayString
static String createQueryDisplayString(Criteria criteria) throws TorqueException(Code)
Method to create an SQL query for display only based on values in a Criteria.
Parameters:
  criteria - A Criteria. the SQL query for display
exception:
  TorqueException - Trouble creating the query string.



createQueryString
public static String createQueryString(Criteria criteria) throws TorqueException(Code)
Method to create an SQL query for actual execution based on values in a Criteria.
Parameters:
  criteria - A Criteria. the SQL query for actual execution
exception:
  TorqueException - Trouble creating the query string.



deleteAll
public static void deleteAll(Connection con, String table, String column, int value) throws TorqueException(Code)
Convenience method that uses straight JDBC to delete multiple rows. Village throws an Exception when multiple rows are deleted.
Parameters:
  con - A Connection.
Parameters:
  table - The table to delete records from.
Parameters:
  column - The column in the where clause.
Parameters:
  value - The value of the column.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



deleteAll
public static void deleteAll(String table, String column, int value) throws TorqueException(Code)
Convenience method that uses straight JDBC to delete multiple rows. Village throws an Exception when multiple rows are deleted. This method attempts to get the default database from the pool.
Parameters:
  table - The table to delete records from.
Parameters:
  column - The column in the where clause.
Parameters:
  value - The value of the column.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doDelete
public static void doDelete(Criteria criteria) throws TorqueException(Code)
Method to perform deletes based on values and keys in a Criteria.
Parameters:
  criteria - The criteria to use.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doDelete
protected static void doDelete(Criteria criteria, String tableName) throws TorqueException(Code)
Method to perform deletes based on values and keys in a Criteria. This method is protected because it may cause ambiguity between doDelete(Criteria,Connection) and this method. It will be made public once doDelete(Criteria, Connection) is removed.
Parameters:
  criteria - The criteria to use.
Parameters:
  tableName - the name of the table to delete records from.If set to null, the name of the table(s) can be extracted fromthe criteria, but this can cause unexpected results.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doDelete
public static void doDelete(Criteria criteria, Connection con) throws TorqueException(Code)
Method to perform deletes based on values and keys in a Criteria.
Parameters:
  criteria - The criteria to use.
Parameters:
  con - A Connection.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doDelete
public static void doDelete(Criteria criteria, String tableName, Connection con) throws TorqueException(Code)
Method to perform deletes based on values and keys in a Criteria.
Parameters:
  criteria - The criteria to use.
Parameters:
  tableName - the name of the table to delete records from.If set to null, the name of the table(s) can be extracted fromthe criteria, but this can cause unexpected results.
Parameters:
  con - A Connection.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doInsert
public static ObjectKey doInsert(Criteria criteria) throws TorqueException(Code)
Method to perform inserts based on values and keys in a Criteria.

If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned.

If the primary key is included in Criteria then that value will be used to insert the row.

If no primary key is included in Criteria then we will try to figure out the primary key from the database map and insert the row with the next available id using util.db.IDBroker.

If no primary key is defined for the table the values will be inserted as specified in Criteria and -1 will be returned.
Parameters:
  criteria - Object containing values to insert. An Object which is the id of the row that was inserted(if the table has a primary key) or null (if the table does nothave a primary key).
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.




doInsert
public static ObjectKey doInsert(Criteria criteria, Connection con) throws TorqueException(Code)
Method to perform inserts based on values and keys in a Criteria.

If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned.

If the primary key is included in Criteria then that value will be used to insert the row.

If no primary key is included in Criteria then we will try to figure out the primary key from the database map and insert the row with the next available id using util.db.IDBroker.

If no primary key is defined for the table the values will be inserted as specified in Criteria and null will be returned.
Parameters:
  criteria - Object containing values to insert.
Parameters:
  con - A Connection. An Object which is the id of the row that was inserted(if the table has a primary key) or null (if the table does nothave a primary key).
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.




doPSSelect
public static List doPSSelect(Criteria criteria, Connection con) throws TorqueException(Code)
Performs a SQL select using a PreparedStatement. Note: this method does not handle null criteria values.
Parameters:
  criteria -
Parameters:
  con - a List of Record objects.
throws:
  TorqueException - Error performing database query.



doPSSelect
public static List doPSSelect(Criteria criteria) throws TorqueException(Code)
Do a Prepared Statement select according to the given criteria
Parameters:
  criteria - a List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doSelect
public static List doSelect(Criteria criteria) throws TorqueException(Code)
Returns all results.
Parameters:
  criteria - A Criteria. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doSelect
public static List doSelect(Criteria criteria, Connection con) throws TorqueException(Code)
Returns all results.
Parameters:
  criteria - A Criteria.
Parameters:
  con - A Connection. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



doUpdate
public static void doUpdate(Criteria updateValues) throws TorqueException(Code)
Convenience method used to update rows in the DB. Checks if a single int primary key is specified in the Criteria object and uses it to perform the udpate. If no primary key is specified an Exception will be thrown.

Use this method for performing an update of the kind:

"WHERE primary_key_id = an int"

To perform an update with non-primary key fields in the WHERE clause use doUpdate(criteria, criteria).
Parameters:
  updateValues - A Criteria object containing values used inset clause.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.




doUpdate
public static void doUpdate(Criteria updateValues, Connection con) throws TorqueException(Code)
Convenience method used to update rows in the DB. Checks if a single int primary key is specified in the Criteria object and uses it to perform the udpate. If no primary key is specified an Exception will be thrown.

Use this method for performing an update of the kind:

"WHERE primary_key_id = an int"

To perform an update with non-primary key fields in the WHERE clause use doUpdate(criteria, criteria).
Parameters:
  updateValues - A Criteria object containing values used inset clause.
Parameters:
  con - A Connection.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.




doUpdate
public static void doUpdate(Criteria selectCriteria, Criteria updateValues) throws TorqueException(Code)
Method used to update rows in the DB. Rows are selected based on selectCriteria and updated using values in updateValues.

Use this method for performing an update of the kind:

WHERE some_column = some value AND could_have_another_column = another value AND so on...
Parameters:
  selectCriteria - A Criteria object containing values used in whereclause.
Parameters:
  updateValues - A Criteria object containing values used in setclause.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.




doUpdate
public static void doUpdate(Criteria criteria, Criteria updateValues, Connection con) throws TorqueException(Code)
Method used to update rows in the DB. Rows are selected based on criteria and updated using values in updateValues.

Use this method for performing an update of the kind:

WHERE some_column = some value AND could_have_another_column = another value AND so on.
Parameters:
  criteria - A Criteria object containing values used in whereclause.
Parameters:
  updateValues - A Criteria object containing values used in setclause.
Parameters:
  con - A Connection.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.




executeQuery
public static List executeQuery(String queryString) throws TorqueException(Code)
Utility method which executes a given sql statement. This method should be used for select statements only. Use executeStatement for update, insert, and delete operations.
Parameters:
  queryString - A String with the sql statement to execute. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeQuery
public static List executeQuery(String queryString, String dbName) throws TorqueException(Code)
Utility method which executes a given sql statement. This method should be used for select statements only. Use executeStatement for update, insert, and delete operations.
Parameters:
  queryString - A String with the sql statement to execute.
Parameters:
  dbName - The database to connect to. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeQuery
public static List executeQuery(String queryString, String dbName, boolean singleRecord) throws TorqueException(Code)
Method for performing a SELECT. Returns all results.
Parameters:
  queryString - A String with the sql statement to execute.
Parameters:
  dbName - The database to connect to.
Parameters:
  singleRecord - Whether or not we want to select only asingle record. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeQuery
public static List executeQuery(String queryString, boolean singleRecord, Connection con) throws TorqueException(Code)
Method for performing a SELECT. Returns all results.
Parameters:
  queryString - A String with the sql statement to execute.
Parameters:
  singleRecord - Whether or not we want to select only asingle record.
Parameters:
  con - A Connection. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeQuery
public static List executeQuery(String queryString, int start, int numberOfResults, String dbName, boolean singleRecord) throws TorqueException(Code)
Method for performing a SELECT.
Parameters:
  queryString - A String with the sql statement to execute.
Parameters:
  start - The first row to return.
Parameters:
  numberOfResults - The number of rows to return.
Parameters:
  dbName - The database to connect to.
Parameters:
  singleRecord - Whether or not we want to select only asingle record. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeQuery
public static List executeQuery(String queryString, int start, int numberOfResults, boolean singleRecord, Connection con) throws TorqueException(Code)
Method for performing a SELECT. Returns all results.
Parameters:
  queryString - A String with the sql statement to execute.
Parameters:
  start - The first row to return.
Parameters:
  numberOfResults - The number of rows to return.
Parameters:
  singleRecord - Whether or not we want to select only asingle record.
Parameters:
  con - A Connection. List of Record objects.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeStatement
public static int executeStatement(String statementString) throws TorqueException(Code)
Utility method which executes a given sql statement. This method should be used for update, insert, and delete statements. Use executeQuery() for selects.
Parameters:
  statementString - A String with the sql statement to execute. The number of rows affected.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeStatement
public static int executeStatement(String statementString, String dbName) throws TorqueException(Code)
Utility method which executes a given sql statement. This method should be used for update, insert, and delete statements. Use executeQuery() for selects.
Parameters:
  statementString - A String with the sql statement to execute.
Parameters:
  dbName - Name of database to connect to. The number of rows affected.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



executeStatement
public static int executeStatement(String statementString, Connection con) throws TorqueException(Code)
Utility method which executes a given sql statement. This method should be used for update, insert, and delete statements. Use executeQuery() for selects.
Parameters:
  statementString - A String with the sql statement to execute.
Parameters:
  con - A Connection. The number of rows affected.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getMapBuilder
public static MapBuilder getMapBuilder(String name) throws TorqueException(Code)
This method returns the MapBuilder specified in the name parameter. You should pass in the full path to the class, ie: org.apache.torque.util.db.map.TurbineMapBuilder. The MapBuilder instances are cached in the TorqueInstance for speed.
Parameters:
  name - name of the MapBuilder A MapBuilder, not null
throws:
  TorqueException - if the Map Builder cannot be instantiated



getSelectResults
public static List getSelectResults(QueryDataSet qds) throws TorqueException(Code)
Returns all records in a QueryDataSet as a List of Record objects. Used for functionality like util.LargeSelect.
See Also:   BasePeer.getSelectResults(QueryDataSet,int,int,boolean)
Parameters:
  qds - the QueryDataSet a List of Record objects
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getSelectResults
public static List getSelectResults(QueryDataSet qds, boolean singleRecord) throws TorqueException(Code)
Returns all records in a QueryDataSet as a List of Record objects. Used for functionality like util.LargeSelect.
See Also:   BasePeer.getSelectResults(QueryDataSet,int,int,boolean)
Parameters:
  qds - the QueryDataSet
Parameters:
  singleRecord - a List of Record objects
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getSelectResults
public static List getSelectResults(QueryDataSet qds, int numberOfResults, boolean singleRecord) throws TorqueException(Code)
Returns numberOfResults records in a QueryDataSet as a List of Record objects. Starting at record 0. Used for functionality like util.LargeSelect.
See Also:   BasePeer.getSelectResults(QueryDataSet,int,int,boolean)
Parameters:
  qds - the QueryDataSet
Parameters:
  numberOfResults -
Parameters:
  singleRecord - a List of Record objects
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getSelectResults
public static List getSelectResults(QueryDataSet qds, int start, int numberOfResults, boolean singleRecord) throws TorqueException(Code)
Returns numberOfResults records in a QueryDataSet as a List of Record objects. Starting at record start. Used for functionality like util.LargeSelect.
Parameters:
  qds - The QueryDataSet to extract resultsfrom.
Parameters:
  start - The index from which to start retrievingRecord objects from the data set.
Parameters:
  numberOfResults - The number of results to return (or -1 for all results).
Parameters:
  singleRecord - Whether or not we want to select only asingle record. A List of Record objects.
exception:
  TorqueException - If any Exception occurs.



handleMultipleRecords
protected static void handleMultipleRecords(DataSet ds) throws TorqueException(Code)
If the user specified that (s)he only wants to retrieve a single record and multiple records are retrieved, this method is called to handle the situation. The default behavior is to throw an exception, but subclasses can override this method as needed.
Parameters:
  ds - The DataSet which contains multiple records.
exception:
  TorqueException - Couldn't handle multiple records.



initColumnNames
public static String[] initColumnNames(Column[] columns)(Code)
Convenience method to create a String array of column names.
Parameters:
  columns - A Column[]. A String[].



initCriteriaKeys
public static String[] initCriteriaKeys(String tableName, String[] columnNames)(Code)
Convenience method to create a String array of criteria keys.
Parameters:
  tableName - Name of table.
Parameters:
  columnNames - A String[]. A String[].



initTableColumns
public static Column[] initTableColumns(Schema schema)(Code)
Creates a Column array for a table based on its Schema.
Parameters:
  schema - A Schema object. A Column[].



initTableSchema
public static Schema initTableSchema(String tableName)(Code)
Sets up a Schema for a table. This schema is then normally used as the argument for initTableColumns().
Parameters:
  tableName - The name of the table. A Schema.



initTableSchema
public static Schema initTableSchema(String tableName, String dbName)(Code)
Sets up a Schema for a table. This schema is then normally used as the argument for initTableColumns
Parameters:
  tableName - The propery name for the database in theconfiguration file.
Parameters:
  dbName - The name of the database. A Schema.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.