Java Doc for DatabaseObject.java in  » J2EE » hgcommons » biz » hammurapi » sql » 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 » hgcommons » biz.hammurapi.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   biz.hammurapi.sql.DatabaseObject

All known Subclasses:   biz.hammurapi.sql.MeasuringDatabaseObject,
DatabaseObject
public class DatabaseObject implements DomSerializable,ColumnChangeListener,Cloneable,ContextConfigurable,Context,DomConfigurable,Attributable,Versioned,Observable,IDatabaseObject,Serializable(Code)
SQLC-generated interface implementations implement this method to achieve differential update functionality - inserting and updating only modified fields.
author:
   Pavel Vlasov
version:
   $Revision: 1.11 $


Field Summary
protected  Collectioncolumns
    
protected  intobjectVersion
     Subclasses can choose to read object version from the database.
protected  intoriginalVersion
    

Constructor Summary
public  DatabaseObject()
    
public  DatabaseObject(boolean force)
    
Parameters:
  force - Forces columns to be marked as modified if setter method is invoked even if value being set equals to existing columnvalue.

Method Summary
protected  voidaddColumn(Column column)
    
public  voidaddObserver(Observer observer)
    
protected  RelationshipListaddRelationship(String name, String itemName, Relationship relationship)
    
Parameters:
  name - Name for composite relationships to render in XML, null for shared relationships.
Parameters:
  itemName - name of item element in XML.
Parameters:
  itemClass - item class.
public  voidclear()
    
public  Objectclone()
     Clones object, clears columns collection, clears isDeleted and isModified flags.
public  voidconfigure(Context context, CompositeConverter converter)
    
public  voidconfigure(Node configNode, Context context)
    
public  voidcopy(DatabaseObject source)
    
public  intdelete(SQLProcessor processor, String tableName)
    
public  booleanequals(Object otherBean)
     Two objects are considered equal and all their fields are equal.
public  voidfromDom(Element holder)
    
public  voidfromDom(Element holder, Properties nameMap)
    
public  Objectget(String name)
    
public  ObjectgetAttribute(Object key)
    
protected  ColumngetColumn(String name)
    
public  ObjectgetColumnAttribute(String columnName, Object key)
    
public  intgetObjectVersion()
    
protected  RelationshipListgetRelationship(String name)
    
protected  intgetSqlType(String columnName, int generatedType)
     Allows to override generated column types with <class name>.sqltypes resource.
public  inthashCode()
    
public  intinsert(SQLProcessor processor, String tableName)
    
public  booleanisDeleted()
    
public  booleanisModified()
    
protected  voidloadRelationships(SQLProcessor processor)
     Use this method to eagerly load relationships in constructors.
public  voidonChange(Column column)
     Sets modified flag to true and increments version number. Also broadcasts the change to observers.
public  ObjectremoveAttribute(Object key)
    
public  ObjectremoveColumnAttribute(String columnName, Object key)
    
public  voidremoveObserver(Observer observer)
    
public  voidsetAttribute(Object key, Object value)
    
public  voidsetColumnAttribute(String columnName, Object key, Object value)
    
public  voidsetOriginal()
    
public  voidtoDom(Element holder)
    
public  voidtoDom(Element holder, Properties nameMap, boolean originals)
    
public  StringtoString()
    
public  intupdate(SQLProcessor processor, String tableName)
    

Field Detail
columns
protected Collection columns(Code)



objectVersion
protected int objectVersion(Code)
Subclasses can choose to read object version from the database.



originalVersion
protected int originalVersion(Code)




Constructor Detail
DatabaseObject
public DatabaseObject()(Code)
Default constructor



DatabaseObject
public DatabaseObject(boolean force)(Code)

Parameters:
  force - Forces columns to be marked as modified if setter method is invoked even if value being set equals to existing columnvalue. Useful during inserts with non-nullable columns which map to primitive types and as such have default values.




Method Detail
addColumn
protected void addColumn(Column column)(Code)



addObserver
public void addObserver(Observer observer)(Code)



addRelationship
protected RelationshipList addRelationship(String name, String itemName, Relationship relationship)(Code)

Parameters:
  name - Name for composite relationships to render in XML, null for shared relationships.
Parameters:
  itemName - name of item element in XML.
Parameters:
  itemClass - item class. This class shall have constructor from Element,boolean in order to load from XML docs.
Parameters:
  relationship -



clear
public void clear()(Code)



clone
public Object clone() throws CloneNotSupportedException(Code)
Clones object, clears columns collection, clears isDeleted and isModified flags. Subclasses shall add cloned columns.



configure
public void configure(Context context, CompositeConverter converter) throws ConfigurationException(Code)



configure
public void configure(Node configNode, Context context) throws ConfigurationException(Code)



copy
public void copy(DatabaseObject source)(Code)



delete
public int delete(SQLProcessor processor, String tableName) throws SQLException(Code)



equals
public boolean equals(Object otherBean)(Code)
Two objects are considered equal and all their fields are equal.
Parameters:
  otherBean - Other object true if object classes are equal and all member column values areequal.



fromDom
public void fromDom(Element holder) throws ConfigurationException(Code)



fromDom
public void fromDom(Element holder, Properties nameMap) throws ConfigurationException(Code)



get
public Object get(String name)(Code)



getAttribute
public Object getAttribute(Object key)(Code)



getColumn
protected Column getColumn(String name)(Code)



getColumnAttribute
public Object getColumnAttribute(String columnName, Object key)(Code)



getObjectVersion
public int getObjectVersion()(Code)



getRelationship
protected RelationshipList getRelationship(String name)(Code)



getSqlType
protected int getSqlType(String columnName, int generatedType)(Code)
Allows to override generated column types with <class name>.sqltypes resource. Subclasses shall use this method when dealing with Object columns.
Parameters:
  columnName -
Parameters:
  generatedType -



hashCode
public int hashCode()(Code)



insert
public int insert(SQLProcessor processor, String tableName) throws SQLException(Code)



isDeleted
public boolean isDeleted()(Code)



isModified
public boolean isModified()(Code)



loadRelationships
protected void loadRelationships(SQLProcessor processor) throws SQLException(Code)
Use this method to eagerly load relationships in constructors.
Parameters:
  processor -
throws:
  SQLException -



onChange
public void onChange(Column column)(Code)
Sets modified flag to true and increments version number. Also broadcasts the change to observers. Changed column is passed as second argument of update() method. Override this method in subclasses to react on change events, but don't forget to invoke super.onChange().
Parameters:
  column - Changed column



removeAttribute
public Object removeAttribute(Object key)(Code)



removeColumnAttribute
public Object removeColumnAttribute(String columnName, Object key)(Code)



removeObserver
public void removeObserver(Observer observer)(Code)



setAttribute
public void setAttribute(Object key, Object value)(Code)



setColumnAttribute
public void setColumnAttribute(String columnName, Object key, Object value)(Code)



setOriginal
public void setOriginal()(Code)



toDom
public void toDom(Element holder)(Code)



toDom
public void toDom(Element holder, Properties nameMap, boolean originals)(Code)



toString
public String toString()(Code)



update
public int update(SQLProcessor processor, String tableName) throws SQLException(Code)



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.