Class ManagedIdEntityFactoryImpl<E extends ManagedId>

    • Field Detail

    • Constructor Detail

      • ManagedIdEntityFactoryImpl

        protected ManagedIdEntityFactoryImpl​(IdGroupingToken groupIdToken)
        Constructor
        Parameters:
        groupIdToken - to use for creating element ids
      • ManagedIdEntityFactoryImpl

        protected ManagedIdEntityFactoryImpl()
        Constructor. Do not use unless it is guaranteed that the ManagedId entity is able to (re)create its id without relying on a group id token
    • Method Detail

      • setIdGroupingToken

        public void setIdGroupingToken​(IdGroupingToken groupIdToken)
        Each factory needs a token to allow all underlying factory methods to generated ids uniquely tied to the group token the entities belong to
        Specified by:
        setIdGroupingToken in interface ManagedIdEntityFactory<E extends ManagedId>
        Parameters:
        groupIdToken - , contiguous id generation within this group of entity instances created with the factory methods
      • createUniqueShallowCopyOf

        public E createUniqueShallowCopyOf​(ManagedId entityToCopy)
        Create a shallow copy of the passed in entity, albeit with unique internal ids. Not registered on the container.
        Specified by:
        createUniqueShallowCopyOf in interface ManagedIdEntityFactory<E extends ManagedId>
        Parameters:
        entityToCopy - the entity to copy
        Returns:
        new entity based on passed in entity
      • createUniqueDeepCopyOf

        public E createUniqueDeepCopyOf​(ManagedId entityToCopy)
        Create a deep copy of the passed in entity, including unique internal ids. Not registered on the container.
        Specified by:
        createUniqueDeepCopyOf in interface ManagedIdEntityFactory<E extends ManagedId>
        Parameters:
        entityToCopy - the entity to copy
        Returns:
        new entity based on passed in entity