类 IdentifierValue

  • 所有已实现的接口:
    UnsavedValueStrategy

    public class IdentifierValue
    extends Object
    implements UnsavedValueStrategy
    A strategy for determining if an identifier value is an identifier of a new transient instance or a previously persistent transient instance. The strategy is determined by the unsaved-value attribute in the mapping file.
    作者:
    Gavin King
    • 字段详细资料

      • ANY

        public static final IdentifierValue ANY
        Always assume the transient instance is newly instantiated
      • NONE

        public static final IdentifierValue NONE
        Never assume the transient instance is newly instantiated
      • NULL

        public static final IdentifierValue NULL
        Assume the transient instance is newly instantiated if the identifier is null.
    • 构造器详细资料

      • IdentifierValue

        protected IdentifierValue()
      • IdentifierValue

        public IdentifierValue​(Serializable value)
        Assume the transient instance is newly instantiated if its identifier is null or equal to value
    • 方法详细资料

      • isUnsaved

        public Boolean isUnsaved​(Object id)
        Does the given identifier belong to a new instance?
        指定者:
        isUnsaved 在接口中 UnsavedValueStrategy
        参数:
        id - The value to be tested
        返回:
        true indicates the value corresponds to unsaved data (aka, transient state); false indicates the value does not corresponds to unsaved data (aka, detached state); null indicates that this strategy was not able to determine conclusively.