public enum GenerationType extends Enum<GenerationType>
| Enum Constant and Description |
|---|
SELECT_KEY
配置
SelectKey 属性,使用 SelectKeyGenerator 来触发调用 |
SEQUENCE_KEY
|
USE_GENERATED_KEYS
如果插入的表主键是自增列,则可以使用 JDBC 自动生成主键,并可将生成的主键值返回。
|
| Modifier and Type | Method and Description |
|---|---|
static GenerationType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static GenerationType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GenerationType USE_GENERATED_KEYS
<insert id="insert" useGeneratedKeys="true" parameterType="...">
insert into User(id, name, age) values (#{id}, #{name}, #{age})
</insert>
public static final GenerationType SELECT_KEY
SelectKey 属性,使用 SelectKeyGenerator 来触发调用public static final GenerationType SEQUENCE_KEY
public static GenerationType[] values()
for (GenerationType c : GenerationType.values()) System.out.println(c);
public static GenerationType 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 nullCopyright © 2018–2020. All rights reserved.