SpringのNamedParameterJdbcTemplateを使用して、テーブルへの挿入を実行しています。テーブルは、シーケンスでNEXTVALを使用して、主キーを取得します。次に、この生成されたIDを私に返したいと思います。私は次のようなSpringのKeyHolder実装を使用しています。
KeyHolder key = new GeneratedKeyHolder();
jdbcTemplate.update(Constants.INSERT_ORDER_STATEMENT, params, key);
ただし、このステートメントを実行すると、次のようになります。
org.springframework.dao.DataRetrievalFailureException: The generated key is not of a supported numeric type. Unable to cast [oracle.sql.ROWID] to [java.lang.Number]
at org.springframework.jdbc.support.GeneratedKeyHolder.getKey(GeneratedKeyHolder.java:73)
私が欠けているアイデアはありますか?