Class NumberPoolPersistenceImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<NumberPoolPersistenceImpl>, org.tentackle.dbms.ModificationLoggable, org.tentackle.misc.Identifiable, org.tentackle.misc.Immutable, org.tentackle.misc.Modifiable, org.tentackle.misc.SerialNumbered, org.tentackle.misc.Snapshotable<org.tentackle.ns.pdo.NumberPool>, org.tentackle.ns.pdo.NumberPoolPersistence, org.tentackle.pdo.DomainContextDependable, org.tentackle.pdo.DomainContextProvider, org.tentackle.pdo.PdoMethodCacheProvider<org.tentackle.ns.pdo.NumberPool>, org.tentackle.pdo.PdoProvider<org.tentackle.ns.pdo.NumberPool>, org.tentackle.pdo.PersistenceDelegate<org.tentackle.ns.pdo.NumberPool>, org.tentackle.pdo.PersistentObject<org.tentackle.ns.pdo.NumberPool>, org.tentackle.pdo.ProxyDelegate<org.tentackle.ns.pdo.NumberPool>, org.tentackle.reflect.EffectiveClassProvider<org.tentackle.ns.pdo.NumberPool>, org.tentackle.reflect.Interceptable, org.tentackle.session.SessionDependable, org.tentackle.session.SessionProvider, org.tentackle.validate.ScopeConfigurator, org.tentackle.validate.Validateable

    @PersistentObjectService(org.tentackle.ns.pdo.NumberPool.class)
    public class NumberPoolPersistenceImpl
    extends AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
    implements org.tentackle.ns.pdo.NumberPoolPersistence
    Number Space persistence implementation.
    Author:
    harald
    See Also:
    Serialized Form
    • Field Detail

      • CN_NAME

        public static final java.lang.String CN_NAME
        database column name for 'name'.
        See Also:
        Constant Field Values
      • CN_REALM

        public static final java.lang.String CN_REALM
        database column name for 'realm'.
        See Also:
        Constant Field Values
      • CN_DESCRIPTION

        public static final java.lang.String CN_DESCRIPTION
        database column name for 'description'.
        See Also:
        Constant Field Values
      • CN_ONLINE

        public static final java.lang.String CN_ONLINE
        database column name for 'online'.
        See Also:
        Constant Field Values
      • CN_LOWWATERMARK

        public static final java.lang.String CN_LOWWATERMARK
        database column name for 'lowWaterMark'.
        See Also:
        Constant Field Values
      • CN_REQUESTSIZE

        public static final java.lang.String CN_REQUESTSIZE
        database column name for 'requestSize'.
        See Also:
        Constant Field Values
      • CN_UPLINK

        public static final java.lang.String CN_UPLINK
        database column name for 'uplink'.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NumberPoolPersistenceImpl

        public NumberPoolPersistenceImpl​(org.tentackle.ns.pdo.NumberPool pdo,
                                         org.tentackle.pdo.DomainContext context)
        Creates a number space.
        Parameters:
        pdo - the number space PDO
        context - the domain context
      • NumberPoolPersistenceImpl

        public NumberPoolPersistenceImpl​(org.tentackle.ns.pdo.NumberPool pdo,
                                         org.tentackle.session.Session session)
        Creates a number space with a session only.
        Parameters:
        pdo - the number space PDO
        session - the session
      • NumberPoolPersistenceImpl

        public NumberPoolPersistenceImpl​(org.tentackle.ns.pdo.NumberPool pdo)
        Creates a number space without domain context or session.
        Parameters:
        pdo - the number space PDO
      • NumberPoolPersistenceImpl

        public NumberPoolPersistenceImpl()
        Creates a number space without domain context or session.
    • Method Detail

      • isUpdatingSerialEvenIfNotModified

        public boolean isUpdatingSerialEvenIfNotModified()
        Description copied from class: AbstractPersistentObject
        Determines whether in updates of composite objects unmodified objects in the update path get at least the serial updated or are not touched at all. The default is to leave unmodified objects untouched, except root entities. However, in some applications it is necessary to update the master object if some of its childs are updated (usually to trigger something, e.g. a cache-update).

        The default implementation returns true if this is a root entity.

        Overrides:
        isUpdatingSerialEvenIfNotModified in class AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
        Returns:
        true if update serial even if object is unchanged
        See Also:
        AbstractPersistentObject.updateObject()
      • isTracked

        public boolean isTracked()
        Specified by:
        isTracked in interface org.tentackle.pdo.PersistentObject<org.tentackle.ns.pdo.NumberPool>
        Overrides:
        isTracked in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • setModified

        public void setModified​(boolean modified)
        Description copied from class: AbstractPersistentObject
        Sets the modified flag.

        For optimizations it is possible to skip objects that have not been modified. The modified-attribute is cleared whenever the object is persisted.

        Overrides:
        setModified in class AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
        Parameters:
        modified - is true if object is flagged modified, false if not.
      • differsPersisted

        public boolean differsPersisted()
        Specified by:
        differsPersisted in interface org.tentackle.pdo.PersistentObject<org.tentackle.ns.pdo.NumberPool>
        Overrides:
        differsPersisted in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • attributesModified

        public boolean attributesModified()
        Specified by:
        attributesModified in interface org.tentackle.pdo.PersistentObject<org.tentackle.ns.pdo.NumberPool>
        Overrides:
        attributesModified in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • getFields

        public void getFields​(org.tentackle.dbms.ResultSetWrapper rs)
        Overrides:
        getFields in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • setFields

        public int setFields​(org.tentackle.dbms.PreparedStatementWrapper st)
        Overrides:
        setFields in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • createInsertSql

        public java.lang.String createInsertSql()
        Overrides:
        createInsertSql in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • createUpdateSql

        public java.lang.String createUpdateSql()
        Overrides:
        createUpdateSql in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setName

        public void setName​(java.lang.String name)
        Specified by:
        setName in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isNameModified

        public boolean isNameModified()
        Specified by:
        isNameModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getNamePersisted

        public java.lang.String getNamePersisted()
        Specified by:
        getNamePersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getRealm

        public java.lang.String getRealm()
        Specified by:
        getRealm in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setRealm

        public void setRealm​(java.lang.String realm)
        Specified by:
        setRealm in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isRealmModified

        public boolean isRealmModified()
        Specified by:
        isRealmModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getRealmPersisted

        public java.lang.String getRealmPersisted()
        Specified by:
        getRealmPersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getDescription

        public java.lang.String getDescription()
        Specified by:
        getDescription in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setDescription

        public void setDescription​(java.lang.String description)
        Specified by:
        setDescription in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isDescriptionModified

        public boolean isDescriptionModified()
        Specified by:
        isDescriptionModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getDescriptionPersisted

        public java.lang.String getDescriptionPersisted()
        Specified by:
        getDescriptionPersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isOnline

        public boolean isOnline()
        Specified by:
        isOnline in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setOnline

        public void setOnline​(boolean online)
        Specified by:
        setOnline in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isOnlineModified

        public boolean isOnlineModified()
        Specified by:
        isOnlineModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isOnlinePersisted

        public boolean isOnlinePersisted()
        Specified by:
        isOnlinePersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getLowWaterMark

        public long getLowWaterMark()
        Specified by:
        getLowWaterMark in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setLowWaterMark

        public void setLowWaterMark​(long lowWaterMark)
        Specified by:
        setLowWaterMark in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isLowWaterMarkModified

        public boolean isLowWaterMarkModified()
        Specified by:
        isLowWaterMarkModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getLowWaterMarkPersisted

        public long getLowWaterMarkPersisted()
        Specified by:
        getLowWaterMarkPersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getRequestSize

        public long getRequestSize()
        Specified by:
        getRequestSize in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setRequestSize

        public void setRequestSize​(long requestSize)
        Specified by:
        setRequestSize in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isRequestSizeModified

        public boolean isRequestSizeModified()
        Specified by:
        isRequestSizeModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getRequestSizePersisted

        public long getRequestSizePersisted()
        Specified by:
        getRequestSizePersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getUplink

        public java.lang.String getUplink()
        Specified by:
        getUplink in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setUplink

        public void setUplink​(java.lang.String uplink)
        Specified by:
        setUplink in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • isUplinkModified

        public boolean isUplinkModified()
        Specified by:
        isUplinkModified in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getUplinkPersisted

        public java.lang.String getUplinkPersisted()
        Specified by:
        getUplinkPersisted in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • revertAttributesToSnapshot

        protected void revertAttributesToSnapshot​(NumberPoolPersistenceImpl snapshot)
        Copies all attributes from a snapshot back to this object.
        Parameters:
        snapshot - the snapshot object
      • selectByUniqueDomainKey

        public org.tentackle.ns.pdo.NumberPool selectByUniqueDomainKey​(java.lang.String name)
        Specified by:
        selectByUniqueDomainKey in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getNumberRangeList

        public org.tentackle.misc.TrackedList<org.tentackle.ns.pdo.NumberRange> getNumberRangeList()
        Specified by:
        getNumberRangeList in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • getNumberRangeListBlunt

        public org.tentackle.misc.TrackedList<org.tentackle.ns.pdo.NumberRange> getNumberRangeListBlunt()
        Gets numberRangeList without performing a select if not loaded.
        Returns:
        numberRangeList NumberRange
      • isNumberRangeListLoaded

        public boolean isNumberRangeListLoaded()
        Specified by:
        isNumberRangeListLoaded in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • setSession

        public void setSession​(org.tentackle.session.Session session)
        Specified by:
        setSession in interface org.tentackle.session.SessionDependable
        Overrides:
        setSession in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • deleteReferencingRelations

        public void deleteReferencingRelations()
        Overrides:
        deleteReferencingRelations in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • saveReferencingRelations

        public void saveReferencingRelations​(boolean update)
        Overrides:
        saveReferencingRelations in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • validate

        public java.util.List<org.tentackle.validate.ValidationResult> validate​(java.lang.String validationPath,
                                                                                org.tentackle.validate.ValidationScope scope)
        Specified by:
        validate in interface org.tentackle.validate.Validateable
        Overrides:
        validate in class AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
      • setImmutable

        public void setImmutable​(boolean immutable)
        Specified by:
        setImmutable in interface org.tentackle.misc.Immutable
        Overrides:
        setImmutable in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • isModified

        public boolean isModified()
        Specified by:
        isModified in interface org.tentackle.misc.Modifiable
        Overrides:
        isModified in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • isComposite

        public boolean isComposite()
        Description copied from class: AbstractPersistentObject
        Tells whether this object is composite (i.e. has composite relations).
        The method is overridden by the PdoRelations-wurblet if at least one relation is flagged as "composite". The default implementation returns false.
        Specified by:
        isComposite in interface org.tentackle.pdo.PersistentObject<org.tentackle.ns.pdo.NumberPool>
        Overrides:
        isComposite in class AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
        Returns:
        true if object is composite, false if not.
      • loadComponents

        public org.tentackle.misc.IdentifiableMap<? extends org.tentackle.pdo.PersistentDomainObject<?>> loadComponents​(boolean onlyLoaded)
        Description copied from class: AbstractPersistentObject

        By default the method throws a PersistenceException telling that it is not implemented if isComposite() returns true.

        Specified by:
        loadComponents in interface org.tentackle.pdo.PersistentObject<org.tentackle.ns.pdo.NumberPool>
        Overrides:
        loadComponents in class AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
        Parameters:
        onlyLoaded - true if return only already loaded components (lazy composite relations)
        Returns:
        the map of all components, including this object.
      • addComponents

        public int addComponents​(org.tentackle.misc.IdentifiableMap<org.tentackle.pdo.PersistentDomainObject<?>> components,
                                 boolean onlyLoaded)
        Description copied from class: AbstractPersistentObject
        Adds the components of this object to a map.
        Overrides:
        addComponents in class AbstractPersistentObject<org.tentackle.ns.pdo.NumberPool,​NumberPoolPersistenceImpl>
        Parameters:
        components - the component map
        onlyLoaded - true if return only already loaded component (lazy composite relations)
        Returns:
        the number of components added
      • markDeleted

        public void markDeleted()
        Overrides:
        markDeleted in class org.tentackle.dbms.AbstractDbObject<NumberPoolPersistenceImpl>
      • createComponentsInSnapshot

        protected void createComponentsInSnapshot​(NumberPoolPersistenceImpl snapshot)
        Updates the components in snapshot object.
        The snapshot object is assumed to be a clone of this object.
        Parameters:
        snapshot - the snapshot
      • revertComponentsToSnapshot

        protected void revertComponentsToSnapshot​(NumberPoolPersistenceImpl snapshot)
        Reverts all components of this object to a given snapshot.
        Parameters:
        snapshot - the snapshot object
      • selectByNameRealm

        public org.tentackle.ns.pdo.NumberPool selectByNameRealm​(java.lang.String name,
                                                                 java.lang.String realm)
        Specified by:
        selectByNameRealm in interface org.tentackle.ns.pdo.NumberPoolPersistence
      • reloadRanges

        public void reloadRanges()
        Specified by:
        reloadRanges in interface org.tentackle.ns.pdo.NumberPoolPersistence