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


java.lang.Object
   org.jaffa.persistence.Persistent

All known Subclasses:   org.jaffa.persistence.domainobjects.Item,  org.jaffa.persistence.domainobjects.Condition,  org.jaffa.persistence.domainobjects.CategoryOfInstrument,  org.jaffa.applications.test.modules.material.domain.Item,  org.jaffa.persistence.domainobjects.PartRemarksPicture,  org.jaffa.persistence.engines.jdbcengine.proxy.PersistentDelegate,  org.jaffa.rules.examples.domain.ValidFieldValue,  org.jaffa.persistence.domainobjects.VoucherStoredProcedure,  org.jaffa.persistence.domainobjects.Asset,  org.jaffa.persistence.domainobjects.Part,  org.jaffa.persistence.domainobjects.PartRemarks,  org.jaffa.persistence.domainobjects.PartPicture,
Persistent
abstract public class Persistent implements IPersistent(Code)
Base class for all persistent objects.




Method Summary
protected  IPersistentactualInstance()
     This method simply returns the 'this' object.
protected  voidaddInitialValue(String fieldName, Object initialValue)
     Adds an initial value for a field whenever it is modified.
public  Objectclone()
     Returns a clone of the object.
throws:
  CloneNotSupportedException - if cloning is not supported.
public  intgetLocking()
     Returns the locking strategy for this persistent object.
public  UOWgetUOW()
     Returns the UOW to which this object is associated.
public  booleanisDatabaseOccurence()
     Returns a true value if the object was loaded from the database.
public  booleanisLocked()
     Returns a true value if the underlying database row is locked.
public  booleanisModified()
     Returns a true value if the object had any of its fields updated.
public  booleanisModified(String fieldName)
     Returns a true value if the field has been updated.
Parameters:
  fieldName - the field to check.
public  booleanisQueued()
     Returns a true value if this object has been added/updated/deleted and not yet been committed.
public  voidperformForeignKeyValidations()
     This method ensures that the modified foreign-keys are valid.
public  voidperformPreDeleteReferentialIntegrity()
     This method will perform referential integrity checks before this object is deleted.
public  voidpostAdd()
     This method is triggered by the UOW, after adding this object to the Add-Store.
public  voidpostDelete()
     This method is triggered by the UOW, after adding this object to the Delete-Store.
public  voidpostLoad()
     This method is triggered by the UOW after a query loads this object.
public  voidpostUpdate()
     This method is triggered by the UOW, after adding this object to the Update-Store.
public  voidpreAdd()
     This method is triggered by the UOW, before adding this object to the Add-Store, but after a UOW has been associated to the object.
public  voidpreDelete()
     This method is triggered by the UOW, before adding this object to the Delete-Store.
public  voidpreUpdate()
     This method is triggered by the UOW, before adding this object to the Update-Store.
public  ObjectreturnInitialValue(String fieldName)
     Returns the initial value for a field; i.e.
public  voidsetDatabaseOccurence(boolean databaseOccurence)
     Set the database status of this object.
public  voidsetLocked(boolean locked)
     Set the locked status of this object.
public  voidsetLocking(int locking)
     Set the locking strategy for this persistent object.
public  voidsetModified(boolean modified)
     Set the modified status of this object.
public  voidsetQueued(boolean queued)
     Set the queued status of this object. The Persistence Engine will set the queued status to true on an Add/Update/Delete.
public  voidsetUOW(UOW uow)
     Associates this object to a UOW.
public  StringtoString()
     This returns the state of the object for diagnostic purposes.
protected  voidupdate()
     This method should be invoked by every updateXxx() method of the persistent class, before setting the value. It ensures that a readonly object cannot be updated.



Method Detail
actualInstance
protected IPersistent actualInstance()(Code)
This method simply returns the 'this' object. A proxy implementation will override this method and return the proxy instance. the persistent instance.



addInitialValue
protected void addInitialValue(String fieldName, Object initialValue)(Code)
Adds an initial value for a field whenever it is modified. This method is typically invoked by the updateXyz() method of the extending class. Note: The value will not be added, if the field has already been modified.
Parameters:
  fieldName - the field.
Parameters:
  initialValue - the initial value.



clone
public Object clone() throws CloneNotSupportedException(Code)
Returns a clone of the object.
throws:
  CloneNotSupportedException - if cloning is not supported. This should never happen. a clone of the object.



getLocking
public int getLocking()(Code)
Returns the locking strategy for this persistent object. the locking strategy for this persistent object.



getUOW
public UOW getUOW()(Code)
Returns the UOW to which this object is associated. The UOW



isDatabaseOccurence
public boolean isDatabaseOccurence()(Code)
Returns a true value if the object was loaded from the database. a true value if the object was loaded from the database.



isLocked
public boolean isLocked()(Code)
Returns a true value if the underlying database row is locked. a true value if the underlying database row is locked.



isModified
public boolean isModified()(Code)
Returns a true value if the object had any of its fields updated. a true value if the object had any of its fields updated.



isModified
public boolean isModified(String fieldName)(Code)
Returns a true value if the field has been updated.
Parameters:
  fieldName - the field to check. a true value if the field has been updated.



isQueued
public boolean isQueued()(Code)
Returns a true value if this object has been added/updated/deleted and not yet been committed. a true value if this object has been added/updated/deleted and not yet been committed.



performForeignKeyValidations
public void performForeignKeyValidations() throws ApplicationExceptions, FrameworkException(Code)
This method ensures that the modified foreign-keys are valid. A concrete persistent object should provide the implementation, if its necessary.
throws:
  ApplicationExceptions - if an invalid foreign key is set.
throws:
  FrameworkException - Indicates some system error



performPreDeleteReferentialIntegrity
public void performPreDeleteReferentialIntegrity() throws PreDeleteFailedException(Code)
This method will perform referential integrity checks before this object is deleted. This will cascade delete all composite objects. This will raise an exception if any associated/aggregated objects exist. A concrete persistent object should provide the implementation, if its necessary.
throws:
  PreDeleteFailedException - if any error occurs during the process.



postAdd
public void postAdd() throws PostAddFailedException(Code)
This method is triggered by the UOW, after adding this object to the Add-Store. A concrete persistent object should provide the implementation, if its necessary.
throws:
  PostAddFailedException - if any error occurs during the process.



postDelete
public void postDelete() throws PostDeleteFailedException(Code)
This method is triggered by the UOW, after adding this object to the Delete-Store. A concrete persistent object should provide the implementation, if its necessary.
throws:
  PostDeleteFailedException - if any error occurs during the process.



postLoad
public void postLoad() throws PostLoadFailedException(Code)
This method is triggered by the UOW after a query loads this object. A concrete persistent object should provide the implementation, if its necessary.
throws:
  PostLoadFailedException - if any error occurs during the process.



postUpdate
public void postUpdate() throws PostUpdateFailedException(Code)
This method is triggered by the UOW, after adding this object to the Update-Store. A concrete persistent object should provide the implementation, if its necessary.
throws:
  PostUpdateFailedException - if any error occurs during the process.



preAdd
public void preAdd() throws PreAddFailedException(Code)
This method is triggered by the UOW, before adding this object to the Add-Store, but after a UOW has been associated to the object. This will perform the following tasks: Will invoke the PersistentHelper.exists() to check against duplicate keys. Will invoke the performForeignKeyValidations() method to ensure no invalid foreign-keys are set. Will invoke PersistentHelper.checkMandatoryFields() to perform mandatory field checks. Will invoke the Rules Engine to perform mandatory field checks.
throws:
  PreAddFailedException - if any error occurs during the process.



preDelete
public void preDelete() throws PreDeleteFailedException(Code)
This method is triggered by the UOW, before adding this object to the Delete-Store. This will perform the following tasks: Will invoke the performPreDeleteReferentialIntegrity() method.
throws:
  PreDeleteFailedException - if any error occurs during the process.



preUpdate
public void preUpdate() throws PreUpdateFailedException(Code)
This method is triggered by the UOW, before adding this object to the Update-Store. This will perform the following tasks: Will invoke the performForeignKeyValidations() method to ensure no invalid foreign-keys are set. Will invoke PersistentHelper.checkMandatoryFields() to perform mandatory field checks. Will invoke the Rules Engine to perform mandatory field checks.
throws:
  PreUpdateFailedException - if any error occurs during the process.



returnInitialValue
public Object returnInitialValue(String fieldName)(Code)
Returns the initial value for a field; i.e. before it was modified. A null will be returned if the field was never modified. Use the isModified() method to determine if the field was modified. A null will also be returned, if the field had a null value to begin with.
Parameters:
  fieldName - the field. the initial value for a field; i.e. before it was modified.



setDatabaseOccurence
public void setDatabaseOccurence(boolean databaseOccurence)(Code)
Set the database status of this object. Note: This method is for internal use by the Persistence Engine only.
Parameters:
  databaseOccurence - the database status.



setLocked
public void setLocked(boolean locked)(Code)
Set the locked status of this object. Note: This method is for internal use by the Persistence Engine only.
Parameters:
  locked - the locked status.



setLocking
public void setLocking(int locking)(Code)
Set the locking strategy for this persistent object. Note: This method is for internal use by the Persistence Engine only.
Parameters:
  locking - the locking strategy.



setModified
public void setModified(boolean modified)(Code)
Set the modified status of this object. Note: This method is for internal use by the Persistence Engine only.
Parameters:
  modified - the modified status.



setQueued
public void setQueued(boolean queued)(Code)
Set the queued status of this object. The Persistence Engine will set the queued status to true on an Add/Update/Delete. Thereafter, any updates on this object will throw a RuntimeException. This flag will be reset after the object actaully gets added/updated/deleted to the database. Note: This method is for internal use by the Persistence Engine only.
Parameters:
  queued - the queued status.



setUOW
public void setUOW(UOW uow)(Code)
Associates this object to a UOW. Note: This method is for internal use by the Persistence Engine only.
Parameters:
  uow - The UOW.



toString
public String toString()(Code)
This returns the state of the object for diagnostic purposes. a String representation of the object.



update
protected void update() throws ReadOnlyObjectException, AlreadyLockedObjectException, IllegalPersistentStateRuntimeException(Code)
This method should be invoked by every updateXxx() method of the persistent class, before setting the value. It ensures that a readonly object cannot be updated. It acquires a lock for the pessimistic locking strategy. Finally, it sets the modified flag.
throws:
  ReadOnlyObjectException - if the object has been marked as ReadOnly, and hence cannot be updated.
throws:
  AlreadyLockedObjectException - if the object has been locked by another 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.



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.