Class GraphEntityImpl

    • Constructor Detail

      • GraphEntityImpl

        protected GraphEntityImpl​(IdGroupingToken tokenId,
                                  Class<? extends GraphEntity> clazz)
        Constructor
        Parameters:
        tokenId - to use
        clazz - to register for
      • GraphEntityImpl

        protected GraphEntityImpl​(long id)
        Constructor. Note only to be used when entity is not reliant on an id generation procedure
        Parameters:
        id - to use
      • GraphEntityImpl

        protected GraphEntityImpl​(GraphEntityImpl other,
                                  boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy from
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • generateAndSetId

        protected long generateAndSetId​(IdGroupingToken tokenId)
        generate id based on provided token and class and set it on this instance
        Parameters:
        tokenId - to use for id generation
        Returns:
        created and set id
      • generateId

        protected static long generateId​(IdGroupingToken idGroupingToken,
                                         Class<? extends IdAble> clazz)
        Generate an id based on provided token and class
        Parameters:
        idGroupingToken - to use
        clazz - to register for
        Returns:
        generated id
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        recreate the internal id(s) and set them including the Idable id
        Specified by:
        recreateManagedIds in interface ManagedId
        Parameters:
        tokenId - to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))
        Returns:
        the updated internal id
      • deepClone

        public abstract GraphEntityImpl deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface GraphEntity
        Specified by:
        deepClone in interface IdAble
        Overrides:
        deepClone in class ExternalIdAbleImpl
        Returns:
        deep copy of entity