Skip navigation links
de.ipcon.db.core

Class BO

    • Field Detail

      • EMPTY_ARRAY

        public static final BO[] EMPTY_ARRAY
      • doExWriteLRMFunction

        public static final java.lang.ThreadLocal doExWriteLRMFunction
        ThreadLocal> Set this local to a function before frapFromCache/cloneOnFrap to allow frapping certain manyrelations to be frapped into the new BOLoader. By default, manyrelations are not frapped. Unset this after again frapping is done. This Function will be called on a LazyRelationMap (unless it's still lazy) and decide whether to include a copy if its values into the new BOLoader or not. The LazyRelationMap provided as parameter should not be modified in any way!
      • D_MINUS_1

        public static final java.math.BigDecimal D_MINUS_1
      • D_0

        public static final java.math.BigDecimal D_0
      • D_1

        public static final java.math.BigDecimal D_1
      • D_5

        public static final java.math.BigDecimal D_5
      • D_10

        public static final java.math.BigDecimal D_10
      • D_100

        public static final java.math.BigDecimal D_100
      • D_1000

        public static final java.math.BigDecimal D_1000
      • D_10000

        public static final java.math.BigDecimal D_10000
      • F_0

        public static final java.lang.Float F_0
      • F_1

        public static final java.lang.Float F_1
      • L_0

        public static final java.lang.Long L_0
      • D_ZERO

        public static final java.math.BigDecimal D_ZERO
      • D_ONE

        public static final java.math.BigDecimal D_ONE
      • D_MINUS_ONE

        public static final java.math.BigDecimal D_MINUS_ONE
      • NULL_ITERATOR

        public static final NullIterator NULL_ITERATOR
      • NULL_AGGREGATE

        public static final NullAggregate NULL_AGGREGATE
      • CANCEL_RECALC_CALLED

        public static final java.lang.String CANCEL_RECALC_CALLED
        See Also:
        Constant Field Values
      • L10N_KEY_BO_WITH_PROTECTED_CONSTRUCTOR

        public static final java.lang.String L10N_KEY_BO_WITH_PROTECTED_CONSTRUCTOR
        See Also:
        Constant Field Values
      • L10N_KEY_BO_INSTANTIATION

        public static final java.lang.String L10N_KEY_BO_INSTANTIATION
        See Also:
        Constant Field Values
    • Constructor Detail

      • BO

        public BO()
    • Method Detail

      • getNullIterator

        public java.util.Iterator getNullIterator()
      • ofStub

        public static BO ofStub(BO bo)
        Returns a "stubbed" instance of the passed BO, i.e. containing only the Id and the BOT of the passed BO. The represented "real" class can be determined from the BOT. Stubs are normally used during de-/serialization of BOProcs.
      • afterSaveOnClient

        public void afterSaveOnClient(BasicClientContextI ctx,
                                      SaveException failure)
                               throws SaveException
        Description copied from interface: SaveAwareI
        Called on all included BOs of the saved Transaction (only!) by Client#saveBO() (that is only from the Solstice GUI client!) after the actual saving has been done or was canceled due to an "application level" error.
        Specified by:
        afterSaveOnClient in interface SaveAwareI
        Parameters:
        ctx - the client context from which the saving is done
        failure - if not null the SaveException that was thrown during saving; if null the saving was finished successfully
        Throws:
        SaveException
      • getId

        public java.lang.Long getId()
        Description copied from class: Synchable
        copyFrom kopiert das uebergebene Synchable-Objekt in das eigene Objekt hinein. Dient zur Uebernahme der Daten in den Objektspeicher.
        Specified by:
        getId in interface Identifiable
        Specified by:
        getId in class Synchable
        Returns:
        a Long with the unique Id of this Identifiable, nullable.
      • setId

        public void setId(java.lang.Long newId)
      • setId

        public void setId(java.lang.Long newId,
                          boolean iKnowWhatImDoing)
      • isNew

        public final boolean isNew()
        Description copied from interface: BOI
        Checks whether this BO has been created recently. Recently in this case means: Its Id is null or negative or it is included in the transaction which created -and possibly already saved- this BO.
        Specified by:
        isNew in interface BOI
        Returns:
        true, if this BO is not yet persisted or has been created within the transaction it is included in. false otherwise, i.e. it was loaded from persistent storage.
      • cancelCheckConstraints

        public boolean cancelCheckConstraints()
        This method is used to determine if certain constraint-checks may be skipped. Used in CBOAttribute at the moment to skip read-only-checks in setValue, add/removeRelationObject and clearRelation.
        Specified by:
        cancelCheckConstraints in interface BOI
        Returns:
        true if flag ignoreModificationConstraints is true or the loading transaction of this BO is either in off-the-record-, in sync- or in BOEnvironmentBuilder-mode
      • isMandatory

        public boolean isMandatory(AttributeI att)
        Tells if the passed AttributeI is mandatory in the context of this BO (for the UI and access via the schema). Please note that the schema-defined, not BO-related mandatories are taken into account here as well, i.e. the method will consistently return true if the attribute is marked in the schema as
         
         
        unless overridden in a subclass. Subclasses may override this method to add their own rules. If no rule exists in the subclass, the decision should always be delegated to super instead of just returning false to avoid inadvertenly breaking the rules defined in super-classes or the schema. You must never change the signature of this method, as subclasses override this and a lot of code would break or need to be adjusted.
        Specified by:
        isMandatory in interface BOI
        Returns:
        true if the given AttributeI is mandatory in the context of this BO
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute was passed
      • isReadOnly

        public boolean isReadOnly(AttributeI att)
        Tells if the passed AttributeI is read-only in the context of this BO (for the UI and access via the schema). Please note that the schema-defined, not BO-related read-onlies are taken into account here as well, i.e. the method will return false if a virtual attribute is marked in the schema as
         
         
        unless overridden in a subclass. Subclasses may override this method to add their own rules. If no rule exists in the subclass, the decision should always be delegated to super instead of just returning false to avoid inadvertenly breaking the rules defined in super-classes or the schema. You must never change the signature of this method, as subclasses override this and a lot of code would break or need to be adjusted.
        Specified by:
        isReadOnly in interface BOI
        Returns:
        true if the given AttributeI is read-only in the context of this BO
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute was passed
      • isWriteable

        public boolean isWriteable(AttributeI att)
        Tells if the passed AttributeI is writeable (i.e. a value for the attribute may be written to the database) in the context of this business object (BO) by calling the client-side PermissionHandlerI.checkWriteAllowed(BOI, String) and testing the result via PermissionHandlerDecisionI.granted(). Additionally the method defaults to true if the given AttributeI is not persistent (i.e. it is an npattr) or no client-side PermissionHandlerI can be determined. Please note that this method is not just the inversion of ::isReadOnly(AttributeI), as it does not ask the AttributeI itself if it is read-only but only takes into account the PermissionHandlerI of the SchemaI for this BO. Subclasses may override this method to add their own rules. If no rule exists in the subclass, the decision should always be delegated to super instead of just returning false to avoid inadvertenly breaking the rules defined in super-classes. You must never change the signature of this method, as subclasses override this and a lot of code would break or need to be adjusted.
        Returns:
        true if the given AttributeI is writeable in the context of this BO
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute was passed
      • isVisible

        public boolean isVisible(AttributeI att)
        Tells if the passed AttributeI is visible in the UI (i.e. it may be read from the database) in the context of this business object (BO) by calling the client-side PermissionHandlerI.checkReadAllowed(BOI, String) and testing the result via PermissionHandlerDecisionI.granted(). Additionally the method defaults to true if no client-side PermissionHandlerI can be determined. Subclasses may override this method to add their own rules. If no rule exists in the subclass, the decision should always be delegated to super instead of just returning false to avoid inadvertenly breaking the rules defined in super-classes. You must never change the signature of this method, as subclasses override this and a lot of code would break or need to be adjusted.
        Specified by:
        isVisible in interface BOI
        Returns:
        true if the given AttributeI is visible in the context of this BO or if no permission handler is found
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute was passed
      • isTemporary

        public final boolean isTemporary()
        Specified by:
        isTemporary in interface BOI
        Returns:
        true if this BO is only temporary, was and never will be persisted, false otherwise.
      • hasTempId

        public final boolean hasTempId()
        Returns:
        true if this BO has a temporary Id, false otherwise
      • hasTempIdForNewBOs

        public final boolean hasTempIdForNewBOs()
        Returns:
        true if this BO has a temporary Id that is from the range for new BOs and this BO was actually created in a tx
      • hasBOAssignedTempId

        public final boolean hasBOAssignedTempId()
        Returns:
        true if this BO has a temporary Id that was assigned by the BO class
      • hasSessionAssignedTempId

        public final boolean hasSessionAssignedTempId()
        Returns:
        true if this BO has a temporary Id that was assigned by the BackendSession (server-side only)
      • isTempId

        public static final boolean isTempId(java.lang.Long l)
        Returns:
        true if the passed Id qualifies as a temporary Id, i.e. it may have come from a temporary BO or a new and unsaved BO.
      • isTempIdForNewInstance

        public static final boolean isTempIdForNewInstance(java.lang.Long l)
        Returns:
        true if the passed Id qualifies as a temporary Id of a new non-temporary BO, i.e. it may have come from an unsaved BO. This is not 100% sure, as one might run into the range for temporary BO Ids if a LOT of objects are created in a Transaction (more than a million, c.f. de.ipcon.mytism.MyTISMContantsI.INITIAL_TEMP_ID_BO).
      • isBOAssignedTempId

        public static final boolean isBOAssignedTempId(java.lang.Long l)
        Returns:
        true if the passed Id qualifies as a temporary Id that was assigned by the BO class, i.e. it may have come from a temporary BO or a new and unsaved BO.
      • isSessionAssignedTempId

        public static final boolean isSessionAssignedTempId(java.lang.Long l)
        Returns:
        true if the passed Id qualifies as a temporary Id that was assigned by the BackendSession (server-side only), i.e. it is a temporary BO that was created server-side (probably during a projection query)
      • getBOVersion

        public int getBOVersion()
        Description copied from interface: BOI
        A value that is incremented each time the BO is modified.
        Specified by:
        getBOVersion in interface BOI
      • slim

        public void slim()
        This method removes all many-relation collections to save memory.     * Please use when pulling objects into a cache on the server side, otherwise the whole persistence stuff will not be gc()'ed.
      • slim

        public void slim(java.util.HashSet rechash)
      • slim

        public void slim(java.util.HashSet rechash,
                         boolean force)
      • slim

        public void slim(boolean force)
      • acquireTxWriteLock

        public final void acquireTxWriteLock()
        Tries to acquire the write-lock of the loading tx, if any.
      • releaseTxWriteLock

        public final void releaseTxWriteLock()
        Tries to release the write-lock of the loading tx, if any.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class Synchable
        Throws:
        java.lang.CloneNotSupportedException
      • getClazz

        public java.lang.Class getClazz()
        Specified by:
        getClazz in interface BOI
        Returns:
        the Java Class Object for this BO
      • needsReload

        public final boolean needsReload()
        Returns true if this BO needs to be reloaded, i.e. the current class does not match its defined clazz.
      • isStub

        public final boolean isStub()
        Returns true if this BO is a "stub". "Stubs" contain only the Id and BOT of a BO and are normally used during de-/serialization of BOProcs.
        Returns:
        true if this BO is a "stub".
      • stub

        public BO stub()
        Returns a "stubbed" version of this BO, i.e. a new instance containing only the Id and the BOT of this BO.
        Returns:
        a "stubbed" version of this BO
      • destub

        public BO destub(BOLoaderI bol)
        Returns the "real" BO for this "stubbed" BO, loaded via the passed BOLoaderI. "Stubs" contain only the Id and clazz (i.e. BOT) of a BO.
        Parameters:
        bol - the BOLoaderI to load the "real" BO with
        Returns:
        the "real" BO for this "stubbed" BO, loaded via the passed BOLoaderI.
      • requireNonEmptyRelation

        public java.util.Map requireNonEmptyRelation(java.lang.String attPath)
                                              throws de.ipcon.tools.MissingArgumentException
        Parameters:
        attPath - the attribute path to a many-relation to check
        Returns:
        the contents of the given many-relation as Map, if it was not empty
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        java.lang.IllegalArgumentException - if the given attribute path does not point to a many-relation
        AttributeResolveException - if an attribute along the attPath is unknown.
        de.ipcon.tools.MissingArgumentException - if the relation is empty
      • requireNonNullAttribute

        public java.lang.Object requireNonNullAttribute(java.lang.String attPath)
                                                 throws de.ipcon.tools.MissingArgumentException
        Parameters:
        attPath - the attribute path to check
        Returns:
        the given value, if it was not null
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if an attribute along the attPath is unknown.
        de.ipcon.tools.MissingArgumentException - if the value is null
      • requireNonNullAttributes

        public void requireNonNullAttributes(java.lang.String attPath1,
                                             java.lang.String attPath2)
                                      throws de.ipcon.tools.MissingArgumentException
        Parameters:
        attPath1 - the first attribute path to check
        attPath2 - the second attribute path to check
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if one of the attributes along the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if a value is null
      • requireNonNullAttributes

        public void requireNonNullAttributes(java.lang.String attPath1,
                                             java.lang.String attPath2,
                                             java.lang.String attPath3)
                                      throws de.ipcon.tools.MissingArgumentException
        Parameters:
        attPath1 - the first attribute path to check
        attPath2 - the second attribute path to check
        attPath3 - the third attribute path to check
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if one of the attributes along the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if a value is null
      • requireNonNullAttributes

        public void requireNonNullAttributes(java.lang.String attPath1,
                                             java.lang.String attPath2,
                                             java.lang.String attPath3,
                                             java.lang.String attPath4)
                                      throws de.ipcon.tools.MissingArgumentException
        Parameters:
        attPath1 - the first attribute path to check
        attPath2 - the second attribute path to check
        attPath3 - the third attribute path to check
        attPath4 - the fourth attribute path to check
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if one of the attributes along the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if a value is null
      • requireNonNullAttributes

        public void requireNonNullAttributes(java.lang.String attPath1,
                                             java.lang.String attPath2,
                                             java.lang.String attPath3,
                                             java.lang.String attPath4,
                                             java.lang.String attPath5)
                                      throws de.ipcon.tools.MissingArgumentException
        Parameters:
        attPath1 - the first attribute path to check
        attPath2 - the second attribute path to check
        attPath3 - the third attribute path to check
        attPath4 - the fourth attribute path to check
        attPath5 - the fifth attribute path to check
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if one of the attributes along the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if a value is null
      • requireNonNullAttributes

        @Deprecated
        public void requireNonNullAttributes(java.lang.String[] attPaths)
                                                  throws de.ipcon.tools.MissingArgumentException
        Deprecated. please use the requireNonNullAttributes functions taking separate attribute path parameters instead
        Parameters:
        attPaths - a String-array with all attribute path to check for being non-null on this BO
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if an attribute along one of the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if a value is null
      • requireNonNullAttributes

        public static BO[] requireNonNullAttributes(BO[] bos,
                                                    java.lang.String[] attPaths)
                                             throws de.ipcon.tools.MissingArgumentException
        Checks if ANY of the given values along the passed attribute paths are missing on ANY of the given BOs. If an exception is thrown, the message will contain a readable list of attribute-path - BO pairs, that shall help identify which BOs are missing which attributes.
        Parameters:
        bos - the BOs to check for non null properties
        attPaths - the attribute paths to check
        Returns:
        the list of BOs passed into this method
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if an attribute along on of the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if one or more values were null on one or more BOs
      • requireNonNullAttributes

        public static java.util.Collection requireNonNullAttributes(java.util.Collection bos,
                                                                    java.util.Collection attPaths)
                                                             throws de.ipcon.tools.MissingArgumentException
        Checks if ANY of the given values along the passed attribute paths are missing on ANY of the given BOs. If an exception is thrown, the message will contain a readable list of attribute-path - BO pairs, that shall help identify which BOs are missing which attributes.
        Parameters:
        bos - the BOs to check for non null properties
        attPaths - the attribute paths to check
        Returns:
        the list of BOs passed into this method
        Throws:
        java.lang.IllegalStateException - if schema is missing.
        AttributeResolveException - if an attribute along on of the attPaths is unknown.
        de.ipcon.tools.MissingArgumentException - if one or more values were null on one or more BOs
      • markCompoundChangeInProgress

        public static final void markCompoundChangeInProgress()
      • releaseCompoundChangeInProgress

        public static final void releaseCompoundChangeInProgress()
      • isCompoundChangeInProgress

        public static final boolean isCompoundChangeInProgress()
      • describeId

        public static java.lang.String describeId(BO bo)
        Returns a nice description of the given BO with appended Id in brackets. Format is according to the given pattern or as specified in the schema if pattern is null.
      • describeId

        public static java.lang.String describeId(BO bo,
                                                  java.lang.String pattern)
      • describeId

        public static java.lang.String describeId(BO bo,
                                                  java.lang.String pattern,
                                                  boolean evenWhenStub)
      • describeId

        public static java.lang.String describeId(BO bo,
                                                  java.lang.String pattern,
                                                  boolean evenWhenStub,
                                                  java.lang.String nullString)
      • describe

        public static java.lang.String describe(BO bo)
        Returns a nice description of the given BO. Format is according to the given pattern or as specified in the schema if pattern is null.
      • describe

        public static java.lang.String describe(BO bo,
                                                java.lang.String pattern)
      • describe

        public static java.lang.String describe(BO bo,
                                                java.lang.String pattern,
                                                boolean evenWhenStub)
        Returns a nice description of the given BO. Format is according to the given pattern or as specified in the schema if pattern is null.
      • describe

        public static java.lang.String describe(BO bo,
                                                java.lang.String pattern,
                                                boolean evenWhenStub,
                                                java.lang.String nullString)
      • describe

        public static java.lang.String describe(BO bo,
                                                java.lang.String pattern,
                                                boolean evenWhenStub,
                                                java.lang.String nullString,
                                                boolean addId)
      • describeNE

        public static java.lang.String describeNE(BO bo)
        Returns a nice description of the given BO. Format is according to the given pattern or as specified in the schema if pattern is null. If the description is not empty, it is returned as is. If the description is empty, an alternative description enclosed in « and » is generated: The conciseDesc without runtime-infos is returned.
      • describeNE

        public static java.lang.String describeNE(BO bo,
                                                  java.lang.String pattern)
      • describeNE

        public static java.lang.String describeNE(BO bo,
                                                  java.lang.String pattern,
                                                  boolean evenWhenStub)
      • describeNE

        public static java.lang.String describeNE(BO bo,
                                                  java.lang.String pattern,
                                                  boolean evenWhenStub,
                                                  java.lang.String nullString)
      • describeNE

        public static java.lang.String describeNE(BO bo,
                                                  java.lang.String pattern,
                                                  boolean evenWhenStub,
                                                  java.lang.String nullString,
                                                  boolean addId)
      • describeId

        public java.lang.String describeId()
        Returns a nice description of this BO with appended Id in brackets. Format is according to the given pattern or as specified in the schema if pattern is null.
      • describeId

        public java.lang.String describeId(java.lang.String _pattern)
      • describeId

        public java.lang.String describeId(java.lang.String _pattern,
                                           boolean _evenWhenStub)
      • describeId

        public java.lang.String describeId(java.lang.String _pattern,
                                           boolean _evenWhenStub,
                                           SchemaI _schema)
      • describe

        public java.lang.String describe()
        Description copied from interface: DescribableI
        Returns a nice description of this DescribableI. Format is specified in the schema.
        Specified by:
        describe in interface DescribableI
      • describe

        public java.lang.String describe(java.lang.String _pattern)
        Description copied from interface: DescribableI
        Returns a nice description of this DescribableI. Format is according to the given pattern or as specified in the schema if pattern is null.
        Specified by:
        describe in interface DescribableI
      • describe

        public java.lang.String describe(java.lang.String _pattern,
                                         boolean _evenWhenStub)
      • describe

        public java.lang.String describe(java.lang.String _pattern,
                                         boolean _evenWhenStub,
                                         SchemaI _schema)
      • describe

        public java.lang.String describe(java.lang.String _pattern,
                                         boolean _evenWhenStub,
                                         SchemaI _schema,
                                         boolean _addId)
      • getRootLoaderSchema

        public SchemaI getRootLoaderSchema()
        Returns the SchemaI of the root loader of this BO's BOLoaderI. Returns null if this BO has no BOLoaderI.
        Specified by:
        getRootLoaderSchema in interface BOI
      • getSchema

        public SchemaI getSchema()
        Returns the currently used SchemaI, i.e. the SchemaI of this BO's BOLoaderI. Returns null if this BO has no BOLoaderI.
        Specified by:
        getSchema in interface BOI
        Specified by:
        getSchema in interface SchemaProviderI
        Returns:
        the SchemaI instance used by this object or null, if no Schema is available
      • getPermissionHandler

        public PermissionHandlerI getPermissionHandler()
        Returns the PermissionHandlerI for this BO, i.e. the one of the SchemaI of this BO's BOLoaderI or null if this BO has no BOLoaderI or SchemaI.
        Returns:
        the PermissionHandlerI for this BO
      • cancelRecalc

        public final boolean cancelRecalc()
        Returns true if we are not part of a Transaction or if the Transaction is in OTR mode, is in sync mode or is locked. This method should be used to cancel any recalcs in BOs instead of only asking if getTransaction() is null. Attention: In non-persistent entities you should not use this, as the construction of data in setters / adders might be cancelled otherwise! The method is final, because it would be a VERY bad idea to overwrite it, as NPEs would most probably ensue, because the contract of this method is that getTransaction() returns a non-null value if we return false, and the code quite heavily relies on that everywhere.
      • cancelRecalcViaLoadingTransaction

        public final boolean cancelRecalcViaLoadingTransaction()
        Returns true if we were not loaded by a Transaction or if the loading Transaction is in OTR mode, is in sync mode or is locked. This method should be used to cancel any recalcs in BOs that were loaded but not yet included into the Transaction instead of only asking if getLoadingTransaction() is null. Attention: In non-persistent entities you should not use this, as the construction of data in setters / adders might be cancelled otherwise! The method is final, because it would be a VERY bad idea to overwrite it, as NPEs would most probably ensue, because the contract of this method is that getLoadingTransaction() returns a non-null value if we return false, and the code quite heavily relies on that everywhere.
      • isCurrentTransactionUnderAdminControl

        public boolean isCurrentTransactionUnderAdminControl()
        Returns true, if we are part of a Transaction that has an Admin as current user.
      • getSizeFast

        public int getSizeFast(java.lang.String _what)
        Determines the size of a many-relation, if still lazy by querying the database (i.e. sizeFast) thus not reflecting changes being made in the current transaction!
        Parameters:
        _what - Name of the many-relation-attribute, for which the size shall be determined
        Returns:
        the size of the map if not lazy, otherwise the number of BOs being in this relation in the database
      • hasRelationObjects

        public static boolean hasRelationObjects(java.util.Map m)
        Returns true if the given map contains at least one (if specified: not deleted) entry, false otherwise
      • hasRelationObjects

        public static boolean hasRelationObjects(java.util.Map m,
                                                 boolean ignoreDeleted)
      • exWriteString

        public static void exWriteString(java.io.ObjectOutput s,
                                         java.lang.String val)
                                  throws java.io.IOException
        Null aware String writer function, with a workaround for 64k prob of writeUtf().
        Parameters:
        s - the output to stream the String into
        val - a String, can be null and length can be >64k
        Throws:
        java.io.IOException
      • exReadString

        public static java.lang.String exReadString(java.io.ObjectInput s)
                                             throws java.io.IOException
        Null aware String reader function, with a workaround for 64k prob of readUtf().
        Parameters:
        s - the Input to read from
        Returns:
        a String with the written data or null, if original written String was null
        Throws:
        java.io.IOException
      • getBackendBOLoaderWithPersistenceHandler

        public final BackendBOLoaderWithPersistenceHandlerI getBackendBOLoaderWithPersistenceHandler()
        Returns the first BackendBOLoaderWithPersistenceHandlerI of this BO in its loader-chain if it was loaded in the backend and has such a loader.
      • isServerSideAndLoadedReadOnly

        public final boolean isServerSideAndLoadedReadOnly()
        Returns true if this BO was loaded read-only in the backend.
      • getBOLoader

        public final BOLoaderI getBOLoader()
        Returns the BOLoaderI of this BO.
      • setBOLoader

        public void setBOLoader(BOLoaderI newLoader)
        this method is overridden by subclasses to set n-1 relations to the same BOLoader
      • setBOLoaderNoCascade

        public void setBOLoaderNoCascade(BOLoaderI newLoader)
        special version which is only overridden by subclass BOT and must not be overwritten by any other subclass, changes just this very BO
      • setBOLoaderNoCascade

        public void setBOLoaderNoCascade(BOLoaderI newLoader,
                                         boolean ignoreAlreadyBOAssignedTempId)
      • readExternal

        public void readExternal(java.io.ObjectInput s)
                          throws java.lang.ClassNotFoundException,
                                 java.io.IOException
        For better transfer performance, the serialization is done via Externalizable interface. All subclasses do this with the help of the source code generator.
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • writeExternal

        public void writeExternal(java.io.ObjectOutput s)
                           throws java.io.IOException
        For better transfer performance, the serialization is done via Externalizable interface. All subclasses do this with the help of the source code generator.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • nullSafeEquals

        public static final boolean nullSafeEquals(java.lang.Object o1,
                                                   java.lang.Object o2)
        Returns true if the passed Objects are equal. If both objects are instances of BO, #nullSafeEqualsBO(BO,BO) is called, otherwise the Objects are passed to NullCheckTools.nullSafeEquals(Object,Object).
      • nullSafeEqualsBO

        public static final boolean nullSafeEqualsBO(BOI bo1,
                                                     BOI bo2)
        Returns true if the passed BOs are either object-identic or they have the same Id. If the BOs have differing BOLoaderI-s and either one is still new, they are treated as different, as new BOs must have the same BOLoaderI, so the negative Ids are unique. If parameter idComparisonOnly is passed as false, we compare the passed BOs using equals(Object).
      • nullSafeEqualsBO

        public static final boolean nullSafeEqualsBO(BOI bo1,
                                                     BOI bo2,
                                                     boolean idComparisonOnly)
      • equalsBO

        public final boolean equalsBO(BOI bo)
        Description copied from interface: BOI
        nullSafeEqualsBO(BOI, BOI) is called with this BOI as first parameter and the passed BOI as second one.
        Specified by:
        equalsBO in interface BOI
      • equalsBO

        public final boolean equalsBO(BOI bo,
                                      boolean idComparisonOnly)
        Description copied from interface: BOI
        nullSafeEqualsBO(BOI, BOI) is called with this BOI as first parameter and the passed BOI as second one.
        Specified by:
        equalsBO in interface BOI
      • equals

        public boolean equals(java.lang.Object o)
        Checks if this BO equals the passed object. Two BOs are equal, if they have the same Id and the same Payload. If the IDs of the BOs are the same, but they are not the same Java-Object, then a check for equal payloads is executed, which recursively compares the BO-graph.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - a BO which should be compared to this object
        Returns:
        true if this equals the passed object o, false if o is not a BO or if the two BOs have different Ids or a different payload.
      • equalPayload

        public boolean equalPayload(BO s)
        Compare the payload of this to the provided BO.
        Returns:
        true
      • equalPayload

        public boolean equalPayload(BO other,
                                    java.util.Collection<java.lang.String> attrs)
        Returns true if the payloads of the this BO and the passed BO are the same regarding the passed attribute names.
        Parameters:
        other - a BO to compare the payload of this BO with
        attrs - a Collection of Strings representing the attribute names for the payload values to compare
        otherAttrs - a Collection of Strings representing the attribute names for the payload values of the passed other BO (optional, if not given the attrs are used for the other BO as well)
        Returns:
        true if the payloads of the this BO and the passed BO are the same regarding the passed attribute names.
      • equalPayload

        public boolean equalPayload(BO other,
                                    java.util.Collection<java.lang.String> attrs,
                                    java.util.Collection<java.lang.String> otherAttrs)
      • equalPayload

        public boolean equalPayload(BO other,
                                    java.lang.String[] attrs)
        Returns true if the payloads of the this BO and the passed BO are the same regarding the passed attribute names.
        Parameters:
        other - a BO to compare the payload of this BO with
        attrs - a String array representing the attribute names for the payload values to compare
        otherAttrs - a String array representing the attribute names for the payload values of the passed other BO (optional, if not given the attrs are used for this BO and the other BO)
        Returns:
        true if the payloads of the this BO and the passed BO are the same regarding the passed attribute names.
      • equalPayload

        public boolean equalPayload(BO other,
                                    java.lang.String[] attrs,
                                    java.lang.String[] otherAttrs)
      • nullSafeContainsBO

        public static boolean nullSafeContainsBO(java.util.Map<java.lang.Long,? extends BOI> m,
                                                 BOI bo)
        Returns true if the passed (relation-)Map contains the passed BO.
      • nullSafeContainsBO

        public static boolean nullSafeContainsBO(java.util.Collection<? extends BOI> c,
                                                 BOI bo)
        Returns true if the passed (BO-)Collection contains the passed BO (using #equalsBO(BO)).
      • nullSafeCompareTo

        public static int nullSafeCompareTo(java.lang.Comparable first,
                                            java.lang.Object second)
        Compares first object with second object for order without failing if any of them is null. Returns a negative integer, zero, or a positive integer as first object is less than, equal to, or greater than second, while null being equal to itself and - if nullIsSmaller is passed as true - treated as smaller than everything. FIXME! 2021-08-18 fs, doesn't this method belong into class misc?
      • nullSafeCompareTo

        public static int nullSafeCompareTo(java.lang.Comparable first,
                                            java.lang.Object second,
                                            boolean nullIsSmaller)
      • deepClone

        public BO deepClone()
      • createCopy

        public BO createCopy()
        Creates a copy of this BO. If a Transaction is given, the copy will first be included in this TX to record all the copy operations. Uses copyFrom() to copy the values from this to the new instance. CAUTION: *ALL* n-1-reachable objects will be copied as well! Attention: Does not honour the "omitOnCopy" flag from the schema!
        Parameters:
        _tx - a Transaction to include the newly created copy in and to record the copy operations
        Returns:
        a copy of this BO
        See Also:
        de.ipcon.db.core.BO#copyFrom(), de.ipcon.db.core.Transaction#includeCopy()
      • copyFrom

        @Deprecated
        public void copyFrom(BO s)
        Deprecated. 
        Copies all scalar and -1 relations from the given BO into this BO. If a Transaction is given previously already existing objects that are referenced by -1 relations are frapped via _tx.frapFromCache() before the reference is set in the copy; for new objects a copy of that object is also created in the Transaction via createCopy(). Automatically overwritten in generated subclasses. Attention: Does not honour the "omitOnCopy" flag from the schema!
        Parameters:
        s - the BO whose data shall be copied to this BO
        _tx - a Transaction to frap or include relation objects with/in; may be null
        See Also:
        createCopy(), de.ipcon.db.core.Transaction#includeCopy()
      • markDelete

        public final void markDelete()
        Marks this BO as deleted, without actually calling the delete() method, thereby keeping linked relations intact.
      • markUndelete

        public final void markUndelete()
      • delete

        public void delete()
        Recursively marks this and any BOs in dependent many-relations as deleted. Does not unchain the manyrelation, but only marks the objects within as deleted. This BO needs to be included in a transaction for this to work as expected.
      • undelete

        public void undelete()
        Recursively marks this and any BOs in dependent many-relations as not deleted. Cannot restore previously unchained many-relations. This BO needs to be included in a transaction for this to work as expected.
      • setTempId

        public void setTempId()
        Initializes the Id of this BO with the next free temporary id. Do only call if this BO has no Id yet (getId()==null), otherwise an IllegalArgumentException is thrown.
      • nextTempId

        public static java.lang.Long nextTempId()
        Returns the next free temporary Id. If you need a temporary Id for a BO, please consider using BO#setTempId()
        Returns:
        a Long with a negative value for the next temporary id.
      • frap

        public static BO frap(BOLoaderI bol,
                              BO bo)
        Static convenience method, which fraps the passed BO using the passed BOLoaderI in a null-safe way.
        Parameters:
        bol - the BOLoaderI to be used for frapping
        bo - the BO to be frapped
        Returns:
        a frapped instance of the passed BO
        See Also:
        Transaction.frapFromCache(BO)
      • getTransaction

        public final Transaction getTransaction()
        Returns the Transaction this BO is included in, null otherwise.
        Returns:
        the Transaction this BO is included in, null otherwise. Nullable
      • needTransactionInclusion

        public Transaction needTransactionInclusion()
        Returns the Transaction this BO is included in.
        Returns:
        the Transaction this BO is included in.
        Throws:
        NotIncludedInTransactionException - if this BO is not included in a Transaction
      • getLoadingTransaction

        public Transaction getLoadingTransaction()
        Returns the Transaction this BO has been loaded by or is included in. If this BO is neither included in nor has been loaded by a Transaction, then null is returned. E.g. BOs that were loaded with a the client or the server directly or where these have been wrapped in a CachingBOLoader will always return null here.
        Returns:
        a Transaction this BO has been included in or was loaded by. Null otherwise.
      • needLoadingTransaction

        public Transaction needLoadingTransaction()
        Returns the Transaction this BO has been loaded by or is included in.
        Returns:
        the Transaction this BO has been loaded by or is included in.
        Throws:
        NotLoadedByTransactionException - if this BO has not been loaded by or is not included in a Transaction.
      • hasActiveTransaction

        public final boolean hasActiveTransaction()
        Returns true if this BO is included in a Transaction.
      • includeInTransaction

        public void includeInTransaction(Transaction includeInTx)
        Includes this BO instance in the passed Transaction if it is allowed. We NEVER allow including stubs here unless in sync mode, as it makes no sense at all in all other cases.
        Parameters:
        includeInTx - the Transaction to include this BO into
      • includeAllowed

        public boolean includeAllowed(Transaction includeInTx)
        Returns true if inclusion of this BO in the passed Transaction is actually allowed. We only allow inclusion if this BO was not loaded by a different Transaction, to avoid bleeding changes into the other Transaction.
        Parameters:
        includeInTx - the Transaction to check if inclusion into it is allowed
        Returns:
        true if inclusion of this BO in the passed Transaction is allowed
      • commitTransaction

        public void commitTransaction()
      • copyBLOBFrom

        public ManagedFileI copyBLOBFrom(BO blobSource)
                                  throws java.io.IOException
        Store the BLOB from the passed BO as BLOB of this BO.
        Parameters:
        src - a BO to retrieve the BLOB data from.
        Returns:
        the ManagedFileI instance that resulted from storing the copied BLOB or the src.
        Throws:
        java.io.IOException
      • storeBLOB

        public final ManagedFileI storeBLOB(java.io.InputStream is)
                                     throws java.io.IOException
        Any BO can have a physical file (BLOB) which is stored on server-side and synchronized to all sync nodes. This method fills this BOs BLOB with the given InputStream and replaces the current BLOB (if any) of this BO, if it is included in a transaction.
        Parameters:
        is - the InputStream to retrieve the BLOB data from; will be closed after the data was read from it.
        Returns:
        the ManagedFileI instance that resulted from storing the BLOB.
        Throws:
        java.io.IOException
      • storeBLOB

        public final ManagedFileI storeBLOB(java.io.File f)
                                     throws java.io.IOException,
                                            java.io.FileNotFoundException
        Store the passed file as BLOB of this BO.
        Parameters:
        f - a File to retrieve the BLOB data from.
        Returns:
        the ManagedFileI instance that resulted from storing the BLOB.
        Throws:
        java.io.IOException
        java.io.FileNotFoundException
      • storeBLOB

        public final ManagedFileI storeBLOB(byte[] bytes)
                                     throws java.io.IOException
        Creates a ByteArrayInputStream from the passed byte-array, then calls storeBLOB(InputStream)
        Parameters:
        bytes - A byte-array of data
        Returns:
        the ManagedFileI instance that resulted from storing the BLOB.
        Throws:
        java.io.IOException
      • storeBLOB

        public final ManagedFileI storeBLOB(java.lang.String s)
                                     throws java.io.IOException
        Fill this BOs BLOB with the given String content. Same as invoking storeBLOB(byte[]) with the result of String.getBytes('UTF8')
        Parameters:
        s - Some String data
        Returns:
        the ManagedFileI instance that resulted from storing the BLOB.
        Throws:
        java.io.IOException
      • removeBLOB

        public final ManagedFileI removeBLOB()
        Any BO can have a physical file (BLOB) which is stored on server-side and synchronized to all sync nodes. This method removes the current BLOB (if any) of this BO, if it is included in a transaction.
        Returns:
        the ManagedFileI instance that resulted from removing the BLOB.
      • forgetTransientBLOBHandle

        public final void forgetTransientBLOBHandle()
      • hasBLOB

        public final boolean hasBLOB()
        Specified by:
        hasBLOB in interface BOI
        Returns:
        true, if there is a stream resource attached to this BO
      • hasBLOBOnServerSide

        public final boolean hasBLOBOnServerSide()
        Returns true, if there is a stream resource attached to this BO on server-side. This causes a roundtrip to server on each call.
        Returns:
        true, if there is a stream resource attached to this BO on server-side.
      • getBLOBInfo

        public final VFile getBLOBInfo()
        Returns:
        the current VFile for the stream resource attached to this BO
      • getBLOB

        public final byte[] getBLOB()
        For congruency of *BLOB -method names: If this BO has a BLOB on the current server, returns the bytes of it. If not, null is returned. Delegates to getBytes()
        Returns:
        a bytearray or null
      • getBLOB

        public final long getBLOB(java.io.OutputStream target)
                           throws java.io.IOException
        Streams this BO's BLOB to the given stream
        Specified by:
        getBLOB in interface BOI
        Returns:
        the written bytecount
        Throws:
        java.io.IOException
      • getBLOB

        public final long getBLOB(java.io.OutputStream target,
                                  boolean closeOS)
                           throws java.io.IOException
        Streams this BO's BLOB to the given stream
        Specified by:
        getBLOB in interface BOI
        Returns:
        the written bytecount
        Throws:
        java.io.IOException
      • getBLOBAsInputStream

        public final BLOBInputStream getBLOBAsInputStream()
                                                   throws java.io.IOException
        Returns a BLOBInputStream that the data of this BOs BLOB is streamed into. Attention: The BLOBInputStream might be empty if this instance does not actually have a BLOB attached. You can check that via BLOBInputStream::isEmpty to avoid problems down the road.
        Throws:
        java.io.IOException
      • getBLOBAsDataInput

        public final BLOBDataInputStream getBLOBAsDataInput()
                                                     throws java.io.IOException
        Returns a BLOBDataInputStream that the data of this BOs BLOB is written into. Attention: The BLOBDataInputStream might be empty if this instance does not actually have a BLOB attached. You can check that via BLOBDataInputStream::isEmpty to avoid problems down the road.
        Throws:
        java.io.IOException
      • getBLOB

        public final long getBLOB(java.io.DataOutput target)
                           throws java.io.IOException
        Writes this BO's BLOB to the given DataOutput
        Returns:
        the written bytecount
        Throws:
        java.io.IOException
      • getBLOB

        public final long getBLOB(java.io.DataOutput target,
                                  boolean closeOS)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getBytes

        public final byte[] getBytes()
        If this BO has a stream on the current server, returns the bytes of it. If not, null is returned
        Returns:
        a bytearray or null
      • invalidateBLOBCache

        public final void invalidateBLOBCache()
      • exportBLOB

        public final void exportBLOB(java.io.File target)
                              throws java.io.IOException
        Write the attached BLOB, if given, to the provided File.
        Parameters:
        target - File to be written to
        Throws:
        {@link - java.io.IOException} can occur when reading out the BLOB as InputStream
        java.io.IOException
      • bumpVersion

        public final void bumpVersion()
        Description copied from interface: BOI
        increase version value to signal a modification
        Specified by:
        bumpVersion in interface BOI
      • notifyMessageBus

        public final void notifyMessageBus(java.lang.String attrname)
        Convenience method for notifyMessageBus(AttributeI, Object, Object) to lookup the attribute for the given name. Attribute has to exist on this Entity, no paths allowed
        Throws:
        java.lang.IllegalStateException - if the attribute is not found or is an attribute path
      • notifyMessageBus

        public final void notifyMessageBus(java.lang.String attrname,
                                           java.lang.Object newValue)
      • notifyMessageBus

        public final void notifyMessageBus(java.lang.String attrname,
                                           java.lang.Object newValue,
                                           java.lang.Object oldValue)
      • notifyMessageBus

        public final void notifyMessageBus(AttributeI attr)
        Notify the messageBus of the LoadingTransaction of a changed value on a non persistent attribute. To be used for scalars and n-1 relations. Can be used for many relations as well, which will interpret the newValue as being added and the oldValue as being removed. Automatically bumps the Version on this BO before creating the message.
        Parameters:
        attr - the nonnull attributeI to notify a change for
        newValue - the newValue the attribute on this BO was changed to. For ManyRelations, a BO that was added.
        oldValue - the optional oldValue from before the change. Can be null if not available. For ManyRelations, a BO that was removed.
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute was passed
      • notifyMessageBus

        public final void notifyMessageBus(AttributeI attr,
                                           java.lang.Object newValue)
      • notifyMessageBus

        public final void notifyMessageBus(AttributeI attr,
                                           java.lang.Object newValue,
                                           java.lang.Object oldValue)
      • notifyMessageBusOfAdd

        public final void notifyMessageBusOfAdd(AttributeI attr,
                                                BO added)
        Notify the message bus of the loadingTransaction of an added BO on a virtual many relation. All arguments are mandatory.
        Parameters:
        attr - the virtual attribute the BO was added to
        added - the BO that was added
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute or BO was passed
      • notifyMessageBusOfRemove

        public final void notifyMessageBusOfRemove(AttributeI attr,
                                                   BO removed)
        Notify the message bus of the loadingTransaction of a removed BO on a virtual many relation. All arguments are mandatory.
        Parameters:
        attr - the virtual attribute the BO was removed from
        removed - the BO that was removed
        Throws:
        de.ipcon.tools.MissingArgumentException - if no attribute or BO was passed
      • getDescribingBOWrapper

        public BOWrapperI getDescribingBOWrapper(java.lang.String frmat)
        Encapsulates BO into Wrapper object which returns given CBOFormat string value on toString() calls. Very nice to use in JLists and front end handling.
        Parameters:
        frmat - a string in CBOFormat style
        Returns:
        wrapper object which returns the given CBOFormat string back on toString() calls
      • getDescribingBOWrapper

        public BOWrapperI getDescribingBOWrapper()
        Encapsulates BO into Wrapper object which returns the standard CBOFormat string on toString() calls. Very nice to use in JLists and front end handling.
        Returns:
        wrapper object which returns the given CBOFormat string back on toString() calls
      • aggregate

        public AggregateFunctionI aggregate(java.lang.String s,
                                            java.lang.String pathlist)
      • aggregate

        public AggregateFunctionI aggregate(java.lang.String s,
                                            java.lang.String pathlist,
                                            java.lang.String parameters)
      • conciseDesc

        public final java.lang.String conciseDesc()
        Description copied from interface: DescribableI
        Returns a concise description for this DescribableI consisting of classname, Id and Ldel/New status. Additionally it is shown if the BO is a stub or if the DescribableI needs to be reloaded to get an instance with the actual subclass. Includes the hashCode as well. Please *do* keep this description *concise* and only add stuff it is really important and useful (and I can't currently think of anything else which fits these criteria :-)
        Specified by:
        conciseDesc in interface DescribableI
        Returns:
        a concise description for this DescribableI.
      • conciseDesc

        public final java.lang.String conciseDesc(boolean showRuntimeInfo)
        Description copied from interface: DescribableI
        Returns a concise description for this DescribableI consisting of classname, Id and Ldel/New status. Please *do* keep this description *concise* and only add stuff it is really important and useful (and I can't currently think of anything else which fits these criteria :-)
        Specified by:
        conciseDesc in interface DescribableI
        Parameters:
        showRuntimeInfo - if true will also include if DescribableI is a stub or if the DescribableI needs to be reloaded to get an instance with the actual subclass and will include the hashCode.
        Returns:
        a concise description for this DescribableI.
      • conciseDesc

        public final java.lang.String conciseDesc(boolean showRuntimeInfo,
                                                  boolean showCreaLmod)
        Description copied from interface: DescribableI
        Returns a concise description for this DescribableI consisting of classname, Id and Ldel/New status. Please *do* keep this description *concise* and only add stuff it is really important and useful (and I can't currently think of anything else which fits these criteria :-)
        Specified by:
        conciseDesc in interface DescribableI
        Parameters:
        showRuntimeInfo - if true will also include if DescribableI is a stub or if the DescribableI needs to be reloaded to get an instance with the actual subclass and will include the hashCode.
        showCreaLmod - if false will not show Crea and Lmod values; if true these values will be appended to the description.
        Returns:
        a concise description for this DescribableI.
      • conciseDesc

        public final java.lang.String conciseDesc(boolean showRuntimeInfo,
                                                  boolean showCreaLmod,
                                                  boolean useClientSideId)
        Description copied from interface: DescribableI
        Returns a concise description for this DescribableI consisting of classname, Id and Ldel/New status. Please *do* keep this description *concise* and only add stuff it is really important and useful (and I can't currently think of anything else which fits these criteria :-)
        Specified by:
        conciseDesc in interface DescribableI
        Parameters:
        showRuntimeInfo - if true will also include if DescribableI is a stub or if the DescribableI needs to be reloaded to get an instance with the actual subclass and will include the hashCode.
        showCreaLmod - if false will not show Crea and Lmod values; if true these values will be appended to the description.
        useClientSideId - if true the Id that is known on client-side is used; on server-side we might already have an unsaved positive Id, but for the description e.g. in a server-side error message it might be less confusing to use the Id that is known on the client; e.g. when used inside a SaveVetoException it might otherwise be very confusing to report an Id that is discarded again and never used in the database ever.
        Returns:
        a concise description for this DescribableI.
      • conciseDesc

        public static final java.lang.String conciseDesc(BO bo)
        Null-safe static version of conciseDesc, which returns the 'null' String for a null BO and calls conciseDesc on the BO otherwise.
      • conciseDesc

        public static final java.lang.String conciseDesc(BO bo,
                                                         boolean showRuntimeInfo)
      • conciseDesc

        public static final java.lang.String conciseDesc(BO bo,
                                                         boolean showRuntimeInfo,
                                                         boolean showCreaLmod)
      • conciseDesc

        public static final java.lang.String conciseDesc(BO bo,
                                                         boolean showRuntimeInfo,
                                                         boolean showCreaLmod,
                                                         boolean useClientSideId)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • $

        public java.lang.Object $(java.lang.String attrName)
        Returns the value of the attribute with the given attrName.
      • $$

        public java.util.List<java.lang.Object> $$(java.lang.String attrPath)
        Fetches the value of the given attribute path via projection from the server. This method is intended for use on the client-side, and if called from a virtual property, it should be made "cached" to avoid excessive queries to the server when refreshing the property. For virtual properties along the path or at the end of the path, the server calculates those properties and transfers only the resulting value or values at the end of the path to the client. If the path were walked on the client-side, all values needed for calculating the virtual properties along the path would have to be transferred and evaluated on the client-side, which can result in a significant processing time penalty due to additional roundtrips and transmission time. A notable caveat is that all BOs used for calculating virtual properties along the path are used in their server-state. Therefore, changes made to those BOs in the graph of the calling BO are NOT recognized or considered. However, if the returned objects are BOs, they will be frapped by the BOLoaderI of the BO on which this method is called, meaning that BO instances in the result will be replaced by their current versions in the BO graph of that BOLoaderI. This method can only be used on already persisted BOs, as it performs a query that uses the object Id.
        Parameters:
        attrPath - the attribute path for which to fetch the value via projection from the server
        Returns:
        a list of objects representing the value of the attribute path
      • $$ri

        public java.util.Iterator $$ri(java.lang.String attrPath)
        Fetches an iterator of attribute path specified via projection from the server. This method is intended for use with many-relations on the client-side. For virtual properties along the path or at the end of the path, the server calculates those properties and transfers only the resulting value or values at the end of the path to the client. If the path were walked on the client-side, all values needed for calculating the virtual properties along the path would have to be transferred and evaluated on the client-side, which can result in a significant processing time penalty due to additional roundtrips and transmission time. A notable caveat is that all BOs used for calculating virtual properties along the path are used in their server-state. Therefore, changes made to those BOs in the graph of the calling BO are NOT recognized or considered. However, if the returned objects are BOs, they will be frapped by the BOLoaderI of the BO on which this method is called, meaning that BO instances in the result will be replaced by their current versions in the BO graph of that BOLoaderI. This method can only be used on already persisted BOs, as it performs a query that uses the object Id.
        Parameters:
        attrPath - the attribute path to fetch an iterator for
        mapToFill - (optional) a map to fill with the results of the iterator while iterating
        afterLastElementCallback - (optional) a callback to invoke after iterating over the last element of the iterator
        Returns:
        an iterator for the specified attribute path
      • $$ri

        public java.util.Iterator $$ri(java.lang.String attrPath,
                                       java.util.Map mapToFill)
      • $$r

        public java.util.Map $$r(java.lang.String attrPath)
      • $$bo

        public BO $$bo(java.lang.String attrPath)
      • $$o

        public java.lang.Object $$o(java.lang.String attrPath)
      • getAsString

        public java.lang.String getAsString(java.lang.String attrName)
        Returns the value of the attribute with the given attrName as String values, respecting schema defined formatting rules.
      • propertyMissing

        public java.lang.Object propertyMissing(java.lang.String pn)
        Missing getter. For properties with lowercase letters, the resolve uses Groovy's standard method resolving via metaClass. But when accessing a BO-property via Groovy starting with an *uppercase* letter, the resolve ends up here and asks the schema, as dynamic properties in Groovy can *never* start with an uppercase-letter.
      • wrapIfGroovy

        public java.lang.RuntimeException wrapIfGroovy(java.lang.RuntimeException re,
                                                       java.lang.String pn,
                                                       boolean fromGroovy)
      • $

        public void $(java.lang.String attrName,
                      java.lang.Object value)
        Sets the value of the attribute with the given attrName to value.
      • $

        public void $(java.util.Map attrs2values)
        Sets the values of the given attribute-value-map attr2Values.
      • setAsString

        public void setAsString(java.lang.String attrName,
                                java.lang.String value)
        Sets the value of the attribute with the given attrName to value which is a string and will automatically converted to the required attribute type.
      • propertyMissing

        public void propertyMissing(java.lang.String s,
                                    java.lang.Object value)
        Missing setter. For properties with lowercase letters, the resolve uses Groovy's standard method resolving via metaClass. But when accessing a BO-property via Groovy starting with an *uppercase* letter, the resolve ends up here and asks the schema, as dynamic properties in Groovy can *never* start with an uppercase-letter.
      • _set

        public void _set(java.lang.String pn,
                         java.lang.Object value,
                         boolean fromGroovy)
      • add

        public void add(java.lang.String attrName,
                        BO value)
      • remove

        public void remove(java.lang.String attrName,
                           BO value)
      • setTransientProperty

        public java.lang.Object setTransientProperty(java.lang.String name,
                                                     java.lang.Object value,
                                                     int explicitVersion,
                                                     java.util.function.Consumer<java.lang.Object> housekeeperForPreviousVersionedValue)
        Saves a versioned transient value with the provided name for this BO. The saved value is evicted on any changes to this object. Housekeeping is done on the evicted value if a Consumer was passed. If the passed explicit version does not match the current BO version number, the value is not stored in the transientProperties-map but discarded, as it is obviously outdated (and we do not allow setting "future" versions - you need to bump the version properly first using bumpVersion(). All values are put into a map using the name as key. Those values are only transient regarding the persistence in the database. Transient properties created by the client will never be available on the server. Upon frapping / deepCloning any stored value that cannot be serialized will be dropped and replaced by a null-value while logging a warning about that. So keep in mind that non-serializable transient properties might get "lost" then.
        Parameters:
        name - the name of the transient property
        value - the value of this property
        explicitVersion - the version for which the transient property shall be set
        housekeeperForPreviousVersionedValue - a Consumer that is called when an outdated value is evicted, enabling the caller to do some housekeeping on the previous value
        Returns:
        returns the value (as usually a method might end with setting a transient property and returning the very same value)
        See Also:
        de.ipcon.db.core.Transaction#bumpVersion()
      • setTransientProperty

        public java.lang.Object setTransientProperty(java.lang.String name,
                                                     java.lang.Object value,
                                                     java.util.function.Consumer<java.lang.Object> housekeeperForPreviousVersionedValue)
        Saves a versioned transient value with the provided name for this BO. The saved value is evicted on any changes to this object. Housekeeping is done on the evicted value if a Consumer was passed. All values are put into a map using the name as key. Those values are only transient regarding the persistence in the database. Transient properties created by the client will never be available on the server. Upon frapping / deepCloning any stored value that cannot be serialized will be dropped and replaced by a null-value while logging a warning about that. So keep in mind that non-serializable transient properties might get "lost" then.
        Parameters:
        name - the name of the transient property
        value - the value of this property
        housekeeperForPreviousVersionedValue - a Consumer that is called when an outdated value is evicted, enabling the caller to do some housekeeping on the previous value
        Returns:
        returns the value (as usually a method might end with setting a transient property and returning the very same value)
        See Also:
        de.ipcon.db.core.Transaction#bumpVersion()
      • setTransientProperty

        public java.lang.Object setTransientProperty(java.lang.String name,
                                                     java.lang.Object value)
        Saves a transient value with the provided name for this BO. If versioned=true, then the saved value is evicted on any changes to this object. If the passed explicit version does not match the current BO version number, the value is not stored in the transientProperties-map but discarded, as it is obviously outdated (and we do not allow setting "future" versions - you need to bump the version properly first using bumpVersion(). All values are put into a map using the name as key. Those values are only transient regarding the persistence in the database. Transient properties created by the client will never be available on the server. Upon frapping / deepCloning any stored value that cannot be serialized will be dropped and replaced by a null-value while logging a warning about that. So keep in mind that non-serializable transient properties might get "lost" then.
        Specified by:
        setTransientProperty in interface BOI
        Parameters:
        name - the name of the transient property
        value - the value of this property
        versioned - if true, then this value is only valid for this BOVersion.
        explicitVersion - the version for which the transient property shall be set
        Returns:
        returns the value (as usually a method might end with setting a transient property and returning the very same value)
        See Also:
        de.ipcon.db.core.Transaction#bumpVersion()
      • setTransientProperty

        public java.lang.Object setTransientProperty(java.lang.String name,
                                                     java.lang.Object value,
                                                     boolean versioned)
      • setTransientProperty

        public java.lang.Object setTransientProperty(java.lang.String name,
                                                     java.lang.Object value,
                                                     boolean versioned,
                                                     int explicitVersion)
      • setTransientProperty

        public java.lang.Object setTransientProperty(java.lang.String name,
                                                     java.lang.Object value,
                                                     boolean versioned,
                                                     int explicitVersion,
                                                     java.util.function.Consumer<java.lang.Object> housekeeperForPreviousVersionedValue)
      • computeTransientPropertyIfAbsent

        public java.lang.Object computeTransientPropertyIfAbsent(java.lang.String name,
                                                                 java.util.function.Supplier<java.lang.Object> computer,
                                                                 boolean versioned)
      • getTransientProperty

        public java.lang.Object getTransientProperty(java.lang.String name)
        Returns the value that was saved using the given transient property name.
        Specified by:
        getTransientProperty in interface BOI
        Parameters:
        name - the name of the transient property of which the value should be returned
        rawversioned - if true the raw WrappedValue is returned instead of the unwrapped real value
        Returns:
        the value of the transient property with the provided name
      • getTransientProperty

        public java.lang.Object getTransientProperty(java.lang.String name,
                                                     boolean rawwrapped)
      • getWrappedTransientProperty

        public WrappedValue getWrappedTransientProperty(java.lang.String name,
                                                        boolean filterExpired)
      • hasTransientProperty

        public boolean hasTransientProperty(java.lang.String name)
        Description copied from interface: BOI
        Returns true, if a transient property with the given name currently exists.
        Specified by:
        hasTransientProperty in interface BOI
        Parameters:
        name - the name of the transient property that should be checked
        Returns:
        true, if a transient property with the given attrName currently exists
      • hasTransientPropertyUnfiltered

        public boolean hasTransientPropertyUnfiltered(java.lang.String name)
        Description copied from interface: BOI
        Returns true, if a transient property with the given name exists or existed, i.e. not filtering out already expired versions.
        Specified by:
        hasTransientPropertyUnfiltered in interface BOI
        Parameters:
        name - the name of the transient property that should be checked
        Returns:
        true, if a transient property with the given attrName exists or existed
      • consumeAndAssureTransientPropertyExists

        public void consumeAndAssureTransientPropertyExists(java.lang.String name,
                                                            java.util.function.Consumer operation,
                                                            java.lang.Object[] args)
        Description copied from interface: BOI
        Performs the given Consumer operation on the passed args. If the specified transient property is not already present, it will be initialized with a null value. If the Consumer itself throws an (unchecked) exception, the exception is rethrown. Typically called for running default value expression and init script of scripted attributes.
        Specified by:
        consumeAndAssureTransientPropertyExists in interface BOI
      • cacheLocally

        public final java.lang.Object cacheLocally(java.lang.String key,
                                                   java.util.function.Supplier<java.lang.Object> func)
        This method is used for caching the results of consecutive expensive method calls in BOs in the transient properties map of the BO. If your method to cache the result of is not a Supplier but a Function, a BiFunction or takes even more than two parameters, you can conveniently create a Supplier to pass along by using the static "supply" functions in Curry.
        Parameters:
        key - the key to find the value by in the local cache
        func - a Supplier that may be called to retrieve the result to cache
        version - a boolean specifying if the cached result shall be invalidated if the BO version of this BO changes.
        Returns:
        the result of the Supplier, i.e. either the previously cached value or the newly created and cached value.
        Throws:
        IRuntimeException - if an error is thrown during the initial calculation of the result of the given Supplier
      • cacheLocally

        public final java.lang.Object cacheLocally(java.lang.String key,
                                                   java.util.function.Supplier<java.lang.Object> func,
                                                   boolean versioned)
      • cacheLocallyAndThrowUnwrappedCause

        public final java.lang.Object cacheLocallyAndThrowUnwrappedCause(java.lang.String key,
                                                                         java.util.function.Supplier<java.lang.Object> func)
                                                                  throws java.lang.Throwable
        Same as #cacheLocally(String, Supplier, boolean) but throws the originally encountered exception that was potentially thrown during the initial calculation of the result of the given Supplier instead of an IRuntimeException that otherwise would wrap that.
        Throws:
        java.lang.Throwable
        • cacheLocallyAndThrowUnwrappedCause

          public final java.lang.Object cacheLocallyAndThrowUnwrappedCause(java.lang.String key,
                                                                           java.util.function.Supplier<java.lang.Object> func,
                                                                           boolean versioned)
                                                                    throws java.lang.Throwable
          Throws:
          java.lang.Throwable
        • cacheLocallyAndThrowUnwrappedUncheckedCause

          public final java.lang.Object cacheLocallyAndThrowUnwrappedUncheckedCause(java.lang.String key,
                                                                                    java.util.function.Supplier<java.lang.Object> func)
          Same as #cacheLocally(String, Supplier, boolean) but throws the originally encountered exception that was potentially thrown during the initial calculation of the result of the given Supplier - if it is a unchecked one - instead of an IRuntimeException that otherwise would wrap that. Does throw the wrapped Exception though, if a checked one is wrapped.
          • cacheLocallyAndThrowUnwrappedUncheckedCause

            public final java.lang.Object cacheLocallyAndThrowUnwrappedUncheckedCause(java.lang.String key,
                                                                                      java.util.function.Supplier<java.lang.Object> func,
                                                                                      boolean versioned)
          • getProcs

            public java.util.Map<java.lang.Long,BP> getProcs()
          • getProcsIterator

            public java.util.Iterator<BP> getProcsIterator()
          • getInvolvedInProcs

            public java.util.Map<java.lang.Long,BP> getInvolvedInProcs()
          • getInvolvedInProcsIterator

            public java.util.Iterator<BP> getInvolvedInProcsIterator()
          • getBadge

            public java.lang.String getBadge()
          • getBadge

            public java.lang.String getBadge(int i)
          • setBadge

            public void setBadge(java.lang.String s)
          • setBadge

            public void setBadge(java.lang.String s,
                                 int i)
          • getBadge2

            public java.lang.String getBadge2()
          • setBadge2

            public void setBadge2(java.lang.String s)
          • getBadge3

            public java.lang.String getBadge3()
          • setBadge3

            public void setBadge3(java.lang.String s)
          • getBadge4

            public java.lang.String getBadge4()
          • setBadge4

            public void setBadge4(java.lang.String s)
          • getCreatedBy

            public Benutzer getCreatedBy()
            Returns the user in the transaction of the BP that created this BO or null if the BO is still new and unsaved.
          • getLastModifiedBy

            public Benutzer getLastModifiedBy()
            Returns the user in the transaction of the most recent BP that affected this BO or null if the BO is still new and unsaved.
          • getBLOBCreatedBy

            public Benutzer getBLOBCreatedBy()
            Returns the user in the transaction of the BP that created the BLOB of this BO or null if no BLOB was created yet.
          • getBLOBCreatedOn

            public java.util.Date getBLOBCreatedOn()
            Returns the user in the transaction of the BP that created the BLOB of this BO or null if no BLOB was created yet.
          • getBLOBDeletedBy

            public Benutzer getBLOBDeletedBy()
            Returns the user in the transaction of the BP that deleted the BLOB of this BO or null if the BLOB was not deleted.
          • getBLOBDeletedOn

            public java.util.Date getBLOBDeletedOn()
            Returns the user in the transaction of the BP that created the BLOB of this BO or null if no BLOB was created yet.
          • getBLOBLastModifiedBy

            public Benutzer getBLOBLastModifiedBy()
            Returns the user in the transaction of the most recent BP that affected the BLOB of this BO or null if the BO is still new and unsaved.
          • getBLOBLastModifiedOn

            public java.util.Date getBLOBLastModifiedOn()
            Returns the user in the transaction of the BP that created the BLOB of this BO or null if no BLOB was created yet.
          • getCreatedModifiedText

            public java.lang.String getCreatedModifiedText()
            Returns a String for the current state this BO, i.e. whom was it created by and when, whom was is last modified by and when.
          • getAsBOInIssueReports

            public java.util.Map<java.lang.Long,IssueReport> getAsBOInIssueReports()
          • getAsBOInIssueReportsIterator

            public java.util.Iterator<IssueReport> getAsBOInIssueReportsIterator()
          • badge

            public static java.util.Map badge(java.util.Map _m,
                                              java.lang.String _badge)
            badges any element within the specified map with the given string
          • badge

            public static java.util.Map badge(java.util.Map _m,
                                              java.lang.String _badge,
                                              int _i)
          • toMap

            public static java.util.Map toMap(BOLoaderI loader,
                                              java.lang.Long boid,
                                              java.lang.Class<? extends BO> classTip)
            Returns a Map containing the BO for the given Id keyed by its Id
            Parameters:
            loader - BOLoaderI to load the BO with
            boid - Long representing the Id of the BO to load
            classTip - the class of the BO to load
            unmodifiable - whether the returned Map shall be unmodifiable or not, defaults to true
            Returns:
            Map<Long, BO>
          • toMap

            public static java.util.Map toMap(BOLoaderI loader,
                                              java.lang.Long boid,
                                              java.lang.Class<? extends BO> classTip,
                                              boolean unmodifiable)
          • toMap

            public static java.util.Map toMap(BOLoaderI loader,
                                              java.lang.Long[] ids,
                                              java.lang.Class<? extends BO> classTip)
            Returns a Map containing the BOs for the given Ids keyed by the Ids, ordered by their Id
            Parameters:
            loader - BOLoaderI to load the BOs with
            ids - Long-array with the Ids of the BOs to load
            classTip - the class of the BOs to load
            unmodifiable - whether the returned Map shall be unmodifiable or not, defaults to true
            Returns:
            Map<Long, BO>
          • toMap

            public static java.util.Map toMap(BOLoaderI loader,
                                              java.lang.Long[] ids,
                                              java.lang.Class<? extends BO> classTip,
                                              boolean unmodifiable)
          • toMap

            public static java.util.Map toMap(BOLoaderI loader,
                                              long[] ids,
                                              java.lang.Class<? extends BO> classTip)
            Returns a Map containing the BOs for the given Ids keyed by the Ids, ordered by their Id
            Parameters:
            loader - BOLoaderI to load the BOs with
            ids - long-array with the Ids of the BOs to load
            classTip - the class of the BOs to load
            unmodifiable - whether the returned Map shall be unmodifiable or not, defaults to true
            Returns:
            Map<Long, BO>
          • toMap

            public static java.util.Map toMap(BOLoaderI loader,
                                              long[] ids,
                                              java.lang.Class<? extends BO> classTip,
                                              boolean unmodifiable)
          • toMap

            public static java.util.Map toMap(BO bo)
            Returns a Map containing the given BO keyed by its Id
            Parameters:
            bo - BO to wrap into a Map
            unmodifiable - whether the returned Map shall be unmodifiable or not, defaults to true
            Returns:
            Map<Long, BO>
          • toMap

            public static java.util.Map toMap(BO bo,
                                              boolean unmodifiable)
          • toMap

            public static java.util.Map toMap(BO[] bos)
            Returns a Map containing the given BOs keyed by their Ids, ordered by their Id
            Parameters:
            bos - Array of BOs
            unmodifiable - whether the returned Map shall be unmodifiable or not, defaults to true
            Returns:
            Map<Long, BO>
          • toMap

            public static java.util.Map toMap(BO[] bos,
                                              boolean unmodifiable)
          • toMap

            public static java.util.Map toMap(java.util.Collection col)
            Returns a Map containing the BOs in the passed Collection, keyed by their Ids, ordered by their Id
            Parameters:
            col - Collection<BO> of BOs
            unmodifiable - whether the returned Map shall be unmodifiable or not, defaults to true
            Returns:
            Map<Long, BO>
          • toMap

            public static java.util.Map toMap(java.util.Collection col,
                                              boolean unmodifiable)
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(BOLoaderI loader,
                                                        java.lang.Long boid,
                                                        java.lang.Class<? extends BO> classTip)
            Returns an unmodifiable Map containing the BO for the given Id, keyed by its Id, suitable for usage as return value of a getter for a read-only virtual relation. If the passed Id is null, the Collections.emptyMap() is returned.
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(BOLoaderI loader,
                                                        java.lang.Long[] ids,
                                                        java.lang.Class<? extends BO> classTip)
            Returns an unmodifiable Map containing the BOs for the given Ids keyed by the Ids, ordered by their Id, suitable for usage as return value of a getter for a read-only virtual relation. If the passed Collection is empty, the Collections.emptyMap() is returned.
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(BOLoaderI loader,
                                                        long[] ids,
                                                        java.lang.Class<? extends BO> classTip)
            Returns an unmodifiable Map containing the BOs for the given Ids, keyed by the Ids, ordered by their Id, suitable for usage as return value of a getter for a read-only virtual relation. If the passed Collection is empty, the Collections.emptyMap() is returned.
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(BO bo)
            Returns an unmodifiable Map containing the passed BO, keyed by its Id, suitable for usage as return value of a getter for a read-only virtual relation. If the passed BO is null, the Collections.emptyMap() is returned.
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(BO[] bos)
            Returns an unmodifiable Map containing the passed BOs, keyed by their Ids, ordered by their Id, suitable for usage as return value of a getter for a read-only virtual relation. If the passed Collection is empty, the Collections.emptyMap() is returned.
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(java.util.Collection col)
            Returns an unmodifiable Map containing the BOs in the passed Collection, keyed by their Ids, ordered by their Id, suitable for usage as return value of a getter for a read-only virtual relation. If the passed Collection is empty, the Collections.emptyMap() is returned.
          • toRelationMapRO

            public static java.util.Map toRelationMapRO()
            Returns an unmodifiable sorted Map with the same entries as the passed Map, suitable for usage as return value of a getter for a read-only virtual relation. If no Map is passed or the passed Map is empty, the Collections.emptyMap() is returned.
            Specified by:
            toRelationMapRO in interface BOI
          • toRelationMapRO

            public static java.util.Map toRelationMapRO(java.util.Map m)
            Specified by:
            toRelationMapRO in interface BOI
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI bol,
                                         java.util.Map attrs2values)
            Checks if one of the given _bosHave matches the given _attrs2values; if yes returns that; if not creates a new instance of _clazz with newInstance() and returns that.
            Parameters:
            clazz - of what Class (or subclass thereof) the wanted object must be.
            bol - the BOLoaderI to set for newly created objects; if it is a Transaction and includeIfTx is set modified or created objects will also be included in this Transaction.
            attrs2values - a Map with attribute names as keys and Objects as the corresponding values that wanted objects should have and that are to be set for newly created objects.
            bosHave - a BO array of existing objects that may be the wanted one; may be null if no such objects are known.
            attrsPrimary - a Set of attribute names to make the comparison by if the wanted object must match in only a subset of the attrs2values attributes to be a fitting candidate. If null wanted objects must match in all the attributes/values from attrs2values.
            includeIfTx - if bol is a Transaction and this is given modified or newly created objects are included in the Transaction; defaults to true.
            clazzToCreate - if newly created object should not be of clazz but a specific subclass thereof this desired subclass may be specified with this parameter (for example the wanted object might be allowed to be of type "Vehicle" that is a "Car", a "Bus" or a "Bicycle"; but if a new object needs to be created if should always be of subclass "Car" and not "Vehicle").
            Returns:
            an object from bosHave that fits all the attributes/values from attrs2values, or the subset specified by attrsPrimary if given, or if no such candidate exists (either because bosHave is null or empty or none of the objects given their matched the criteria) a newly created object of class class, or clazzToCreate if given, with all the values from attrs2values set.
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI bol,
                                         java.util.Map attrs2values,
                                         BO[] bosHave)
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI bol,
                                         java.util.Map attrs2values,
                                         BO[] bosHave,
                                         java.util.Set attrsPrimary)
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI bol,
                                         java.util.Map attrs2values,
                                         BO[] bosHave,
                                         java.util.Set attrsPrimary,
                                         boolean includeIfTx)
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI bol,
                                         java.util.Map attrs2values,
                                         BO[] bosHave,
                                         java.util.Set attrsPrimary,
                                         boolean includeIfTx,
                                         java.lang.Class<? extends BO> clazzToCreate)
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> _clazz,
                                         Transaction _tx,
                                         java.util.Map _attrs2values)
            Method version that takes the set of (possibly) existing matching BOs from the TX.
          • getOrCreate

            public static BO getOrCreate(java.lang.Class<? extends BO> _clazz,
                                         Transaction _tx,
                                         java.util.Map _attrs2values,
                                         java.util.Set _attrsPrimary)
          • newInstance

            public static BO newInstance(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI loader)
            Creates new instance of given BO subclass, sets the given BOLoaderI or includes it if the passed BOLoaderI is a Transaction and includeIfTx was passed as true. Optionally sets values from attrs2values Map, if passed, and returns the newly created BO instance.
            Parameters:
            clazz - the BO subclass to create an instance of
            loader - the BOLoaderI to set in the new instance
            attrs2values - a Map with attribute value pairs to set (optional)
            includeIfTx - a boolean specifying if the instance shall be included in case the passed BOLoaderI is a Transaction (defaults to true)
            Returns:
            a new BO instance of the specified BO subclass
          • newInstance

            public static BO newInstance(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI loader,
                                         java.util.Map attrs2values)
          • newInstance

            public static BO newInstance(java.lang.Class<? extends BO> clazz,
                                         BOLoaderI loader,
                                         java.util.Map attrs2values,
                                         boolean includeIfTx)
          • newInstance

            public static BO newInstance(EntityI ent,
                                         BOLoaderI loader)
            Creates new instance of given EntityI, sets the given BOLoaderI or includes it if the passed BOLoaderI is a Transaction and includeIfTx was passed as true. Optionally sets values from attrs2values Map, if passed, and returns the newly created BO instance.
            Parameters:
            ent - the EntityI to create an BO instance of
            loader - the BOLoaderI to set in the new instance
            attrs2values - a Map with attribute value pairs to set (optional)
            includeIfTx - a boolean specifying if the instance shall be included in case the passed BOLoaderI is a Transaction (defaults to true)
            Returns:
            a new BO instance of the specified EntityI
          • newInstance

            public static BO newInstance(EntityI ent,
                                         BOLoaderI loader,
                                         java.util.Map attrs2values)
          • newInstance

            public static BO newInstance(EntityI ent,
                                         BOLoaderI loader,
                                         java.util.Map attrs2values,
                                         boolean includeIfTx)
          • equalsRegardingAttrs

            public boolean equalsRegardingAttrs(BO _bo,
                                                java.lang.String[] _attrs)
            Equals variant which compares only the given _attrs for equality.
          • filterDeleted

            public static java.util.Collection filterDeleted(java.util.Collection col)
            Filters the passed Collection and returns only BO-instances that are not deleted. Note that this method is not thread-safe, thus concurrent modifications to the passed Collection should be avoided.
            Returns:
            a filtered List excluding non-BOs and BOs which are deleted
          • filterDeleted

            public static java.util.Collection filterDeleted(BO[] arr)
            Filters the passed BO array and returns only BO-instances that are not deleted.
            Returns:
            a filtered List excluding BOs which are deleted
          • filterDeleted

            public static java.util.Collection filterDeleted(java.util.Map map)
            Filters the passed Map and returns only values which are BO-instances and not deleted.
            Returns:
            a filtered List excluding non-BOs and BOs which are deleted
          • getCacheNT

            public static CacheI getCacheNT(BOLoaderI bol,
                                            java.lang.String title,
                                            java.lang.Class clazz)
          • getCacheNT

            public static CacheI getCacheNT(BOLoaderI bol,
                                            java.lang.String title,
                                            java.lang.Class clazz,
                                            java.lang.String fetchQuery)
          • getCache

            public static CacheI getCache(BOLoaderI bol,
                                          java.lang.String title,
                                          java.lang.Class clazz)
          • getCache

            public static CacheI getCache(BOLoaderI bol,
                                          java.lang.String title,
                                          java.lang.Class clazz,
                                          java.lang.String fetchQuery)
          • getDefaultScriptImportsList

            public static java.util.List<ScriptImport> getDefaultScriptImportsList(java.lang.String packageNameBOs)
          • getDefaultScriptImportsList

            public static java.util.List<ScriptImport> getDefaultScriptImportsList(SchemaI schema)
          • getDefaultScriptImportsList

            public java.util.List getDefaultScriptImportsList()
          • getBot

            public BOT getBot()
          • setBot

            public void setBot(BOT $130)
          • isIgnoreModificationConstraints

            public boolean isIgnoreModificationConstraints()
          • setIgnoreModificationConstraints

            public void setIgnoreModificationConstraints(boolean $132)

          Copyright © 2000-2024 OAshi S.à r.l. All Rights Reserved.