Spring 的 Ibatis Oracle 序列号问题

Ibatis Oracle sequence number issue with Spring

我有一个基于 Spring 的应用程序,使用 ibatis 连接到 Oracle 数据库。

我需要将记录写入数据库,我想使用 db 序列作为 table 的主键。我无法从 Spring 类 调用序列的下一个值。如果可行,请建议我。如果不是,请建议我编写 table 的主键的一些替代方法。如果可能,请举例说明。

提前致谢。

现在完成了。

可以使用注释来完成 @SelectKey(statement="select id.nextval from dual", keyproperty="id", before=true , resultType="long.class")