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


java.lang.Object
   com.jcorporate.expresso.core.dataobjects.jdbc.JoinedDataObject

JoinedDataObject
public class JoinedDataObject implements DataObject,Defineable,Securable,NestableDataObject(Code)
DataObject for use with 1:1 joins between database objects. This class provides a multi-dbobject view of the underlying databases. It is similar to MultiDBObject in that it joins several JDBC-based dataobjects together. The biggest differences are:
  • XML-defined joins. Use XML definitions in your classpath to define the joins. In accordance with jdbc-join_5_1.dtd
  • DBMaint compatible. By refactoring DBMaint so that it is DataObject aware rather than DBObject aware, we gain the ability to manipulate/update the joins in DBMaint directly rather than making readonly database joins.

Limitation: Although the definitions can list LEFT RIGHT and INNER joins, if you are chaining 3 or more tables, you can only LEFT, RIGHT or INNER join the very last relation or all the relations.


author:
   Michael Rimov
author:
  


author:
   Modify by Yves Henri AMAIZO



Field Summary
final public static  intINNER_JOIN
    
final public static  intLEFT_JOIN
    
final public static  intRIGHT_JOIN
    
final public static  intUNSPECIFIED_JOIN
    
protected transient  DBConnectionlocalConnection
    
protected  intmaxRecords
     Max Records to retrieve in a single query.
protected  intoffsetRecord
     The number of records we must skip over before we start reading the ResultSet proper in a searchAndRetrieve.

Constructor Summary
public  JoinedDataObject()
    
public  JoinedDataObject(RequestContext request)
     Creates a new JoinedDataObject object.
public  JoinedDataObject(String xmlFileURL)
    
public  JoinedDataObject(JoinedDataObject definition)
     Constructs a new joined data object to have the same definition as the parameter passed in.
public  JoinedDataObject(JoinedDigesterBean definition, String definitionName)
     Constructor for runtime initialization of custom joined data object.

Method Summary
public  voidadd()
     Adds records to all joined tables based upon the values input.
public synchronized  voidaddOrUpdate(JDBCDataObject testObject)
     Determine if a record with these fields exists already - if so, update.
protected  StringbuildFromClause()
     Builds the 'FROM' clause without the 'from' part.
protected  StringbuildOrderByString(String sortKeys)
     Create the 'ORDER BY' clause in the select statement.
protected  StringbuildSelectFieldsString()
    
protected  StringbuildUpdateFieldString()
    
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.
public  booleancheckAllowed(String requestedFunction)
    
public  voidcheckField(String fieldName, String fieldValue)
    
public  voidclear()
    
protected  JoinedDataObjectMetaDataconstructMetadata()
     Construction method so that you can create custom derived metadata classes derived from JoinedDataObjectMetaData for custom fields, etc.
public  intcount()
     Retrieves the count of any particular join based upon the field values of the data object.
public  voiddelete()
     Deletes the join.
public  booleanequals(Object otherObject)
    
public  booleanfind()
     Find the object.
public  Objectget(String fieldName)
     Get the value object associated with the field specifieed.
public  MapgetAllAttributes()
    
public  DataObject[]getAllNested()
     Retrieve an array of all nested data objects.
public  ObjectgetAttribute(String attributeName)
     Retrieve the attribute for this particular dataobject.
public  StringgetDataContext()
    
public  DataFieldgetDataField(String fieldName)
    
public  ArrayListgetDataObjects()
     This function is useful for low level work where you want to modify the underlying data objects in a behavior diffent that the default behavior of the JoinedDataObject.
public  StringgetDefinitionName()
    
protected  StringgetDistinct(DBConnectionPool contextPool)
     Add the DISTINCT keyword to the query if the join is supposed to be distinct.
public  DataExecutorInterfacegetExecutor()
    
public  StringgetField(String fieldName)
    
public  StringgetFieldFromNestedName(String fieldName)
     Often times, field names for the external interface will be different from the of a nested field name in a data object.
public  DataFieldMetaDatagetFieldMetaData(String fieldName)
     Retrieve the Field MetaData for the specified field name
Parameters:
  fieldName - The name of the field in a 'alias.fieldname' format.
public  PatterngetGlobalMask()
     Get the compiled regular expression for this base data object.
public  JoinedDataObjectMetaDatagetJoinMetaData()
     Type safe return to the metadata for internal use.
public  StringgetKey()
    
public  LocalegetLocale()
    
public  StringgetMappedDataContext()
    
public  intgetMaxRecords()
     Retrieve the maximum number of records.
public  DataObjectMetaDatagetMetaData()
     Retrieve the database object's metadata.
public  DataObjectgetNestedFromFieldName(String fieldName)
     Retrieves a nested dataobject based upon the public field name that the DataObject publishes.
public  intgetOffsetRecord()
     Gets the number of records that be skipped.
public  DataQueryInterfacegetQueryInterface()
     Retrieve the QueryInterface...
public  intgetRequestingUid()
     Retrieve the current UID definition name.
public  StringgetStatus()
     Retrieve the status of the data object the status of the primary data object.
public  ListgetValidValuesList(String fieldName)
     Retrieve a list of valid value object for this particular dbobject
Parameters:
  fieldName - name of the field to retrieve the list for.
public  inthashCode()
     Returns a hash code value for the object.
protected synchronized  voidinit()
     Initialize the dataobject.
protected synchronized  voidinitWithBean(JoinedDigesterBean digesterBean, String definitionName)
    
protected  voidinitializeFromJoinedDigesterBean(JoinedDigesterBean digesterBean, JoinedDataObjectMetaData metadata)
     Initialization step based upon the digester bean either handed in, or loaded from XML data.
protected  voidinitializeXML(JoinedDataObjectMetaData metadata)
     Initialize the metadata based upon XML.
public  voidisAllowed(String requestedFunction)
     Check if the function is allowed.
public  booleanisGlobalMasked()
    
protected  booleanisInitialized()
     Function that checks if initialized.
public  ArrayListsearchAndRetrieveList(String sortOrder)
     Simple query method for querying dataobjects.
public  ArrayListsearchAndRetrieveList()
    
protected  StringselectFieldString(JDBCDataObject oneObj, String fieldName)
    
public  voidset(String fieldName, Object o)
    
public  voidsetAttribute(String attributeName, Object attributeValue)
     Set an attribute.
public  voidsetCaseSensitiveQuery(boolean isCaseSensitiveQuery)
     This tells the buildWhereClause to either respect case (true) or ignore case (false).
public synchronized  voidsetConnection(DBConnection newConnection)
     Set a specific DB connection for use with this JoinedDataObject.
public synchronized  voidsetConnection(DBConnection newConnection, String setupTablesContext)
    

Set a specific DB connection for use with this JoinedDataObject.

public synchronized  voidsetCustomWhereClause(String customWhereClause, boolean append)
    
public  voidsetDataContext(String newContext)
     Sets the data context.
public  voidsetDataField(String fieldName, DataField o)
     Sets the field data for the named field.
public  voidsetDefinitionName(String definitionName)
     Use this method to set the key to the definition name for the Defineable database object.
public  voidsetFieldsWithDefaults()
    
public  voidsetGlobalMask(Pattern newMask)
     Set a regular expression "mask" for this base data object that specifies it's valid values.
public  voidsetLocale(Locale newLocale)
    
public  voidsetMaxRecords(int newMax)
    
public  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  voidsetRequestingUid(int newUid)
     Sets the UID for the operations....
public  voidsetStatus(String newValue)
    
public  voidupdate()
     Update the current join to the database.

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



LEFT_JOIN
final public static int LEFT_JOIN(Code)
Static field to indicate LEFT_JOIN type



RIGHT_JOIN
final public static int RIGHT_JOIN(Code)
Static field to indicate RIGHT_JOIN type



UNSPECIFIED_JOIN
final public static int UNSPECIFIED_JOIN(Code)



localConnection
protected transient 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)
Max Records to retrieve in a single query. 0 means no limit



offsetRecord
protected 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




Constructor Detail
JoinedDataObject
public JoinedDataObject()(Code)
Creates a new JoinedDataObject object, setting db context and UID from thread context (set by servlet filter)



JoinedDataObject
public JoinedDataObject(RequestContext request)(Code)
Creates a new JoinedDataObject object.
Parameters:
  request - based on the controller request object as most likely implemented.



JoinedDataObject
public JoinedDataObject(String xmlFileURL) throws DataException(Code)
Uses the classloader to load the given xml file url as the definition of the JoinedDataObject
Parameters:
  xmlFileURL - the name of the XML file URL
throws:
  DataException - upon error



JoinedDataObject
public JoinedDataObject(JoinedDataObject definition) throws DataException(Code)
Constructs a new joined data object to have the same definition as the parameter passed in.
Parameters:
  definition - the definition to duplicate
throws:
  DataException - upon initialization error



JoinedDataObject
public JoinedDataObject(JoinedDigesterBean definition, String definitionName) throws DataException(Code)
Constructor for runtime initialization of custom joined data object. The definition MUST be unique across the application lifetime, and this constructor has to be only called once. The definition will exist for the lifetime of the object.

Note:You may get strange errors if the definition already exists, it will appear that this constructor didn't 'take' and you'll get a different definition.


Parameters:
  definition - the definition bean to utilize
Parameters:
  definitionName - the name of the definition
throws:
  DataException - upon error




Method Detail
add
public void add() throws DBException(Code)
Adds records to all joined tables based upon the values input. If another record exists [due to relations], the existing record, is skipped.
throws:
  DBException - upon database access error



addOrUpdate
public synchronized void addOrUpdate(JDBCDataObject testObject) throws DBException(Code)
Determine if a record with these fields exists already - if so, update. If not, add a new record.
Parameters:
  testObject - the JDBCObject to add or update.



buildFromClause
protected String buildFromClause() throws DataException(Code)
Builds the 'FROM' clause without the 'from' part. [That way Update works too] java.lang.String
throws:
  DataException - upon construction error

Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $




buildOrderByString
protected String buildOrderByString(String sortKeys) throws DBException(Code)
Create the 'ORDER BY' clause in the select statement.
Parameters:
  sortKeys - pipe delimited field names in the format [alias].[fieldName] the order by string to append to the select statement.
throws:
  DBException - Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $



buildSelectFieldsString
protected String buildSelectFieldsString() throws DBException(Code)
Builds the part of the query that is for describing the fields/names to be selected java.lang.String
throws:
  DBException - if there's an error creating the string.

Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $




buildUpdateFieldString
protected String buildUpdateFieldString() throws DataException(Code)
Builds the update field string portion setting question marks for all the field values to be formatted and parsed later in a Prepared statement java.lang.String
throws:
  DataException - upon error

Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $




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
Parameters:
  myStatement - the preallocated buffer to append to java.lang.String.

Modify by Yves Henri AMAIZO
throws:
  DBException - upon error
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $




checkAllowed
public boolean checkAllowed(String requestedFunction) throws DBException(Code)
See if the current user has permission to perform the permissions
Parameters:
  requestedFunction - (A)dd, (U)pdate, (D)elete, (S)earch boolean: true if the operation is allowed, or false if it is not
See Also:   JoinedDataObject.isAllowed



checkField
public void checkField(String fieldName, String fieldValue) throws DBException(Code)
Retrieve a list of valid value object for this particular dbobject
Parameters:
  fieldName - name of the field to retrieve the list for.
Parameters:
  fieldValue - the String value of the field
throws:
  DBException - upon error
throws:
  IllegalArgumentException - if unable to parse the fieldName



clear
public void clear() throws DBException(Code)
Clears all currently loaded fields



constructMetadata
protected JoinedDataObjectMetaData constructMetadata()(Code)
Construction method so that you can create custom derived metadata classes derived from JoinedDataObjectMetaData for custom fields, etc. JoinedDataObjectMetaData or derived class.



count
public int count() throws DBException(Code)
Retrieves the count of any particular join based upon the field values of the data object. integer for the number of non-null records found.
throws:
  DBException - upon data access error
throws:
  DataException - for metadata access error



delete
public void delete() throws DBException(Code)
Deletes the join. Use with extreme care since you could wipe out referential integrity with other objects.
throws:
  DBException - upon error



equals
public boolean equals(Object otherObject)(Code)
Tests whether two joined DataObjects are equal
Parameters:
  otherObject - the object to compare against true if the objects are equal according to our tests



find
public boolean find() throws DBException(Code)
Find the object. true if the object was found.
throws:
  DBException - upon database access error
See Also:   com.jcorporate.expresso.core.dataobjects.DataObject.find



get
public Object get(String fieldName) throws DataException(Code)
Get the value object associated with the field specifieed.
Parameters:
  fieldName - The field name in a [alias].[fieldname] format the object value of the field.
throws:
  DataException - upon error



getAllAttributes
public Map getAllAttributes()(Code)
Retrieves all the attributes for this data object a map of all the attributes for this instance of the data object



getAllNested
public DataObject[] getAllNested()(Code)
Retrieve an array of all nested data objects. May be empty if there are no nested data objects. Ordering is undefined by this function. Array of DataObjects. Should never return null.



getAttribute
public Object getAttribute(String attributeName)(Code)
Retrieve the attribute for this particular dataobject.
Parameters:
  attributeName - the name of the attribute to get the object value of the attribute or null if it doesn't exist.



getDataContext
public String getDataContext()(Code)
Returns the name of the currently set DataContext java.lang.String



getDataField
public DataField getDataField(String fieldName) throws DBException(Code)
Returns the object embedded within the field keyed by the fieldName parameter
Parameters:
  fieldName - The name of the field to get The object if it isn't null for the data value or null.
throws:
  DBException - upon error



getDataObjects
public ArrayList getDataObjects()(Code)
This function is useful for low level work where you want to modify the underlying data objects in a behavior diffent that the default behavior of the JoinedDataObject. Because of the nature of the object, if you modify the underlying dataobjects in any way, it is recommended that you discard the join that created them since integrity between the dataobjects might be compromised. ArrayList in the same order as the DataObjects are specified inthe Join Definition.



getDefinitionName
public String getDefinitionName()(Code)
Retrieves the definition name in accordance with the java.lang.String



getDistinct
protected String getDistinct(DBConnectionPool contextPool)(Code)
Add the DISTINCT keyword to the query if the join is supposed to be distinct.
Parameters:
  contextPool - the connection pool for the current context the string including distinct keywords if necessary OR an empty string



getExecutor
public DataExecutorInterface getExecutor()(Code)
Use this function to acquire the Executor interface that is associated with this data object DataExecutorInterface or null if no Executor has been associatedwith this object



getField
public String getField(String fieldName) throws DBException(Code)
Retrieve the field value as a String
Parameters:
  fieldName - the name of the field to retrieve Object or null if the field was null
throws:
  DBException - upon error
throws:
  IllegalArgumentException - if fieldname is invalid



getFieldFromNestedName
public String getFieldFromNestedName(String fieldName)(Code)
Often times, field names for the external interface will be different from the of a nested field name in a data object. Use this function to get the internal field name for the DataObject returned by getNestedFromFieldName()
Parameters:
  fieldName - The external name of the field java.lang.String, the field corresponding to the field nameof the data object
throws:
  IllegalArgumentException - if the given field name cannot mapto a field.



getFieldMetaData
public DataFieldMetaData getFieldMetaData(String fieldName)(Code)
Retrieve the Field MetaData for the specified field name
Parameters:
  fieldName - The name of the field in a 'alias.fieldname' format. The metadata for the field name.



getGlobalMask
public Pattern getGlobalMask()(Code)
Get the compiled regular expression for this base data object. the precompiled regular expression mask



getJoinMetaData
public JoinedDataObjectMetaData getJoinMetaData()(Code)
Type safe return to the metadata for internal use. JoinedDataObjectMetaData



getKey
public String getKey()(Code)
Retrieve the key used for this join java.lang.String



getLocale
public Locale getLocale()(Code)
Retrieve the Locale of the current object java.util.Locale



getMappedDataContext
public String getMappedDataContext()(Code)
Retrieve the mapped data context for this data object java.lang.String



getMaxRecords
public int getMaxRecords()(Code)
Retrieve the maximum number of records. the maximum number of records to retreive



getMetaData
public DataObjectMetaData getMetaData()(Code)
Retrieve the database object's metadata. Metadata is a description of the database object, so it contains static information such as as description, field names, field types. Etc.

For implementers of this interface: It is best to store the metadata somewhere rather than recreating it each and every time. For low-memory requirements, a WeakHashMap is recommended

a built DataObjectMetaData for this database object



getNestedFromFieldName
public DataObject getNestedFromFieldName(String fieldName)(Code)
Retrieves a nested dataobject based upon the public field name that the DataObject publishes. For example, in JoinedDataObjects, the field name ""abcd.efgh" represents DataObject 'abcd', and field name 'efgh'.

The actual usage of the naming convention will differ from the, thus you'll need to use getMetaData().getFieldList() to get the names of the fields of a Nestable object to get a valid field Name


Parameters:
  fieldName - the full field name to get the nested data object. DataObject (Actually JDBCDataObjects) or possibly null.
throws:
  IllegalArgumentException - if the field name does not map to anyDataObject



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. The maximum number of records that should be skipped over beforereading the data records.
See Also:   JoinedDataObject.setOffsetRecord(int)



getQueryInterface
public DataQueryInterface getQueryInterface()(Code)
Retrieve the QueryInterface... currently not supported nothing.



getRequestingUid
public int getRequestingUid()(Code)
Retrieve the current UID definition name. integer represeting the user ID



getStatus
public String getStatus()(Code)
Retrieve the status of the data object the status of the primary data object. [It is assumed that theother ones have the same status as the primary]



getValidValuesList
public List getValidValuesList(String fieldName) throws DBException(Code)
Retrieve a list of valid value object for this particular dbobject
Parameters:
  fieldName - name of the field to retrieve the list for. Should beof the format [shortname].[fieldname] java.util.List of valid values
throws:
  DBException - upon error



hashCode
public int hashCode()(Code)
Returns a hash code value for the object. a hash code value for this object.



init
protected synchronized void init() throws DataException(Code)
Initialize the dataobject.
throws:
  DataException - upon error



initWithBean
protected synchronized void initWithBean(JoinedDigesterBean digesterBean, String definitionName) throws DataException(Code)
Initializes the JoinedDataobject with a digester bean and a definition name This is useful for users creating joins on the fly
Parameters:
  digesterBean - Filled out metadata Bean
Parameters:
  definitionName - the name of the definition
throws:
  DataException - upon error



initializeFromJoinedDigesterBean
protected void initializeFromJoinedDigesterBean(JoinedDigesterBean digesterBean, JoinedDataObjectMetaData metadata) throws DataException(Code)
Initialization step based upon the digester bean either handed in, or loaded from XML data.
Parameters:
  digesterBean - the digester bean with populated data
Parameters:
  metadata - the meatadata to load the digester bean into
throws:
  DataException - upon error



initializeXML
protected void initializeXML(JoinedDataObjectMetaData metadata) throws DataException(Code)
Initialize the metadata based upon XML.
Parameters:
  metadata - the metadata object to fill out with the XML data



isAllowed
public void isAllowed(String requestedFunction) throws SecurityException, com.jcorporate.expresso.core.db.DBException(Code)
Check if the function is allowed. It does this by checking all the nested data objects ot make sure that each one is allowed.
Parameters:
  requestedFunction - the function name to check
throws:
  SecurityException - if the method is not allowed.



isGlobalMasked
public boolean isGlobalMasked()(Code)
Return boolean if the data object has a mask set True if the data object mask is set, else false if it is not



isInitialized
protected boolean isInitialized()(Code)
Function that checks if initialized. true if the object has been initialized.



searchAndRetrieveList
public ArrayList searchAndRetrieveList(String sortOrder) throws DBException(Code)
Simple query method for querying dataobjects. Retrieve a list of all objects matching the given criteria.
Parameters:
  sortOrder - A pipe delimited set of fields to sort the resultsetwith. ArrayList of JoinedDataObjects
throws:
  DBException - upon database access error

Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $




searchAndRetrieveList
public ArrayList searchAndRetrieveList() throws DBException(Code)
Retrieve an unsorted array of DataObjects representing the results of the join fields java.util.ArrayList of JoinedDataObject
throws:
  DBException - upon data access error.



selectFieldString
protected String selectFieldString(JDBCDataObject 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
throws:
  DBException - upon data access error

Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/12/01 07:56:43 $




set
public void set(String fieldName, Object o) throws DataException(Code)
Sets the name of the field
Parameters:
  fieldName - the name of the field to set
Parameters:
  o - the object to set.
throws:
  IllegalArgumentException - if filedName is improperly formatted



setAttribute
public void setAttribute(String attributeName, Object attributeValue)(Code)
Set an attribute. Attributes are temporary (e.g. not stored in the DBMS) values associated with this particular DB object instance.
Parameters:
  attributeName - The name of the attribute being defined
Parameters:
  attributeValue - 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.
Parameters:
  isCaseSensitiveQuery - boolean



setConnection
public synchronized void setConnection(DBConnection newConnection) throws DBException(Code)
Set a specific DB connection for use with this JoinedDataObject. If you do not set a connection, the db object will request it's own connection from the appropriate connection pool & release it again after every operation (e.g. add, update, etc). It is important to use your own explicit connection when dealing with a database transactional environment (e.g. commit(), rollback()).
Parameters:
  newConnection - The new DBConnection object to be used by this DB Object



setConnection
public synchronized void setConnection(DBConnection newConnection, String setupTablesContext) throws DBException(Code)

Set a specific DB connection for use with this JoinedDataObject. If you do not set a connection, the object will request it's own connection from the appropriate connection pool & release it again after every operation (e.g. add, update, etc). It is important to use your own explicit connection when dealing with a database transactional environment (e.g. commit(), rollback()).

The difference between this and setConnection(DBConnection) is that this is used for using otherDB capabilities within a transaction. So you use a dbconnection from your other pool, but the setup tables are in a different context


Parameters:
  newConnection - The new DBConnection object to be used by this DB Object
Parameters:
  setupTablesContext - the data context that is used for the expresso setup tables.
See Also:   JoinedDataObject.setConnection(DBConnection)



setCustomWhereClause
public synchronized void setCustomWhereClause(String customWhereClause, boolean append)(Code)
Set a custom WHERE clause
Parameters:
  customWhereClause - the custom where clause to use.
Parameters:
  append - if true the supplied WHERE clause will be appended to the onegenerated, else it will replace it



setDataContext
public void setDataContext(String newContext)(Code)
Sets the data context. Also sets the data context for all the nested data obejcts
Parameters:
  newContext - A valid data context name.



setDataField
public void setDataField(String fieldName, DataField o) throws DataException(Code)
Sets the field data for the named field. This particular implementation assumes that the proper data fields have already been created, and we're only resetting the appropriate types.
Parameters:
  fieldName - The data field to set. It is defined by [shortname].[fieldname]
Parameters:
  o - The Object to set it by.



setDefinitionName
public void setDefinitionName(String definitionName) throws DataException(Code)
Use this method to set the key to the definition name for the Defineable database object. The actual meaning of the definitionName may be different. For example, AutoDBObject's definition name is the database table name. JoinedDataObject's definition name is the classpath URL location to the definition XML file.
Parameters:
  definitionName - java.lang.String, the actual definition of thedataobject.
throws:
  DataException - if the DataObject is unable to initialize itselfwith the given definition name.



setFieldsWithDefaults
public void setFieldsWithDefaults() throws DataException(Code)

throws:
  DataException - upon setField error.



setGlobalMask
public void setGlobalMask(Pattern newMask)(Code)
Set a regular expression "mask" for this base data object that specifies it's valid values. The mask should already be compiled by the regular expression compiler
Parameters:
  newMask - The compiled regular expression mask



setLocale
public void setLocale(Locale newLocale)(Code)
SEt the locale of the object
Parameters:
  newLocale - the new locale



setMaxRecords
public void setMaxRecords(int newMax) throws DBException(Code)
Set the maximum number of records to receive
Parameters:
  newMax - the new maximum number of records to retrieve



setOffsetRecord
public 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



setRequestingUid
public void setRequestingUid(int newUid)(Code)
Sets the UID for the operations.... also sets the UID for all contained elements.
Parameters:
  newUid - the user id for the operation.



setStatus
public void setStatus(String newValue)(Code)
Sets the status of the joined data object
Parameters:
  newValue - see BaseDataObject for possible values



update
public void update() throws DBException(Code)
Update the current join to the database. All this does is search for exiting objects and if it finds it, updates, if not, it
throws:
  DBException - upon database access error



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.