Java Doc for PersistentTransaction.java in  » J2EE » Jaffa » org » jaffa » persistence » engines » jdbcengine » datasource » 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 » Jaffa » org.jaffa.persistence.engines.jdbcengine.datasource 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.persistence.engines.jdbcengine.datasource.PersistentTransaction

PersistentTransaction
public class PersistentTransaction (Code)
This class is used to hold a connection to the database. It holds collections of objects to be added, updated, deleted or queried. The UOW will add objects to these collections. The JdbcBridge will utilise the collections to perform the relevant operations. It is important to invoke the close() method, which will free up the pooled connection.



Constructor Summary
public  PersistentTransaction(Database database)
     Creates a PersitentTransaction.

Method Summary
public  voidaddObject(IPersistent object)
     Adds an object to the transaction to be written.
public  voidclose()
     This will free up the underlying pooled connection.
public  voidcommit()
     Commits all changes executed against the persistent store.
public  voiddeleteObject(IPersistent object)
     Adds an object to the transaction to be deleted.
public  CollectiongetAdds()
     Returns a Collection of Persistent objects to be added to the persistent store.
public  DataSourcegetDataSource()
     Returns the DataSource holding the Connection.
public  CollectiongetDeletes()
     Returns a Collection of Persistent objects to be deleted from the persistent store.
public  CollectiongetQueries()
     Returns a Collection of Criteria objects to be used for querying the persistent store.
public  CollectiongetUpdates()
     Returns a Collection of Persistent objects to be updated in the persistent store.
public  voidqueryObject(Criteria object)
     Adds a Criteria object to the transaction for performing a query.
public  voidrollback()
     Rollback the changes executed against the persistent store.
public  voidupdateObject(IPersistent object)
     Adds an object to the transaction to be updated.


Constructor Detail
PersistentTransaction
public PersistentTransaction(Database database) throws DataSourceCreationException(Code)
Creates a PersitentTransaction. It uses the input Database configuration to acquire a Connection to the database.
Parameters:
  database - The object with the requisite information for acquiring a Connection to the database.
throws:
  DataSourceCreationException - if the connection could not be acquired.




Method Detail
addObject
public void addObject(IPersistent object) throws AddFailedException, IllegalPersistentStateRuntimeException(Code)
Adds an object to the transaction to be written. The PreAdd trigger for will be invoked and the domain object will be validated before the addition to the transaction.
Parameters:
  object - the object to be created.
throws:
  AddFailedException - if any error occurs during the validation of the persistent object.
throws:
  IllegalPersistentStateRuntimeException - this RuntimeException will be thrown if the domain object has been submitted to the UOW for an Add/Update/Delete and commit hasnt yet been performed.



close
public void close() throws SQLException(Code)
This will free up the underlying pooled connection. It will first do an implicit rollback().
throws:
  SQLException - if any database error occurs.



commit
public void commit() throws SQLException(Code)
Commits all changes executed against the persistent store.
throws:
  SQLException - if any database error occurs.



deleteObject
public void deleteObject(IPersistent object) throws DeleteFailedException, IllegalPersistentStateRuntimeException(Code)
Adds an object to the transaction to be deleted. The PreDelete trigger will be invoked before the deletion from the transaction.
Parameters:
  object - the object to be deleted.
throws:
  DeleteFailedException - if any error occurs during the process.
throws:
  IllegalPersistentStateRuntimeException - this RuntimeException will be thrown if the domain object has been submitted to the UOW for an Add/Update/Delete and commit hasnt yet been performed.



getAdds
public Collection getAdds()(Code)
Returns a Collection of Persistent objects to be added to the persistent store. a Collection of objects to be added.



getDataSource
public DataSource getDataSource()(Code)
Returns the DataSource holding the Connection. the DataSource.



getDeletes
public Collection getDeletes()(Code)
Returns a Collection of Persistent objects to be deleted from the persistent store. a Collection of objects to be deleted.



getQueries
public Collection getQueries()(Code)
Returns a Collection of Criteria objects to be used for querying the persistent store. a Collection of Criteria objects to be used for queries.



getUpdates
public Collection getUpdates()(Code)
Returns a Collection of Persistent objects to be updated in the persistent store. a Collection of objects to be updated.



queryObject
public void queryObject(Criteria object)(Code)
Adds a Criteria object to the transaction for performing a query.
Parameters:
  object - the Criteria based on which a query is to be performed.



rollback
public void rollback() throws SQLException(Code)
Rollback the changes executed against the persistent store.
throws:
  SQLException - if any database error occurs.



updateObject
public void updateObject(IPersistent object) throws UpdateFailedException, IllegalPersistentStateRuntimeException(Code)
Adds an object to the transaction to be updated. The PreUpdate trigger will be invoked and the domain object will be validated before the updation to the transaction.
Parameters:
  object - the object to be updated.
throws:
  UpdateFailedException - if any error occurs during the validation of the persistent object.
throws:
  IllegalPersistentStateRuntimeException - this RuntimeException will be thrown if the domain object has been submitted to the UOW for an Add/Update/Delete and commit hasnt yet been performed.



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.