我正在这样做。
@Basic(optional = false)
@Column(name = "ID", nullable = false, updatable = false)
@Id
@GeneratedValue(generator = "GLOBAL",
strategy = GenerationType.TABLE)
@TableGenerator(
allocationSize = 1048576,
initialValue = Integer.MAX_VALUE,
pkColumnName = "PK",
valueColumnName = "VL",
table = "GENERATED_ID",
name = "GLOBAL",
pkColumnValue = "GLOBAL"
)
@NotNull
@XmlAttribute
private Long id;
现在,当我尝试坚持一个实体时,我得到了。
Exception Description: Error preallocating sequence numbers.
The sequence table information is not complete.
我错过了哪些元素@TableGenerator
?
该表存在,当我手动插入行时,我发现它有效。这是正常的吗?
INSERT INTO GENERATED_ID ("PK", "VL") VALUES ("GLOBAL", 1);
是否有任何标准(供应商中立)属性可以自动执行此操作?