Demo Site

Wednesday, May 12, 2010

Ibatis, Oracle and SelectKey

Another useless waste of 30 minutes, apparently if you're having problems getting Ibatis's selectkey statement to work, in order to get (and return) a generated key, it will fail with something like

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/x/ods/dao/ibatis/sqlmaps/Entity.xml.
--- The error occurred while applying a parameter map.
--- Check the insertEntity-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into
("ODS"."ENTITY_SRC"."ENT_SRC_ID")

the answer? explicitly add the type attribute and set it to "pre". ugh-

Labels

Labels

Labels