Java Doc for AbstractObject.java in  » Content-Management-System » harmonise » org » openharmonise » rm » resources » 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 » Content Management System » harmonise » org.openharmonise.rm.resources 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.openharmonise.rm.resources.AbstractObject

All known Subclasses:   org.openharmonise.rm.resources.AbstractEditableObject,  org.openharmonise.rm.metadata.Profile,
AbstractObject
abstract public class AbstractObject implements Cloneable,Comparable,Publishable,DataStoreObject,CacheableObject(Code)
The abstract class for the core objects of Harmonise, handling the very basic data handling for data such as system identifiers, name and summary and incorporating core functionality to be built on by implementing classes.
author:
   Michael Bell
version:
   $Revision: 1.5 $


Field Summary
final public static  StringATTRIB_HISTORICAL
    
final public static  StringATTRIB_ID
    
final public static  StringATTRIB_KEY
    
final public static  StringATTRIB_NAME
    
final public static  StringATTRIB_OBJECT_TYPE
    
final public static  StringATTRIB_TYPE
    
final protected static  StringCLMN_ID
    
final protected static  StringCLMN_NAME
    
final protected static  StringCLMN_SUMMARY
    
final public static  StringEXT_HIST
    
final public static  intNOTDBSAVED_ID
    
final public static  intNOTDBSAVED_KEY
    
final public static  StringTAG_HARMONISE_OBJECT
    
final public static  StringTAG_LINK
    
final public static  StringTAG_LINK_IMAGE
    
final public static  StringTAG_LINK_TEXT
    
final public static  StringTAG_NAME
    
final public static  StringTAG_SUMMARY
    
protected  booleanm_bIsChanged
    
protected  booleanm_bIsPopulated
    
protected  AbstractDataStoreInterfacem_dsi
    
protected  intm_nId
    
protected  intm_nObjectKey
    
protected  Stringm_sName
    
protected  Stringm_sSummary
    
protected  Stringm_sTable
    
protected  Stringm_sType
    

Constructor Summary
public  AbstractObject()
     Constructs a new or anonymous instance without an interface to the database.
public  AbstractObject(AbstractDataStoreInterface con)
     Standard constructor for a new or anonymous resource, registering an AbstractDataStoreInterface to use with all database communications.
public  AbstractObject(AbstractDataStoreInterface con, boolean bIsHist)
     Standard constructor for a new or anonymous historical resource, registering an AbstractDataStoreInterface to use with all database communications.
public  AbstractObject(AbstractDataStoreInterface con, int nId)
     Standard constructor for an existing resource, registering an AbstractDataStoreInterface to use with all database communications.
public  AbstractObject(AbstractDataStoreInterface con, int nId, int nKey, boolean bIsHist)
     Standard constructor for an existing resource which may be historical.

Method Summary
public  voidaddCacheListener(CacheListener listener)
    
protected  voidaddColumnsToPopulateQuery(SelectStatement select, boolean bIsHist)
     Adds columns to the select query for population of the object.
public  voidclear()
     Clears all data contained in object, the object does however retain its id.
public  Objectclone()
    
public  intcompareTo(Object obj)
    
public  booleanequals(Object obj)
    
public  booleanexists()
     Returns true if this resource exists in the database.
protected  voidfullPopulate()
     Ensures that this object is fully poplated from the database.
public  ListgetCacheListeners()
    
public static  ColumnRefgetColumnRef(AbstractObject obj, String sColumn)
     Returns a column reference appropriate for the given AbstractObject and column name.
public static  ColumnRefgetColumnRef(String sClassname, String sColumn)
     Returns a column reference appropriate for the given AbstractObject and column name.
public static  ColumnRefgetColumnRef(String sClassname, String sColumn, boolean bHist)
     Returns a column reference appropriate for the given parameters.
protected static  CollectiongetCoreColumnRefs(String sClassname)
    
abstract public  StringgetDBTableName()
    
public  AbstractDataStoreInterfacegetDataStoreInterface()
     Returns the datastore interface associated with this object.
protected  StringgetHistoricalDBTableName()
     Returns the historical table name for this object.
public  intgetId()
     Returns the object id.
public  ColumnRefgetInstanceColumnRef(String sColumn, boolean bIsHist)
    
public  intgetKey()
    
public  StringgetName()
     Returns the object name.
protected static  ColumnRefgetObjectColumnRef(String sDBTable, String sColumn)
     Returns a column reference of the correct type given the table and column identifier.
public  StringgetSummary()
     Returns the object summary.
public static  StringgetTableName(String sClassname, boolean bHist)
     Returns the table name for the object of the class name given, taking account for whether the historical table is needed or not.
protected  StringgetTableName(boolean bIsHist)
     Returns the database table name for an object of this object's type.
public  StringgetType()
     Returns the object type (default class name) for this object.
public  inthashCode()
    
public  booleanisChanged()
     Returns true if this object's data has been changed (as compared to the data held in the database).
public  booleanisHistorical()
     Returns true if this object is a historical object.
abstract protected  booleanisKeySupported()
     Returns true if this object has a unique identifier key as well as the identifier attribute. Note: This depends on how historical versions of this object are handled.
protected  booleanisPopulated()
     Returns true if object has been populated.
protected  voidmarkAsNew()
     Marks an object as a new object, correctly setting all of the appropriate flags.
public  voidnotifyCacheListeners()
    
public  voidpopulate(Element xmlElement, State state)
    
protected synchronized  voidpopulateFromDatabase()
     Populates this object's core data from the database.
protected  voidpopulateFromResultSetRow(ResultSet rs, SelectStatement select)
     Populates this object from the given result set.
public  Elementpublish(Template template, HarmoniseOutput xmlDoc, State state)
    
public  Elementpublish(Element topEl, HarmoniseOutput xmlDoc, State state)
    
public  voidremoveCacheListener(CacheListener listener)
    
public  voidsetDataStoreInterface(AbstractDataStoreInterface dsi)
     Sets the data store interface for this object if this object does not already have an interface to the data store. Note: This method is a convenience method for objects created with the empty constructor, changing the data store interface on an existing object could lead to unpredictable behaviour.
public  voidsetHistorical(boolean bIsHistorical)
     Sets whether this object is historical.
public  voidsetId(int nId)
     Set method for id, here for completeness, should use constructor. Note: Once an object's id has been assigned within the framework it can not be reassigned.
public  voidsetIsChanged(boolean bIsChanged)
     Sets the object changed flag.
public  voidsetKey(int nKey)
     Sets the object's unique identifier key.
public  voidsetName(String sName)
     Sets the object name.
public  voidsetSummary(String sSummary)
     Set the object summary.
public  voidsetType(String type)
     Sets the type (default class name) for this object.

Field Detail
ATTRIB_HISTORICAL
final public static String ATTRIB_HISTORICAL(Code)
Historical attribute



ATTRIB_ID
final public static String ATTRIB_ID(Code)
Object id attribute name



ATTRIB_KEY
final public static String ATTRIB_KEY(Code)
Object key attribute name



ATTRIB_NAME
final public static String ATTRIB_NAME(Code)
Object name attribute name



ATTRIB_OBJECT_TYPE
final public static String ATTRIB_OBJECT_TYPE(Code)
Alternative object type attribute



ATTRIB_TYPE
final public static String ATTRIB_TYPE(Code)
Object type attribute name



CLMN_ID
final protected static String CLMN_ID(Code)
Id database column name



CLMN_NAME
final protected static String CLMN_NAME(Code)
Object name column name



CLMN_SUMMARY
final protected static String CLMN_SUMMARY(Code)
Object summary column name



EXT_HIST
final public static String EXT_HIST(Code)
Historical extension for database table names



NOTDBSAVED_ID
final public static int NOTDBSAVED_ID(Code)
Constant for a unsaved identifier



NOTDBSAVED_KEY
final public static int NOTDBSAVED_KEY(Code)
Constant for a unsaved object key



TAG_HARMONISE_OBJECT
final public static String TAG_HARMONISE_OBJECT(Code)
HarmoniseObject XML tag name



TAG_LINK
final public static String TAG_LINK(Code)
Link tag name



TAG_LINK_IMAGE
final public static String TAG_LINK_IMAGE(Code)
Link image tag name



TAG_LINK_TEXT
final public static String TAG_LINK_TEXT(Code)
Link text tag name



TAG_NAME
final public static String TAG_NAME(Code)
Name tag name



TAG_SUMMARY
final public static String TAG_SUMMARY(Code)
Summary tag name



m_bIsChanged
protected boolean m_bIsChanged(Code)
Changed flag, true if this object has been changed (as compared to the data stored in the database)



m_bIsPopulated
protected boolean m_bIsPopulated(Code)
Populated flag, true if this object has been populated from the database



m_dsi
protected AbstractDataStoreInterface m_dsi(Code)
Data store interface for this object



m_nId
protected int m_nId(Code)
Object id



m_nObjectKey
protected int m_nObjectKey(Code)
Object key



m_sName
protected String m_sName(Code)
Object name



m_sSummary
protected String m_sSummary(Code)
Object summary



m_sTable
protected String m_sTable(Code)
The database table containing this object's data



m_sType
protected String m_sType(Code)
Type of object, will be the name of the class this should be instantiated as by default




Constructor Detail
AbstractObject
public AbstractObject()(Code)
Constructs a new or anonymous instance without an interface to the database.



AbstractObject
public AbstractObject(AbstractDataStoreInterface con)(Code)
Standard constructor for a new or anonymous resource, registering an AbstractDataStoreInterface to use with all database communications.
Parameters:
  con - the interface to the database



AbstractObject
public AbstractObject(AbstractDataStoreInterface con, boolean bIsHist)(Code)
Standard constructor for a new or anonymous historical resource, registering an AbstractDataStoreInterface to use with all database communications.
Parameters:
  con - the interface to the database



AbstractObject
public AbstractObject(AbstractDataStoreInterface con, int nId)(Code)
Standard constructor for an existing resource, registering an AbstractDataStoreInterface to use with all database communications.
Parameters:
  con - the interface to the database
Parameters:
  nId - the id of the resource



AbstractObject
public AbstractObject(AbstractDataStoreInterface con, int nId, int nKey, boolean bIsHist)(Code)
Standard constructor for an existing resource which may be historical.
Parameters:
  con - the interface to the database
Parameters:
  nId - the id of the resource
Parameters:
  nKey - the unique key of the resource
Parameters:
  bIsHist - true if the resource is historical




Method Detail
addCacheListener
public void addCacheListener(CacheListener listener)(Code)



addColumnsToPopulateQuery
protected void addColumnsToPopulateQuery(SelectStatement select, boolean bIsHist) throws DataStoreException(Code)
Adds columns to the select query for population of the object. Note: this method is used by populateFromDatabase to construct its query.
Parameters:
  select - the select statment to add columns to
throws:
  DataStoreException - if an error occurs building the select statement



clear
public void clear()(Code)
Clears all data contained in object, the object does however retain its id.



clone
public Object clone()(Code)



compareTo
public int compareTo(Object obj)(Code)



equals
public boolean equals(Object obj)(Code)



exists
public boolean exists()(Code)
Returns true if this resource exists in the database. true if resource exists



fullPopulate
protected void fullPopulate() throws PopulateException(Code)
Ensures that this object is fully poplated from the database.
throws:
  PopulateException -



getCacheListeners
public List getCacheListeners()(Code)



getColumnRef
public static ColumnRef getColumnRef(AbstractObject obj, String sColumn) throws DataStoreException(Code)
Returns a column reference appropriate for the given AbstractObject and column name.
Parameters:
  obj - an AbstractObject object
Parameters:
  sColumn - the column, tag or attribute name the column reference corresponding to the object and columnname given
throws:
  DataStoreException - if an error occurs



getColumnRef
public static ColumnRef getColumnRef(String sClassname, String sColumn) throws DataStoreException(Code)
Returns a column reference appropriate for the given AbstractObject and column name.
Parameters:
  sClassname - the class name of an AbstractObject
Parameters:
  sColumn - the column, tag or attribute name the column reference corresponding to the class name and columnname given
throws:
  DataStoreException - if an error occurs



getColumnRef
public static ColumnRef getColumnRef(String sClassname, String sColumn, boolean bHist) throws DataStoreException(Code)
Returns a column reference appropriate for the given parameters.
Parameters:
  sClassname - the class name of an AbstractObject
Parameters:
  sColumn - the column, tag or attribute name
Parameters:
  bHist - true if the column reference is associated with a historical object the column reference corresponding to the parameters
throws:
  DataStoreException - if an error occurs



getCoreColumnRefs
protected static Collection getCoreColumnRefs(String sClassname) throws DataStoreException(Code)
Returns a collection of column refs representing the object's core data a collection of column refs representing the object's core data
throws:
  DataStoreException - if an error occurs getting the column references



getDBTableName
abstract public String getDBTableName()(Code)



getDataStoreInterface
public AbstractDataStoreInterface getDataStoreInterface()(Code)
Returns the datastore interface associated with this object. the datastore interface associated with this object



getHistoricalDBTableName
protected String getHistoricalDBTableName()(Code)
Returns the historical table name for this object. the historical table name for this object



getId
public int getId()(Code)
Returns the object id. the id of the object



getInstanceColumnRef
public ColumnRef getInstanceColumnRef(String sColumn, boolean bIsHist) throws DataStoreException(Code)



getKey
public int getKey() throws DataAccessException(Code)
Returns the unique identifier key the objects unique identifier key
throws:
  DataAccessException - if an error occurs populating this object



getName
public String getName() throws DataAccessException(Code)
Returns the object name. the name of the object
throws:
  DataAccessException - if an error occurs populating this object



getObjectColumnRef
protected static ColumnRef getObjectColumnRef(String sDBTable, String sColumn) throws DataStoreException(Code)
Returns a column reference of the correct type given the table and column identifier. The column identifier may be an XML tag.
Parameters:
  sDBTable - the database table
Parameters:
  sColumn - the column, tag or attribute name the appropriate column reference
throws:
  DataStoreException - if an error occurs
throws:
  InvalidColumnReferenceException - if the given column name isinvalid



getSummary
public String getSummary() throws DataAccessException(Code)
Returns the object summary. the object summary
throws:
  DataAccessException - if an error occurs populating this object



getTableName
public static String getTableName(String sClassname, boolean bHist) throws DataStoreException(Code)
Returns the table name for the object of the class name given, taking account for whether the historical table is needed or not.
Parameters:
  sClassname - the class name of an AbstractObject
Parameters:
  bHist - true if the table name is associated with a historical object the table name for the object
throws:
  DataStoreException - if an error occurs



getTableName
protected String getTableName(boolean bIsHist)(Code)
Returns the database table name for an object of this object's type.
Parameters:
  bIsHist - true if the historical table is needed the database table name for an object of this object's type



getType
public String getType() throws DataAccessException(Code)
Returns the object type (default class name) for this object. the object type (default class name) for this object
throws:
  DataAccessException - if an error occurs populating this object



hashCode
public int hashCode()(Code)



isChanged
public boolean isChanged() throws DataAccessException(Code)
Returns true if this object's data has been changed (as compared to the data held in the database). true if this object's data has been changed
throws:
  DataAccessException - if there is an error populating this object



isHistorical
public boolean isHistorical()(Code)
Returns true if this object is a historical object. true if this object is a historical object



isKeySupported
abstract protected boolean isKeySupported()(Code)
Returns true if this object has a unique identifier key as well as the identifier attribute. Note: This depends on how historical versions of this object are handled. If all versions of the object need to have the same id, to allow a consistent logical id, the key is used to identify versions. true if this object has a unique identifier keyas well as the identifier attribute



isPopulated
protected boolean isPopulated()(Code)
Returns true if object has been populated. true if object has been populated



markAsNew
protected void markAsNew() throws PopulateException(Code)
Marks an object as a new object, correctly setting all of the appropriate flags.
throws:
  PopulateException - if an error occurs



notifyCacheListeners
public void notifyCacheListeners()(Code)



populate
public void populate(Element xmlElement, State state) throws PopulateException(Code)



populateFromDatabase
protected synchronized void populateFromDatabase() throws PopulateException(Code)
Populates this object's core data from the database.
throws:
  PopulateException - if an error occurs getting data from database



populateFromResultSetRow
protected void populateFromResultSetRow(ResultSet rs, SelectStatement select) throws PopulateException(Code)
Populates this object from the given result set. Note: this method must only handle data in the current row
Parameters:
  rs - the result set
Parameters:
  select - the select statement used to generate the result set
throws:
  PopulateException - if an error occurs getting data from the result set



publish
public Element publish(Template template, HarmoniseOutput xmlDoc, State state) throws PublishException(Code)



publish
public Element publish(Element topEl, HarmoniseOutput xmlDoc, State state) throws PublishException(Code)



removeCacheListener
public void removeCacheListener(CacheListener listener)(Code)



setDataStoreInterface
public void setDataStoreInterface(AbstractDataStoreInterface dsi) throws PopulateException(Code)
Sets the data store interface for this object if this object does not already have an interface to the data store. Note: This method is a convenience method for objects created with the empty constructor, changing the data store interface on an existing object could lead to unpredictable behaviour. At some point in the future we may support the switching of datastores such that an object can be populated from one datastore and saved to another but this is not the case at present.
Parameters:
  dsi - the data store interface
throws:
  PopulateException - if this object already has a data store interface



setHistorical
public void setHistorical(boolean bIsHistorical)(Code)
Sets whether this object is historical.
Parameters:
  bIsHistorical - The is historical flag



setId
public void setId(int nId)(Code)
Set method for id, here for completeness, should use constructor. Note: Once an object's id has been assigned within the framework it can not be reassigned. This method should only be used in conjunction with the empty constructor to create an instance of an object with a specific identifier.
Parameters:
  nId - The id of the object



setIsChanged
public void setIsChanged(boolean bIsChanged)(Code)
Sets the object changed flag.
Parameters:
  bIsChanged - true to set this object as having been changed



setKey
public void setKey(int nKey)(Code)
Sets the object's unique identifier key.
Parameters:
  nKey - the object's unique identifier key



setName
public void setName(String sName) throws InvalidNameException(Code)
Sets the object name.
Parameters:
  sName - the name of the object



setSummary
public void setSummary(String sSummary)(Code)
Set the object summary.
Parameters:
  sSummary - the object summary



setType
public void setType(String type)(Code)
Sets the type (default class name) for this object.
Parameters:
  type - the type for this object



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.