
Public Member Functions | |
| void | addPropertyChangeListener (String propertyName, PropertyChangeListener listener) |
| void | removePropertyChangeListener (PropertyChangeListener listener) |
| boolean | getUseContentEqualsAndHashCode () |
| void | setUseContentEqualsAndHashCode (boolean u) |
| boolean | equalsContent (Object o) |
| int | hashCodeContent () |
| boolean | equals (Object o) |
| int | hashCode () |
Protected Attributes | |
| PropertyChangeSupport | propertyChangeSupport = new PropertyChangeSupport(this) |
| boolean | useContentEqualsAndHashCode = false |
Base class for all code-generated TMCDB tables java mappings (pojo objects)
This class provides (at the time) two main important features:
It adds domain self-contained publisher/subscriber support. With this, any object that implements java.beans.PropertyChangeListener can subscribe to changes in the internal object's properties and listen to them. Note though that this feature is only possible when classes extending TmcdbObject fire property changes on their property setters, which is the case of the code-generated classes.
It gives the chance to the user to select whether the equals() and hashCode() methods should use the default java Object implementations, or the equalsContent() and hashCodeContent() ones. These new methods should be reimplemented by classes extending TmcdbObject, using business logic, otherwise the methods declared in this class will be used, which call to Object#equals(Object) and Object#hashCode() anyway. In the case of code-generated classes, these methods are created, if it is the case, with the columns present in the "GENERATED FROM" statement of the model. For further details, refer to the grammar definition for the TMCDB models.
By default, the Object methods will be used. This can be changed by the user at any time by calling setUseContentEqualsAndHashCode(boolean).
NOTE: Use this with care. This option is available for it eases life to some programs, but it might lead to hard-to-recognize problems. Please refer to http://www.artima.com/lejava/articles/equality.html and to the Set class documentation for further details
| void alma::acs::tmcdb::translator::TmcdbObject::addPropertyChangeListener | ( | String | propertyName, | |
| PropertyChangeListener | listener | |||
| ) | [inline] |
References propertyChangeSupport.
| boolean alma::acs::tmcdb::translator::TmcdbObject::equals | ( | Object | o | ) | [inline] |
References equalsContent(), and useContentEqualsAndHashCode.
| boolean alma::acs::tmcdb::translator::TmcdbObject::equalsContent | ( | Object | o | ) | [inline] |
Referenced by equals().
| boolean alma::acs::tmcdb::translator::TmcdbObject::getUseContentEqualsAndHashCode | ( | ) | [inline] |
References useContentEqualsAndHashCode.
| int alma::acs::tmcdb::translator::TmcdbObject::hashCode | ( | ) | [inline] |
References hashCodeContent(), and useContentEqualsAndHashCode.
| int alma::acs::tmcdb::translator::TmcdbObject::hashCodeContent | ( | ) | [inline] |
Referenced by hashCode().
| void alma::acs::tmcdb::translator::TmcdbObject::removePropertyChangeListener | ( | PropertyChangeListener | listener | ) | [inline] |
References propertyChangeSupport.
| void alma::acs::tmcdb::translator::TmcdbObject::setUseContentEqualsAndHashCode | ( | boolean | u | ) | [inline] |
References useContentEqualsAndHashCode.
PropertyChangeSupport alma::acs::tmcdb::translator::TmcdbObject::propertyChangeSupport = new PropertyChangeSupport(this) [protected] |
Referenced by addPropertyChangeListener(), and removePropertyChangeListener().
boolean alma::acs::tmcdb::translator::TmcdbObject::useContentEqualsAndHashCode = false [protected] |
Referenced by equals(), getUseContentEqualsAndHashCode(), hashCode(), and setUseContentEqualsAndHashCode().
1.6.2