public enum ForeignKeyAction extends Enum<ForeignKeyAction>
Enum Constant and Description |
---|
CASCADE
级联删除或更新。分别删除一个引用行或者更新一个引用列的值。
|
NO_ACTION
如果违反外键约束会产生一个错误。如果约束被延迟,那么到事务结束检查约束时如果仍然因为存在一个引用行而违反外键约束,则仍会产生错误。这是默认值。其他的动作action都不能被延迟。
|
RESTRICT
违反外键约束会产生一个错误。
|
SET_DEFAULT
设置引用列为其缺省值。如果缺省值不是null,那么仍然需要被引用表中有一条记录的被引用字段的值与之匹配,否则操作会失败。
|
SET_NULL
设置引用列的值为null
|
Modifier and Type | Method and Description |
---|---|
String |
getName() |
static ForeignKeyAction |
parseName(String name) |
static ForeignKeyAction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ForeignKeyAction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ForeignKeyAction NO_ACTION
public static final ForeignKeyAction RESTRICT
public static final ForeignKeyAction CASCADE
public static final ForeignKeyAction SET_NULL
public static final ForeignKeyAction SET_DEFAULT
public static ForeignKeyAction[] values()
for (ForeignKeyAction c : ForeignKeyAction.values()) System.out.println(c);
public static ForeignKeyAction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static ForeignKeyAction parseName(String name)
public String getName()
Copyright © 2020. All rights reserved.