Java Doc for JDBCExecutor.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.JDBCExecutor

JDBCExecutor
public class JDBCExecutor implements DataExecutorInterface(Code)
Initial separation of DBObjects from the underlying JDBC code that gets executed. This is part number 1 where we move a lot of the JDBC code over to this helper class. For round #1 iteration, we're assuming that the valueObject is actually a DBObject that implements the DataObject interface (which it does). This is because we're interested in getting something working and demonstratable, and then slowly flesh out the DataObject interface so that we can eventually completely prune this class completely away from the DBObject class and work strictly with the DataObject Interface.
author:
   Michael Rimov
author:
   Yves Henri AMAIZO
since:
   Expresso 5.0


Field Summary
public static  intLONGBINARY_READ_DEFAULT_SIZE
    
final public static transient  StringLONGVARBINARY_TYPE
    
final public static transient  StringLONGVARCHAR_TYPE
    
final public static transient  StringVARBINARY_TYPE
    

Constructor Summary
public  JDBCExecutor()
    

Method Summary
public  voidadd(DataObject valueObject)
    
public  voidaddBatch(List valueObjectList)
    
public  voidaddBatch(List valueObjectList, boolean addChangedFieldsOnly)
    
protected  StringbuildPreparedAddSQL(DataObject oneObjectType, boolean addChangedFieldsOnly)
     Helper Function to build a prepared statement's SQL for an ADD statement.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement.
protected  StringbuildPreparedDeleteSQL(DataObject oneObjectType, boolean deleteWithSetFieldsOnly)
     Helper function to build a prepared delete statement for batch deletes.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement.
protected  StringbuildPreparedStoreProcedureSQL(DataObject oneObjectType)
     Helper Function to build a prepared statement's SQL for running STore Procedure statement.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement.
protected  StringbuildPreparedUpdateSQL(DataObject oneObjectType, boolean updateChangedFieldsOnly)
     Helper function to build a prepared update statement for batch updates.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement.
protected  voidbuildStoreProcedureCallableStatement(DBObject criteria, CallableStatement myCallableStatement)
     Build and return a FastStringBuffer ring consisting of an SQL 'where' clause using the current field values as criteria for the search.
public  voiddelete(DataObject valueObject)
     Takes a DataObject and deletes it from the underlying data source. Note: The current implementation only expects a DBObject and actually routes the call back to that object.
public  voiddeleteAll(DataObject valueObject, boolean deleteChangedCache)
     Takes a DataObject and deletes it from the underlying data source. Note: The current implementation only expects a DBObject and actually routes the call back to that object.
public  voiddeleteBatch(List valueObjectList, boolean deleteWithSetFieldsOnly)
    
public  voiddeleteBatch(List valueObjectList)
    
protected  StringprepareForStorage(DataFieldMetaData oneField, DBObject theObj)
     Format the field for storage into a prepared statement.
protected  StringprepareForStorage(DataFieldMetaData oneField, DBObject theObj, boolean dateFormatted)
     Format the field for storage into a prepared statement.
public  booleanretrieve(DataObject valueObject)
     Retrieves the object with keys specified by the valueObject parameter.
public  voidrunStoreProcedure(DataObject valueObject)
     Run a store procedure identify by the object with keys specified by the valueObject parameter.
public  voidupdate(DataObject valueObject, boolean updateChangedFieldsOnly)
    
public  voidupdateAll(DataObject valueObject, boolean updateChangedCache)
    
public  voidupdateBatch(List valueObjectList)
    
public  voidupdateBatch(List valueObjectList, boolean updateChangedFieldsOnly)
    

Field Detail
LONGBINARY_READ_DEFAULT_SIZE
public static int LONGBINARY_READ_DEFAULT_SIZE(Code)



LONGVARBINARY_TYPE
final public static transient String LONGVARBINARY_TYPE(Code)



LONGVARCHAR_TYPE
final public static transient String LONGVARCHAR_TYPE(Code)



VARBINARY_TYPE
final public static transient String VARBINARY_TYPE(Code)




Constructor Detail
JDBCExecutor
public JDBCExecutor()(Code)




Method Detail
add
public void add(DataObject valueObject) throws DataException, DuplicateKeyException(Code)
Takes a DataObject and adds it to the underlying data source
Parameters:
  valueObject - the DataObject to add.
throws:
  DataException - upon error adding the object to the data source
throws:
  DuplicateKeyException - if the object already existed in the datasource.

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




addBatch
public void addBatch(List valueObjectList) throws DataException, DuplicateKeyException(Code)
Adds an entire batch of DataObjects to the underlying JDBC data source
Parameters:
  valueObjectList - A list of DataObjects to add to the underlyingdata source NOTE: you will get best performance if valueObjectList isall one dataobject underneath.

WARNING: I DON'T UNDERSTAND WHY LOOP VAR ISN'T USED BELOW, AND SUSPECT THIS METHOD ISN'T DOING ALL IT PURPORTS TO DO; SEE "todo" (Larry Hamel, 3/03)
throws:
  DataException - upon error communicating with the underlying data source
throws:
  DuplicateKeyException - if one of the records was already in thedata source




addBatch
public void addBatch(List valueObjectList, boolean addChangedFieldsOnly) throws DataException, DuplicateKeyException(Code)
Adds an entire batch of DataObjects to the underlying JDBC data source
Parameters:
  valueObjectList - A list of DataObjects to add to the underlyingdata source NOTE: you will get best performance if valueObjectList isall one dataobject underneath.
Parameters:
  addChangedFieldsOnly - flag to signify if only fields whose valuehas changed should be included in the add.

WARNING: I DON'T UNDERSTAND WHY LOOP VAR ISN'T USED BELOW, AND SUSPECT THIS METHOD ISN'T DOING ALL IT PURPORTS TO DO; SEE "todo" (Larry Hamel, 3/03)
throws:
  DataException - upon error communicating with the underlying data source
throws:
  DuplicateKeyException - if one of the records was already in thedata source




buildPreparedAddSQL
protected String buildPreparedAddSQL(DataObject oneObjectType, boolean addChangedFieldsOnly) throws DBException(Code)
Helper Function to build a prepared statement's SQL for an ADD statement.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement. Only metadata about the DataObject is used.
Parameters:
  addChangedFieldsOnly - flag to signify if only fields whose valuehas changed should be included in the add. a FastStringBuffer containing the build sql statement
throws:
  DBException - upon error

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




buildPreparedDeleteSQL
protected String buildPreparedDeleteSQL(DataObject oneObjectType, boolean deleteWithSetFieldsOnly) throws DBException(Code)
Helper function to build a prepared delete statement for batch deletes.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement. Only metadata about the DataObject is used. A FastStringBuffer containing the proper SQL to createa preparedStatement
throws:
  DBException - upon error

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




buildPreparedStoreProcedureSQL
protected String buildPreparedStoreProcedureSQL(DataObject oneObjectType) throws DBException(Code)
Helper Function to build a prepared statement's SQL for running STore Procedure statement.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement. Only metadata about the DataObject is used. a FastStringBuffer containing the build sql statement
throws:
  DBException - upon error



buildPreparedUpdateSQL
protected String buildPreparedUpdateSQL(DataObject oneObjectType, boolean updateChangedFieldsOnly) throws DBException(Code)
Helper function to build a prepared update statement for batch updates.
Parameters:
  oneObjectType - A single DataObject that is used to model the preparedstatement. Only metadata about the DataObject is used.
Parameters:
  updateChangedFieldsOnly - true if the changed fields should be theonly ones sent through the SQL query. A FastStringBuffer containing the proper SQL to createa preparedStatement
throws:
  DBException - upon error

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




buildStoreProcedureCallableStatement
protected void buildStoreProcedureCallableStatement(DBObject criteria, CallableStatement myCallableStatement) throws DataException(Code)
Build and return a FastStringBuffer ring 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:
  criteria - the JDBCDataObject to build from
Parameters:
  myCallableStatement - the statement A FastStringBuffer containing the "where" clause for the SQL statement
throws:
  DataException - upon error



delete
public void delete(DataObject valueObject) throws DataException(Code)
Takes a DataObject and deletes it from the underlying data source. Note: The current implementation only expects a DBObject and actually routes the call back to that object. Will be fixed in the future as the interface becomes more rich.
Parameters:
  valueObject - the DataObject to delete.
throws:
  DataException - upon error deleting the object to the data source



deleteAll
public void deleteAll(DataObject valueObject, boolean deleteChangedCache) throws DataException(Code)
Takes a DataObject and deletes it from the underlying data source. Note: The current implementation only expects a DBObject and actually routes the call back to that object. Will be fixed in the future as the interface becomes more rich.
Parameters:
  valueObject - the DataObject to delete.
throws:
  DataException - upon error deleting the object to the data source



deleteBatch
public void deleteBatch(List valueObjectList, boolean deleteWithSetFieldsOnly) throws DataException(Code)
Updates an entire batch of DataObjects
Parameters:
  valueObjectList - A list of DataObjects to update to the underlyingdata source
Parameters:
  deleteWithSetFieldsOnly - Only include changed fields in the update
throws:
  DataException - upon error updating the data source



deleteBatch
public void deleteBatch(List valueObjectList) throws DataException(Code)
Deletes an entire batch of DataObjects
Parameters:
  valueObjectList - A list of DataObjects to delete to the underlyingdata source
throws:
  DataException - upon error deleting the data source



prepareForStorage
protected String prepareForStorage(DataFieldMetaData oneField, DBObject theObj) throws DBException(Code)
Format the field for storage into a prepared statement. This is similar to the old DBObject.quoteIfNeeded() but it does not insert quotes around the values since the prepared statements will take care of special characters like that
Parameters:
  oneField - The metadata of the field to retrieve
Parameters:
  theObj - The DBObject that contains the data to store. java.lang.String for the appropriate data value.



prepareForStorage
protected String prepareForStorage(DataFieldMetaData oneField, DBObject theObj, boolean dateFormatted) throws DBException(Code)
Format the field for storage into a prepared statement. This is similar to the old DBObject.quoteIfNeeded() but it does not insert quotes around the values since the prepared statements will take care of special characters like that
Parameters:
  oneField - The metadata of the field to retrieve
Parameters:
  theObj - The DBObject that contains the data to store. java.lang.String for the appropriate data value.



retrieve
public boolean retrieve(DataObject valueObject) throws DataException(Code)
Retrieves the object with keys specified by the valueObject parameter. This has the same semantics as DBObject's retrieve method.
Parameters:
  valueObject - the DataObject who's keys are already set to retrieve true if the data object was successfully retrieved
throws:
  DataException - Modify by Yves Henri AMAIZO
since:
   $DatabaseSchema $Date: 2004/11/18 02:03:27 $



runStoreProcedure
public void runStoreProcedure(DataObject valueObject) throws DataException(Code)
Run a store procedure identify by the object with keys specified by the valueObject parameter.
Parameters:
  valueObject - the DataObject who's keys are already set to retrieve true if the data object was successfully retrieved



update
public void update(DataObject valueObject, boolean updateChangedFieldsOnly) throws DataException(Code)
Takes a DataObject and updates it to the underlying data source
Parameters:
  valueObject - the DataObject to update.
Parameters:
  updateChangedFieldsOnly - if true only modified fields (isChanged = true)will be included in the update
throws:
  DataException - upon error updating the object to the data source

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




updateAll
public void updateAll(DataObject valueObject, boolean updateChangedCache) throws DataException(Code)
Takes a DataObject and updates all to the underlying data source
Parameters:
  valueObject - the DataObject to update.
Parameters:
  updateChangedCache - if true only modified fields (isChanged = true)will be included in the update
throws:
  DataException - upon error updating the object to the data source

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




updateBatch
public void updateBatch(List valueObjectList) throws DataException(Code)
Updates an entire batch of DataObjects
Parameters:
  valueObjectList - A list of DataObjects to update to the underlyingdata source
throws:
  DataException - upon error updating the data source



updateBatch
public void updateBatch(List valueObjectList, boolean updateChangedFieldsOnly) throws DataException(Code)
Updates an entire batch of DataObjects
Parameters:
  valueObjectList - A list of DataObjects to update to the underlyingdata source
Parameters:
  updateChangedFieldsOnly - flag to signify if only fields whose valuehas changed should be included in the update.
throws:
  DataException - upon error updating the data source



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.