Enum DbEntityState

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DbEntityState>

    public enum DbEntityState
    extends java.lang.Enum<DbEntityState>
    Author:
    Daniel Meyer
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DELETED_MERGED
      A MERGED object which may exists in the database and is set to be deleted by the current session.
      DELETED_PERSISTENT
      A persistent object which has been loaded into this session and will be deleted with the next flush.
      DELETED_TRANSIENT
      A transient object which does not exist in the database but has been created and deleted in the current session.
      MERGED
      A persistent object which may exist in the database but which has not been loaded into the current session form the database.
      PERSISTENT
      A persistent object has been loaded from the database by the current session.
      TRANSIENT
      A transient object does not exist in the database and has been created by the current session.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DbEntityState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DbEntityState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • TRANSIENT

        public static final DbEntityState TRANSIENT
        A transient object does not exist in the database and has been created by the current session. It will be INSERTed to the database and marked PERSISTENT with the next flush.
      • PERSISTENT

        public static final DbEntityState PERSISTENT
        A persistent object has been loaded from the database by the current session. At the next flush, the session will perform dirty checking and flush an update if the object's persistent state changed. It will remain persistent after the next flush.
      • MERGED

        public static final DbEntityState MERGED
        A persistent object which may exist in the database but which has not been loaded into the current session form the database. A detached copy of the object has been modified offline and merged back into the session. At the next flush an update with optimistic locking check will be performed and after that, the object will be marked PERSISTENT.
      • DELETED_TRANSIENT

        public static final DbEntityState DELETED_TRANSIENT
        A transient object which does not exist in the database but has been created and deleted in the current session. It will not be flushed to the database and will be removed from the cache at the next flush.
      • DELETED_PERSISTENT

        public static final DbEntityState DELETED_PERSISTENT
        A persistent object which has been loaded into this session and will be deleted with the next flush. After the flush it will be removed from the cache.
      • DELETED_MERGED

        public static final DbEntityState DELETED_MERGED
        A MERGED object which may exists in the database and is set to be deleted by the current session. It will be removed from the cache at the next flush.
    • Method Detail

      • values

        public static DbEntityState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DbEntityState c : DbEntityState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DbEntityState valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null