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


com.jcorporate.expresso.core.dataobjects.DataObject

All known Subclasses:   com.jcorporate.expresso.core.dataobjects.BaseDataObject,  com.jcorporate.expresso.core.dataobjects.SynchronizedDataObject,  com.jcorporate.expresso.core.dataobjects.jdbc.JoinedDataObject,
DataObject
public interface DataObject extends Cacheable,ContextNested(Code)
This interface represents the basic needs of a dataobject, namely to add, update and delete itself, set it's own fields, and deal with things accordingly

It is currently considered BETA code at this time. It's intention is to provide a refactoring launching point. Until then it is recommended that by and large you use the DBObject class directly unless there is a specific feature that the DataObject interface provides that you need. However, be forewarned that the interface will change. For example, Exceptions will eventually be refactored from DBExceptions to DataExceptions.


author:
   Michael Rimov
since:
   Expresso 5.0


Field Summary
final static  StringSTATUS_CURRENT
     Status constant indicating that this dbobject currently reflects what's in the database back end.
final static  StringSTATUS_DELETED
     Status indicating that this DBObject has been deleted.
final static  StringSTATUS_NEW
     Constant describing that this dbobject is new.
final static  StringSTATUS_UPDATED
     Status constant indicating that this dbobject has been modified and does not match the back-end database.


Method Summary
 voidadd()
     Adds the record to the defined data source.
 voidcheckField(String fieldName, String fieldValue)
     Check that a given value is valid for a given field. This method is overriden by specific DBObjects to do their own field-level validations - they should also call super in order to do the standard stuff.
 voidclear()
    
 intcount()
     Just like find, but only retrieves the count, not the records themselves.
 voiddelete()
     Deletes this defined record.
 booleanequals(Object otherObject)
     Checks to see if two data objects are equal.
 booleanfind()
    
 Objectget(String fieldName)
    
 MapgetAllAttributes()
     Returns a Read Only Map containing all the current attributes set for this particular data object instance.
 ObjectgetAttribute(String attributeName)
     Return an "attribute".
 DataFieldgetDataField(String fieldName)
     Returns the object embedded within the field keyed by the fieldName parameter.
 DataExecutorInterfacegetExecutor()
    
 StringgetField(String fieldName)
    
 DataFieldMetaDatagetFieldMetaData(String fieldName)
     Retrieves the metadata for a particular field name
Parameters:
  fieldName - The name of the field to retrieve the metadata for.
 PatterngetGlobalMask()
    
 java.util.LocalegetLocale()
    
 StringgetMappedDataContext()
     Returns the name of the physical database that we're talking with.
 intgetMaxRecords()
     A DB Object can be told to only retrieve a certain number of records.
 DataObjectMetaDatagetMetaData()
     Retrieve the database object's metadata.
 intgetOffsetRecord()
     Gets the number of records that be skipped.
 DataQueryInterfacegetQueryInterface()
    
 StringgetStatus()
     Retrieve the status code of the dataobject.
 java.util.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.
 booleanisGlobalMasked()
    
 ArrayListsearchAndRetrieveList(String sortOrder)
     Performs a datasource search so that the criteria set in the DataObject is used.
Parameters:
  sortOrder - A pipe delimited string specifying the field(s) to be sorted upon.May be a single field without any pipes.
 ArrayListsearchAndRetrieveList()
     Performs a datasource search so that the criteria set in the DataObject is used.
 voidset(String fieldName, Object o)
    
 voidsetAttribute(String attributeName, Object attributeValue)
     Set an attribute.
 voidsetFieldsWithDefaults()
     Sets the fields of this object with the default values defined in the metadata.
 voidsetGlobalMask(Pattern newGlobalMask)
    
 voidsetLocale(java.util.Locale newLocale)
    
 voidsetMaxRecords(int newMax)
     Specify a maximum number of records to be retrieved in any subsequent searchAndRetrieve() call.
 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.
 voidsetStatus(String statusValue)
     Sets the status of the object.
 voidupdate()
    

Field Detail
STATUS_CURRENT
final static String STATUS_CURRENT(Code)
Status constant indicating that this dbobject currently reflects what's in the database back end.



STATUS_DELETED
final static String STATUS_DELETED(Code)
Status indicating that this DBObject has been deleted.



STATUS_NEW
final static String STATUS_NEW(Code)
Constant describing that this dbobject is new.



STATUS_UPDATED
final static String STATUS_UPDATED(Code)
Status constant indicating that this dbobject has been modified and does not match the back-end database.





Method Detail
add
void add() throws DBException(Code)
Adds the record to the defined data source.



checkField
void checkField(String fieldName, String fieldValue) throws DBException(Code)
Check that a given value is valid for a given field. This method is overriden by specific DBObjects to do their own field-level validations - they should also call super in order to do the standard stuff. Every field is automatically checked by this method before the database is updated.
Parameters:
  fieldName - Name of the field to verify
Parameters:
  fieldValue - Value of the field to be evaluated
throws:
  DBException - If the value is not valid



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



count
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



delete
void delete() throws DBException(Code)
Deletes this defined record.



equals
boolean equals(Object otherObject)(Code)
Checks to see if two data objects are equal. This is extremely important in conflict resolution.
Parameters:
  otherObject - the other object to compare to. true if the two objects are considered equal



find
boolean find() throws DBException(Code)
Finds a single record based upon the criteria specified by the DataTransferObject boolean true if a record was found, and the criteria parameteris filled with the first data object found.
throws:
  DBException - upon error performing the search



get
Object get(String fieldName) throws DataException(Code)
Directly gets the DataField Data without having to deal with the DataField itself
Parameters:
  fieldName - the name of the field to get Object or null.



getAllAttributes
Map getAllAttributes()(Code)
Returns a Read Only Map containing all the current attributes set for this particular data object instance. Read Only java.util.Map



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



getDataField
DataField getDataField(String fieldName) throws DBException(Code)
Returns the object embedded within the field keyed by the fieldName parameter. The DataField object maintains metadata and other key items about the field. Its state should not be messed with by the typical program.
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



getExecutor
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
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



getFieldMetaData
DataFieldMetaData getFieldMetaData(String fieldName)(Code)
Retrieves the metadata for a particular field name
Parameters:
  fieldName - The name of the field to retrieve the metadata for. <\u0441ode>DataFieldMetaData the metadata associated with thisfield.
throws:
  IllegalArgumentException - if the fieldName does not exist.



getGlobalMask
Pattern getGlobalMask()(Code)
Retrieve the DBObject's current global mask String



getLocale
java.util.Locale getLocale()(Code)
Retrieve the DBObject's current locale java.util.Locale



getMappedDataContext
String getMappedDataContext()(Code)
Returns the name of the physical database that we're talking with. This is opposed to getDataContext() which returns the security context as well. getMappedDataContext() is strictly used to get at the low level database connection. java.lang.String... the context we've mapped to.



getMaxRecords
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



getMetaData
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



getOffsetRecord
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:   DataObject.setOffsetRecord(int)




getQueryInterface
DataQueryInterface getQueryInterface()(Code)
Use this function to acquire the DataQueryInterface that is associated with this data object [Currently unsupported] DataQueryInterface or null if no QueryInterface has beenassociated with this object



getStatus
String getStatus()(Code)
Retrieve the status code of the dataobject. java.lang.String



getValidValuesList
java.util.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. java.util.List of valid values
throws:
  DBException - upon error



isGlobalMasked
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



searchAndRetrieveList
ArrayList searchAndRetrieveList(String sortOrder) throws DBException(Code)
Performs a datasource search so that the criteria set in the DataObject is used.
Parameters:
  sortOrder - A pipe delimited string specifying the field(s) to be sorted upon.May be a single field without any pipes. java.util.List of objects. May be an empty list if noobjects were found.
throws:
  DBException - upon error performing the search



searchAndRetrieveList
ArrayList searchAndRetrieveList() throws DBException(Code)
Performs a datasource search so that the criteria set in the DataObject is used. There is no specified sort order for this version of the method java.util.List of objects. May be an empty list if noobjects were found.
throws:
  DBException - upon error performing the search



set
void set(String fieldName, Object o) throws DataException(Code)
Directly sets the field value without getting the datafield object
Parameters:
  fieldName - the name of the field to set
Parameters:
  o - the object value to set it to.



setAttribute
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



setFieldsWithDefaults
void setFieldsWithDefaults() throws DataException(Code)
Sets the fields of this object with the default values defined in the metadata. The behavior of this function is such that it only populates fields if there is no current value set. This is the same behavior that existed previously in DefaultAutoElement.
throws:
  DataException - upon setField error.
since:
   Expresso 5.6



setGlobalMask
void setGlobalMask(Pattern newGlobalMask)(Code)
Sets the DataObject's global mask
Parameters:
  newGlobalMask - the New global mask object



setLocale
void setLocale(java.util.Locale newLocale)(Code)
Sets the DataObject's locale
Parameters:
  newLocale - the New locale object



setMaxRecords
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
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




setStatus
void setStatus(String statusValue)(Code)
Sets the status of the object.
Parameters:
  statusValue - the new status code.



update
void update() throws DBException(Code)
Updates the record to the defined datasource



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