Class AbstractEntityInsertAction

    • Constructor Detail

      • AbstractEntityInsertAction

        protected AbstractEntityInsertAction​(Object id,
                                             Object[] state,
                                             Object instance,
                                             boolean isVersionIncrementDisabled,
                                             EntityPersister persister,
                                             SharedSessionContractImplementor session)
        Constructs an AbstractEntityInsertAction object.
        id - - the entity ID
        state - - the entity state
        instance - - the entity
        isVersionIncrementDisabled - - true, if version increment should be disabled; false, otherwise
        persister - - the entity persister
        session - - the session
    • Method Detail

      • isEarlyInsert

        public abstract boolean isEarlyInsert()
        Does this insert action need to be executed as soon as possible (e.g., to generate an ID)?
        true, if it needs to be executed as soon as possible; false, otherwise.
      • findNonNullableTransientEntities

        public NonNullableTransientDependencies findNonNullableTransientEntities()
        Find the transient unsaved entity dependencies that are non-nullable.
        the transient unsaved entity dependencies that are non-nullable, or null if there are none.
      • nullifyTransientReferencesIfNotAlready

        protected final void nullifyTransientReferencesIfNotAlready()
        Nullifies any references to transient entities in the entity state maintained by this action. References to transient entities should be nullified when an entity is made "managed" or when this action is executed, whichever is first.

        References will only be nullified the first time this method is called for a this object, so it can safely be called both when the entity is made "managed" and when this action is executed.

        See Also:
      • makeEntityManaged

        public final void makeEntityManaged()
        Make the entity "managed" by the persistence context.
      • addCollectionsByKeyToPersistenceContext

        protected void addCollectionsByKeyToPersistenceContext​(PersistenceContext persistenceContext,
                                                               Object[] objects)
      • markExecuted

        protected void markExecuted()
        Indicate that the action has executed.
      • handleNaturalIdPreSaveNotifications

        protected void handleNaturalIdPreSaveNotifications()
        Handle sending notifications needed for natural-id before saving
      • handleNaturalIdPostSaveNotifications

        public void handleNaturalIdPostSaveNotifications​(Object generatedId)
        Handle sending notifications needed for natural-id after saving
        generatedId - The generated entity identifier