the selectKey places the value in your java object. The reference you pass into your insert will then contain the id.
--- service --- SomeObject someObject = new SomeObject(); ... myDao.insertSomeObject(someObject); Integer myId = someObject.getObjectId(); ... call some other Dao and pass the myId --- Dao --- ... insertSomeObject(SomeOjbect someObject) { sqlMap.insert("myInsertStatement",someObject); } --- sql map --- <insert...> <selectKey keyProperty="objectId" resultClass="integer"> ... </selectKey> ... </insert> Hope that helps, Brandon On Apr 6, 2005 9:46 AM, Jason Hall <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm using Oracle sequences. I just wanted to know when using the > <selectKey> tag, if there is a way to fetch that key in java > > after it has been inserted. I need this key for other tables. > > Thanks, > > Jason Hall