Java Doc for MultiDBObject.java in  » J2EE » Expresso » com » jcorporate » expresso » core » dbobj » 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 » J2EE » Expresso » com.jcorporate.expresso.core.dbobj 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jcorporate.expresso.core.dbobj.MultiDBObject

All known Subclasses:   com.jcorporate.expresso.core.dbobj.MultiDBObjectTransaction,
MultiDBObject
public class MultiDBObject (Code)
This class handles joins the 'old' way. It is not deprectated, but
See Also:   com.jcorporate.expresso.core.dataobjects.jdbc.JoinedDataObject
See Also:    for a more modern, flexible approach to joins
See Also:   


See Also:   A MultiDBObject is a group of dbobjects that are "related" - e.g. defined
See Also:   as being part of a foreign-key/primary-key relationship. This may be
See Also:   master/detail or a more complex relationship, but it can be expressed as a
See Also:   "join" operation between the tables.
See Also:   


See Also:   After establishing the relationships between the objects, the MultiDBObject
See Also:   can have search criteria set for it & searchAndRetrieve operations done just
See Also:   like a 'regular' DBObject, but these operations affect the entire related
See Also:   group of objects. At the moment, MultiDBObjects are read-only, though that
See Also:   may change in the future.
See Also:   


See Also:   Add 'model' objects, which may have criteria already set in their fields for a search,
See Also:   via addDBObj(). After a query (via searchAndRetrieveList()),
See Also:   each resulting MultiDBObject instance represents a
See Also:   'join' row, and has its own encapsulated instances of whatever DBObject
See Also:   models have been set with addDBObj()
See Also:   before the query. In order to access these instances, use getDBObject().
See Also:   


See Also:   Creation date: (9/18/00 11:32:03 AM)
See Also:   author Michael Nash



Field Summary
final protected static  intINNER_JOIN
    
final protected static  intLEFT_JOIN
    
final protected static  intRIGHT_JOIN
    
final protected static  StringSHORT_NAME
    
protected  DBConnectionlocalConnection
    
protected  intmaxRecords
    
protected transient  intoffsetRecord
     The number of records we must skip over before we start reading the ResultSet proper in a searchAndRetrieve.

Constructor Summary
public  MultiDBObject()
     MultiDBObject constructor.
public  MultiDBObject(ControllerRequest request)
    

Method Summary
public  voidaddDBObj(String dbobjClassName, String shortName)
     Add a DB Object to the objects being used for this multidbobj query.
public  voidaddDBObj(DBObject oneDBObj, String shortName)
    
public  DBObjectassembleObject(String shortName)
     (assumes retrieval from DB has occurred) assemble a given object, one retrieved by the join, getting as many fields as found into the returned object.
public  booleanbuildFromClause()
     Build a string consisting of an SQL 'from' clause using the customFromClause, the foreign-key or the join definitions.
public  StringbuildWhereClause(boolean useAllFields)
     Build and return a string consisting of an SQL 'where' clause using the current field values as criteria for the search.
protected  StringbuildWhereClauseBuffer(boolean useAllFields, FastStringBuffer myStatement)
     Build and return a string consisting of an SQL 'where' clause using the current field values as criteria for the search.
protected  StringbuildWhereClauseBuffer(boolean useAllFields, FastStringBuffer myStatement, String dboAlias)
     Build and return a string consisting of an SQL 'where' clause using the current field values as criteria for the search.
public  voidclear()
     Insert the method's description here.
public synchronized  intcount(String expr)
     Just like find, but only retrieves the count, not the records themselves.
public synchronized  intcount()
     Just like find, but only retrieves the count, not the records themselves.
public  booleangetAppendCustomWhereClause()
     Gets the settings of appendCustomWhereClause.
public  ObjectgetAttribute(String attribName)
     Return an "attribute".
public  DBConnectiongetConnection()
    
public  StringgetCustomFromClause()
    
public  StringgetCustomWhereClause()
    
public synchronized  StringgetDBName()
     Return the name of the context/database connection that this DB object is using.
public  DBObjectgetDBObject(String shortName)
     This returns the encapsulated instance of the 'model' DBObject that was provided in 'addDBObj()';

After a searchAndRetrieveList(), each MultiDBObject in the list has, encapsulated, an object of each type which was previously added as a model.

public synchronized  StringgetDataContext()
     Return the name of the context/database connection that this DB object is using.
public  StringgetField(String shortName, String fieldName)
    
public  BigDecimalgetFieldBigDecimal(String shortName, String fieldName)
    
public  DategetFieldDate(String shortName, String fieldName)
    
public  StringgetFieldDecimalFormatted(String shortName, String fieldName, String formatPattern)
    
public  doublegetFieldDouble(String shortName, String fieldName)
    
public  floatgetFieldFloat(String shortName, String fieldName)
    
public  intgetFieldInt(String shortName, String fieldName)
    
public  longgetFieldLong(String shortName, String fieldName)
    
public  intgetMaxRecords()
     A DB Object can be told to only retrieve a certain number of records.
public  intgetOffsetRecord()
     Gets the number of records that be skipped.
public  booleangetShortNameAsAlias()
     Get whether the shortName specified when a DBObject is added is also used as an alias for the table in the query.
protected  MultiDBObjectgetThisMultiDBObj()
    
public  booleanisFieldNull(String shortName, String fieldName)
    
public synchronized  ListmakeDirectQueryList(String sqlQuery, int fieldCount)
    
protected  StringmakeLimitationStub(DBConnection theConnection)
     Creates the limitation syntax optimisation stub to embed inside the SQL command that performs search and retrieve.

This method takes the limitation syntax string and performs a string replacement on the following tokens

  • %offset%

  • the number of rows in the ResultSet to skip before reading the data.

  • %maxrecord%

  • the maximum number of rows to read from the ResultSet. Also known as the rowlength.

  • %endrecord%

  • the last record of in the ResultSet that the search and retrieved should retrieve.
public synchronized  ListsearchAndRetrieveList(String sortKeyString)
    
public synchronized  ListsearchAndRetrieveList()
    
public  StringselectFieldString(DBObject oneObj, String fieldName)
    
public synchronized  voidsetAppendCustomWhereClause(boolean newValue)
     Specify if the customWhereClause should be appended to a generated whereClause.
public synchronized  voidsetAttribute(String attribName, Object attribValue)
     Set an attribute.
public  voidsetCaseSensitiveQuery(boolean isCaseSensitiveQuery)
     This tells the buildWhereClause to either respect case (true) or ignore case (false).
public  voidsetConnection(DBConnection connection)
    
public synchronized  voidsetCustomFromClause(String newCustomFrom)
     Specify a custom "from" clause for the SQL used to retrieve records for this object.
public synchronized  voidsetCustomWhereClause(String newCustomWhere)
     Specify a custom "where" clause for the SQL used to retrieve records for this object.
public synchronized  voidsetCustomWhereClause(String newCustomWhere, boolean append)
     Specify a custom "where" clause for the SQL used to retrieve records for this object.
public synchronized  voidsetDBName(String newOther)
     Set the database name/context for this multi db object.
public  voidsetField(String shortName, String fieldName, String fieldValue)
     Insert the method's description here.
public  voidsetFieldDistinct(String shortName, String fieldName, boolean flag)
    
public  voidsetFieldsToRetrieve(String shortName, String fieldNames)
    
public  voidsetFieldsToRetrieveToNone(String shortName)
    
public  voidsetForeignKey(String shortName, String foreignKey, String shortName2, String primaryKey)
     Insert the method's description here.
public  voidsetInnerJoin(String leftShortName, String leftColumn, String rightShortName, String rightColumn)
     Builds a 'FROM' clause using the 'INNER JOIN' syntax.
public  voidsetLeftJoin(String leftShortName, String leftColumn, String rightShortName, String rightColumn)
     Builds a 'FROM' clause using the 'LEFT JOIN' syntax.
public synchronized  voidsetMaxRecords(int newMax)
     Specify a maximum number of records to be retrieved in any subsequent searchAndRetrieve() call.
public synchronized  voidsetOffsetRecord(int newOffset)
     Specifies the number of records that should be skipped over before any data from the ResultSet is retrieved in any subsequent searchAndRetrieve() call.
public  voidsetRightJoin(String leftShortName, String leftColumn, String rightShortName, String rightColumn)
     Builds a 'FROM' clause using the 'LEFT JOIN' syntax.
public  voidsetSelectDistinct(boolean flag)
    
public  voidsetShortNameAsAlias(boolean flag)
     Specify whether the shortName specified when a DBObject is added is also used as an alias for the table in the query.
protected  voidsetupFields()
     Method to set up the fields for this database object.

Field Detail
INNER_JOIN
final protected static int INNER_JOIN(Code)
Static variables for join type



LEFT_JOIN
final protected static int LEFT_JOIN(Code)



RIGHT_JOIN
final protected static int RIGHT_JOIN(Code)



SHORT_NAME
final protected static String SHORT_NAME(Code)
Constant for shortName DBObject attribute



localConnection
protected DBConnection localConnection(Code)
Local connection that we use if it's initialized, but if it's null we generate our own connection



maxRecords
protected int maxRecords(Code)



offsetRecord
protected transient int offsetRecord(Code)
The number of records we must skip over before we start reading the ResultSet proper in a searchAndRetrieve. 0 means no limit author Peter Pilgrim, Thu Jun 21 10:30:59 BST 2001




Constructor Detail
MultiDBObject
public MultiDBObject() throws DBException(Code)
MultiDBObject constructor. calls setupFields.



MultiDBObject
public MultiDBObject(ControllerRequest request) throws DBException(Code)
MultiDBObject constructor which sets dbname from request




Method Detail
addDBObj
public void addDBObj(String dbobjClassName, String shortName) throws DBException(Code)
Add a DB Object to the objects being used for this multidbobj query. The object is specified with a full classname, then a "short" name used to refer to it in this object. For example, the class name might be com.jcorporate.expresso.services.dbobj.SchemaList, the short name might be "schema".
Parameters:
  dbobjClassName - java.lang.String
Parameters:
  shortName - java.lang.String



addDBObj
public void addDBObj(DBObject oneDBObj, String shortName) throws DBException(Code)



assembleObject
public DBObject assembleObject(String shortName) throws DBException(Code)
(assumes retrieval from DB has occurred) assemble a given object, one retrieved by the join, getting as many fields as found into the returned object. ignores all virtual fields.
Parameters:
  shortName - name of join object DBObject of type given by shortname



buildFromClause
public boolean buildFromClause() throws DBException(Code)
Build a string consisting of an SQL 'from' clause using the customFromClause, the foreign-key or the join definitions. The result will be found in property fromClause. true = success.

Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/11/18 02:03:27 $




buildWhereClause
public String buildWhereClause(boolean useAllFields) throws DBException(Code)
Build and return a string consisting of an SQL 'where' clause using the current field values as criteria for the search. See setCustomWhereClause for information on specifying a more complex where clause.
Parameters:
  useAllFields - True if all fields are to be used,false for only key fields The where clause to use in a query.



buildWhereClauseBuffer
protected String buildWhereClauseBuffer(boolean useAllFields, FastStringBuffer myStatement) throws DBException(Code)
Build and return a string consisting of an SQL 'where' clause using the current field values as criteria for the search. See setCustomWhereClause for information on specifying a more complex where clause.
Parameters:
  useAllFields - True if all fields are to be used, false for only key fields java.lang.String.



buildWhereClauseBuffer
protected String buildWhereClauseBuffer(boolean useAllFields, FastStringBuffer myStatement, String dboAlias) throws DBException(Code)
Build and return a string consisting of an SQL 'where' clause using the current field values as criteria for the search. See setCustomWhereClause for information on specifying a more complex where clause.
Parameters:
  useAllFields - True if all fields are to be used, false for only key fields
Parameters:
  myStatement - Buffer for to build the new where-clause.
Parameters:
  dboAlias - Build the where-clause for this DBObject. If empty,work with all DBObjects that are not marked to be ignored. java.lang.String.



clear
public void clear() throws com.jcorporate.expresso.core.db.DBException(Code)
Insert the method's description here.

Creation date: (10/3/00 10:48:12 AM)
throws:
  com.jcorporate.expresso.core.db.DBException - The exception description.




count
public synchronized int count(String expr) throws DBException(Code)
Just like find, but only retrieves the count, not the records themselves. integer Count of the records matching the criteria
throws:
  DBException - If the search could not be completed



count
public synchronized int count() throws DBException(Code)
Just like find, but only retrieves the count, not the records themselves. integer Count of the records matching the criteria
throws:
  DBException - If the search could not be completed



getAppendCustomWhereClause
public boolean getAppendCustomWhereClause()(Code)
Gets the settings of appendCustomWhereClause. appendCustomWhereClause



getAttribute
public Object getAttribute(String attribName)(Code)
Return an "attribute". Attributes are temporary (e.g. not stored in the DBMS) values associated with this particular DB object instance.
Parameters:
  attribName - The attribute name to check the object associated with this attribute



getConnection
public DBConnection getConnection()(Code)



getCustomFromClause
public String getCustomFromClause()(Code)
Gets the customFromClause customFromClause



getCustomWhereClause
public String getCustomWhereClause()(Code)
Gets the customWhereClause customFromClause



getDBName
public synchronized String getDBName()(Code)
Return the name of the context/database connection that this DB object is using. If none is set, then we are using the "default" database/context. the name of the datacontext



getDBObject
public DBObject getDBObject(String shortName) throws DBException(Code)
This returns the encapsulated instance of the 'model' DBObject that was provided in 'addDBObj()';

After a searchAndRetrieveList(), each MultiDBObject in the list has, encapsulated, an object of each type which was previously added as a model. Fields of this encapsulated object have been filled from whatever was retrieved. The original query object has just the original model instance.
Parameters:
  shortName - the shortname of the model object the instance encapsulated by this MultiDBObjectauthor Abhi
throws:
  DBException - upon error
See Also:   MultiDBObject.addDBObj(String,String)
See Also:   Creation date: (02/01/2002 9:33 AM)




getDataContext
public synchronized String getDataContext()(Code)
Return the name of the context/database connection that this DB object is using. If none is set, then we are using the "default" database/context. the name of the datacontext



getField
public String getField(String shortName, String fieldName) throws DBException(Code)
Get the actual DBField value specified by fieldname

Creation date: (9/18/00 11:37:10 AM)
Parameters:
  shortName - the shortname of the field
Parameters:
  fieldName - name of the field to retrieve The value of the field/




getFieldBigDecimal
public BigDecimal getFieldBigDecimal(String shortName, String fieldName) throws DBException(Code)
Returns a BigDecimal object author Peter Pilgrim date Wed Jul 24 19:36:37 BST 2002



getFieldDate
public Date getFieldDate(String shortName, String fieldName) throws DBException(Code)



getFieldDecimalFormatted
public String getFieldDecimalFormatted(String shortName, String fieldName, String formatPattern) throws DBException(Code)



getFieldDouble
public double getFieldDouble(String shortName, String fieldName) throws DBException(Code)
Returns a double object author Peter Pilgrim date Wed Jul 24 19:36:37 BST 2002



getFieldFloat
public float getFieldFloat(String shortName, String fieldName) throws DBException(Code)



getFieldInt
public int getFieldInt(String shortName, String fieldName) throws DBException(Code)



getFieldLong
public long getFieldLong(String shortName, String fieldName) throws DBException(Code)



getMaxRecords
public int getMaxRecords()(Code)
A DB Object can be told to only retrieve a certain number of records. If a "max records" value has been specified, this method provides access to it. The maximum number of records that should be retrieved, or zeroif no max has been set



getOffsetRecord
public int getOffsetRecord()(Code)
Gets the number of records that be skipped. The offset records. A DB Object can be told to skip a certain number of records, before reading records from the ResultSet.

author Peter Pilgrim, Thu Jun 21 10:30:59 BST 2001 The maximum number of records that should beskipped over before reading the data records.
See Also:   MultiDBObject.setOffsetRecord(int)




getShortNameAsAlias
public boolean getShortNameAsAlias()(Code)
Get whether the shortName specified when a DBObject is added is also used as an alias for the table in the query. True if short name is used as an alias for the table



getThisMultiDBObj
protected MultiDBObject getThisMultiDBObj() throws DBException(Code)
Construct a new MultiDBObject new MultiDBObject
throws:
  DBException - upon error



isFieldNull
public boolean isFieldNull(String shortName, String fieldName) throws DBException(Code)
true if the given field is null



makeDirectQueryList
public synchronized List makeDirectQueryList(String sqlQuery, int fieldCount) throws DBException(Code)
Execute custom SQL query
Parameters:
  sqlQuery - The SQL query
Parameters:
  fieldCount - The number of fields returned by the query A list of recordlists
throws:
  DBException - If the query could not be completed



makeLimitationStub
protected String makeLimitationStub(DBConnection theConnection)(Code)
Creates the limitation syntax optimisation stub to embed inside the SQL command that performs search and retrieve.

This method takes the limitation syntax string and performs a string replacement on the following tokens

  • %offset%

  • the number of rows in the ResultSet to skip before reading the data.

  • %maxrecord%

  • the maximum number of rows to read from the ResultSet. Also known as the rowlength.

  • %endrecord%

  • the last record of in the ResultSet that the search and retrieved should retrieve. The end record number is equal to ( %offset% + %maxrecord% - 1 )

author Peter Pilgrim, Thu Jun 21 10:30:59 BST 2001
Parameters:
  theConnection - the db connection to make this stub from the limitation syntax stub string
See Also:   MultiDBObject.searchAndRetrieve()
See Also:   MultiDBObject.setOffsetRecord(int)
See Also:   MultiDBObject.setMaxRecords(int)




searchAndRetrieveList
public synchronized List searchAndRetrieveList(String sortKeyString) throws DBException(Code)
Search and retrieve in a particular order
Parameters:
  sortKeyString - A pipe-delimited list of key fields to sortthe returned set by A list of new database objects retrieved by the search
throws:
  DBException - If the search could not be completed



searchAndRetrieveList
public synchronized List searchAndRetrieveList() throws DBException(Code)
Search and retrieve in a particular order A list of new database objects retrieved by the search
throws:
  DBException - If the search could not be completed



selectFieldString
public String selectFieldString(DBObject oneObj, String fieldName) throws DBException(Code)
Build an appropriate String for use in the select part of an SQL statement
Parameters:
  oneObj - Database object containing the field
Parameters:
  fieldName - The name of the field to be handled The portion of the select clause with the appropriate functionwrapped around it



setAppendCustomWhereClause
public synchronized void setAppendCustomWhereClause(boolean newValue)(Code)
Specify if the customWhereClause should be appended to a generated whereClause.
Parameters:
  newValue - true = append to whereClause, else overwrite it.



setAttribute
public synchronized void setAttribute(String attribName, Object attribValue)(Code)
Set an attribute. Attributes are temporary (e.g. not stored in the DBMS) values associated with this particular DB object instance.
Parameters:
  attribName - The name of the attribute being defined
Parameters:
  attribValue - The object to store under this attribute name



setCaseSensitiveQuery
public void setCaseSensitiveQuery(boolean isCaseSensitiveQuery)(Code)
This tells the buildWhereClause to either respect case (true) or ignore case (false). You can call this method before doing a search and retreive if you want to match without worrying about case. For example if you where to call this method with isCaseSensitiveQuery = FALSE then this comparison would match in the search:

vendor_name actual value = "My Name"

query value = "my name"

This would match in a search and retrieve.

author Adam Rossi, PlatinumSolutions
Parameters:
  isCaseSensitiveQuery - boolean




setConnection
public void setConnection(DBConnection connection)(Code)

Parameters:
  connection -



setCustomFromClause
public synchronized void setCustomFromClause(String newCustomFrom)(Code)
Specify a custom "from" clause for the SQL used to retrieve records for this object.
Parameters:
  newCustomFrom - java.lang.String



setCustomWhereClause
public synchronized void setCustomWhereClause(String newCustomWhere)(Code)
Specify a custom "where" clause for the SQL used to retrieve records for this object. The where clause 'reset' after each call to searchAndRetrieve() or other retrieval methods, so it must be set just before the call to retrieve the records is made. If no custom where clause is specified by this method, the where clause is built from the field values in the object.

DO NOT INCLUDE THE 'where' KEYWORD. Just what comes after the 'where'
Parameters:
  newCustomWhere - java.lang.String




setCustomWhereClause
public synchronized void setCustomWhereClause(String newCustomWhere, boolean append)(Code)
Specify a custom "where" clause for the SQL used to retrieve records for this object. The where clause 'reset' after each call to searchAndRetrieve() or other retrieval methods, so it must be set just before the call to retrieve the records is made. If no custom where clause is specified by this method, the where clause is built from the field values in the object.
Parameters:
  newCustomWhere - java.lang.String
Parameters:
  append - true if the custom where clause is to be appended to the 'built'where clause; THIS IS DIFFERENT THAN DBObject where 'append' means to append another condition onto the custom where clause



setDBName
public synchronized void setDBName(String newOther) throws DBException(Code)
Set the database name/context for this multi db object. If setDBName is not called, the "default" db name and context is used. See com.jcorporate.expresso.core.misc.ConfigManager for information about multiple contexts. Note that setting a db/context name only affects the object when it allocates it's own db connections - if a specific connection is used (via the setConnection(DBConnection) method) then that connection must be already associated with the correct db/context.
Parameters:
  newOther - The name of the context or database to use



setField
public void setField(String shortName, String fieldName, String fieldValue) throws DBException(Code)
Insert the method's description here.

Creation date: (9/18/00 11:37:10 AM)
Parameters:
  shortName - the short name to set
Parameters:
  fieldName - the fieldname to set
Parameters:
  fieldValue - the value to set the field at.




setFieldDistinct
public void setFieldDistinct(String shortName, String fieldName, boolean flag) throws DBException(Code)
Specify a field to be retieved uniquely froma component DBObject
Parameters:
  shortName - The alias for the DBObject
Parameters:
  fieldName - The field to mark as unique
Parameters:
  flag - true=distinct, flase=all matching rows



setFieldsToRetrieve
public void setFieldsToRetrieve(String shortName, String fieldNames) throws DBException(Code)
Specify a select list of fields to retrieve from a particular DBObject component
Parameters:
  shortName - The alias for the DBObject
Parameters:
  fieldNames - Pipe("|")-separated list of fieldnames



setFieldsToRetrieveToNone
public void setFieldsToRetrieveToNone(String shortName) throws DBException(Code)
Specify to retrieve NO fields from a particular DBObject component

author Zaz Harris, SRI International
Parameters:
  shortName - The alias for the DBObject




setForeignKey
public void setForeignKey(String shortName, String foreignKey, String shortName2, String primaryKey) throws DBException(Code)
Insert the method's description here.

Creation date: (9/18/00 11:36:28 AM)
Parameters:
  shortName - java.lang.String
Parameters:
  foreignKey - java.lang.String
Parameters:
  shortName2 - java.lang.String
Parameters:
  primaryKey - java.lang.String




setInnerJoin
public void setInnerJoin(String leftShortName, String leftColumn, String rightShortName, String rightColumn) throws DBException(Code)
Builds a 'FROM' clause using the 'INNER JOIN' syntax.
Parameters:
  leftShortName - short name for the left hand table.
Parameters:
  leftColumn - name of the column from the left hand table for the JOIN condition
Parameters:
  rightShortName - short name for the right hand table.
Parameters:
  rightColumn - name of the column from the right hand table for the JOIN condition



setLeftJoin
public void setLeftJoin(String leftShortName, String leftColumn, String rightShortName, String rightColumn) throws DBException(Code)
Builds a 'FROM' clause using the 'LEFT JOIN' syntax.
Parameters:
  leftShortName - short name for the left hand table.
Parameters:
  leftColumn - name of the column from the left hand table for the JOIN condition
Parameters:
  rightShortName - short name for the right hand table.
Parameters:
  rightColumn - name of the column from the right hand table for the JOIN condition



setMaxRecords
public synchronized void setMaxRecords(int newMax) throws DBException(Code)
Specify a maximum number of records to be retrieved in any subsequent searchAndRetrieve() call. Records will be retrieved (in the specified sort order) until the specified maximum is reached, then the remainder of the result set is discarded. Specifying zero indicates that all records are to be retrieved.
Parameters:
  newMax - The maximum number of records to retrieve.
throws:
  DBException - If the max number is less than 0



setOffsetRecord
public synchronized void setOffsetRecord(int newOffset) throws DBException(Code)
Specifies the number of records that should be skipped over before any data from the ResultSet is retrieved in any subsequent searchAndRetrieve() call. Records will be skipped over (in the specified sort order) until the record counts is equal to or greater than the offset record. Specifying zero indicates that no records should be skipped over and the ResultSet immediately from the start.
Parameters:
  newOffset - The maximum number of records to retrieve.
throws:
  DBException - If the max number is less than 0

author Peter Pilgrim date Tue Feb 05 23:06:38 GMT 2002




setRightJoin
public void setRightJoin(String leftShortName, String leftColumn, String rightShortName, String rightColumn) throws DBException(Code)
Builds a 'FROM' clause using the 'LEFT JOIN' syntax.
Parameters:
  leftShortName - short name for the left hand table.
Parameters:
  leftColumn - name of the column from the left hand table for the JOIN condition
Parameters:
  rightShortName - short name for the right hand table.
Parameters:
  rightColumn - name of the column from the right hand table for the JOIN condition



setSelectDistinct
public void setSelectDistinct(boolean flag)(Code)
Specify that the DISTINCT keyword for unique rows must be specified right after the SELECT keyword
Parameters:
  flag - true if DISTINCT supported right after SELECT, false (default) otherwise.



setShortNameAsAlias
public void setShortNameAsAlias(boolean flag)(Code)
Specify whether the shortName specified when a DBObject is added is also used as an alias for the table in the query. Should be false by default.
Parameters:
  flag - True if the shortName should be used as an alias



setupFields
protected void setupFields() throws DBException(Code)
Method to set up the fields for this database object. If you wish to set up a MultiDBQuery ahead of time you can use this method in the inherited class to specify the objects and relationships necessary. This become something of the equivilant of a "view" in database terms.
throws:
  DBException - If there is an error setting up the fieldsas requested.



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.