我的類不是實體有我想要檢索NEXTVAL這樣的代碼片段生成序列NexVal不執行select查詢
@SequenceGenerator(name="seqUniqueKeyGenerator",sequenceName="SEQ_UNIQUE_KEY",allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seqUniqueKeyGenerator")
@Id
private Integer sequenceId;
public Integer getSequenceId() {
return sequenceId;
}
public void setSequenceId(Integer sequenceId) {
this.sequenceId = sequenceId;
}
public static void main(String[] args) {
UniqueKeyGenerator uniqueKeyGenerator = new UniqueKeyGenerator();
System.out.println(uniqueKeyGenerator.getSequenceId());
}
,這可能嗎?