枚举类 DissociateAction

java.lang.Object
java.lang.Enum<DissociateAction>
org.babyfish.jimmer.sql.DissociateAction
所有已实现的接口:
Serializable, Comparable<DissociateAction>, Constable

public enum DissociateAction extends Enum<DissociateAction>
Configuration for many-to-one (or one-to-one) associations directly based on foreign keys.

In the following two cases, the parent object will disassociate from the child objects:

  • When the parent object is deleted (either physically or logically)
  • When the user overrides the parent object using a save command, the collection of child objects in the saved data structure is specified, but does not contain some child objects that already exist in the database, the exists child objects will be deleted (either physically or logically). In this case, each child object will dissociate the grandchild objects.
  • 枚举常量详细资料

    • NONE

      public static final DissociateAction NONE
      The default option, it is equivalent to LAX or CHECK according to the global configuration `jimmer.default-dissociate-action-checking`
    • LAX

      public static final DissociateAction LAX
      This is a special option. If the parent object is physically deleted and the foreign key of the child object is true (foreign key constraint exists in the database), it will be ignored, equivalent to CHECK.

      In other cases, this option takes effect. When the parent object is deleted (either physically or logically), regardless whether there are some existing child objects in the database or not.

    • CHECK

      public static final DissociateAction CHECK
      If the deleted parent object has some child objects, throw an exception to prevent the operation.
    • SET_NULL

      public static final DissociateAction SET_NULL
      If the deleted parent object has some child objects, clear foreign key of child objects.
    • DELETE

      public static final DissociateAction DELETE
      If the deleted parent object has some child objects, delete child objects too.
  • 方法详细资料

    • values

      public static DissociateAction[] values()
      返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同
      返回:
      包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
    • valueOf

      public static DissociateAction valueOf(String name)
      返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - 如果该枚举类没有带有指定名称的常量
      NullPointerException - 如果参数为空值