Class AbstractRWPersistent

  • All Implemented Interfaces:
    PersistentIF
    Direct Known Subclasses:
    TMObject

    public abstract class AbstractRWPersistent
    extends Object
    implements PersistentIF
    INTERNAL: An abstract PersistentIF implementation that handles most of the machinery needed to implement persistent objects. Note that other persistent classes should extend this class.
    • Constructor Detail

      • AbstractRWPersistent

        public AbstractRWPersistent()
      • AbstractRWPersistent

        public AbstractRWPersistent​(TransactionIF txn)
    • Method Detail

      • _p_getType

        public Class<?> _p_getType()
        Description copied from interface: PersistentIF
        INTERNAL: Returns the object.type. This information is used by the transaction to handle the persistent mapping for the object.
        Specified by:
        _p_getType in interface PersistentIF
      • syncFieldsAfterMerge

        protected void syncFieldsAfterMerge​(IdentityIF source,
                                            IdentityIF target,
                                            int... fields)
      • loadField

        protected <F> F loadField​(int field)
        INTERNAL: Called when the instance requests the initialization of the specified field value. This call will lead to the value being retrieved from the data repository if the instance is managed by a transaction, otherwise a default value will be set.
        Returns:
        FIXME: only loaded values will be returned. if the default value is being set, the return value is null.
      • loadCollectionField

        protected <F> Collection<F> loadCollectionField​(int field)
      • detachField

        protected void detachField​(int field)
      • detachCollectionField

        protected void detachCollectionField​(int field)
      • valueChanged

        protected void valueChanged​(int field,
                                    Object value,
                                    boolean dchange)
        INTERNAL: Called when a field value has been changed. The managing transaction will be notified.
      • valueAdded

        protected void valueAdded​(int field,
                                  Object value,
                                  boolean dchange)
      • valueRemoved

        protected void valueRemoved​(int field,
                                    Object value,
                                    boolean dchange)
      • setDeleted

        public void setDeleted​(boolean deleted)
        Specified by:
        setDeleted in interface PersistentIF
      • isLoaded

        public boolean isLoaded​(int field)
        Specified by:
        isLoaded in interface PersistentIF
      • getValue

        protected <F> F getValue​(int field)
      • setValue

        protected void setValue​(int field,
                                Object value)
      • unsetValue

        protected void unsetValue​(int field,
                                  Object value)
      • isDirty

        public boolean isDirty​(int field)
        Specified by:
        isDirty in interface PersistentIF
      • nextDirty

        public int nextDirty​(int start,
                             int end)
        Specified by:
        nextDirty in interface PersistentIF
      • setDirty

        public void setDirty​(int field,
                             boolean dirty)
      • isDirtyFlushed

        public boolean isDirtyFlushed()
      • isDirtyFlushed

        public boolean isDirtyFlushed​(int field)
      • nextDirtyFlushed

        public int nextDirtyFlushed​(int start)
      • nextDirtyFlushed

        public int nextDirtyFlushed​(int start,
                                    int end)
      • setDirtyFlushed

        public void setDirtyFlushed​(int field,
                                    boolean dirty)
        Specified by:
        setDirtyFlushed in interface PersistentIF
      • _p_toString

        public String _p_toString()