【问题标题】:Ibatis Oracle sequence number issue with SpringSpring的Ibatis Oracle序列号问题
【发布时间】:2015-10-18 09:48:25
【问题描述】:

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

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

提前致谢。

【问题讨论】:

    标签: spring oracle11g ibatis


    【解决方案1】:

    现在完成了。

    可以使用注解作为@SelectKey(statement="select id.nextval from dual", keyproperty="id", before=true, resultType="long.class")

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-31
      • 2010-09-27
      • 2011-11-21
      • 1970-01-01
      • 1970-01-01
      • 2017-05-05
      • 2011-02-09
      • 1970-01-01
      相关资源
      最近更新 更多