That message looks iffy at best - I'd try w/o the resultClass on the
the <insert> element. It should not needed in any case...same with the
type attribute, but you should probably set the keyProperty attribute
on the <selectKey> element.
So..something like this:
<insert id="insertNotification" parameterMap="insertNotificationParam">
insert into blah...
<selectKey resultClass="long" keyProperty="yourIdPropName">
SELECT LAST_INSERT_ID() AS value;
</selectKey>
</insert>
Larry
On 10/23/06, Javier Leyba <[EMAIL PROTECTED]> wrote:
Hi
I want to use selectKey so I defined in my map:
-------------
<insert id="insertNotification" parameterMap="insertNotificationParam"
resultClass="java.lang.Long">
INSERT INTO notification (
notification.notification_id,
notification.topic_id,
notification.sourcetype_id,
notification.notificationtype_id,
notification.notification_category,
notification.notification_priority,
notification.notification_source,
notification.notification_expiration)
VALUES (0,
?,?,
?,?,
?,?,now());
<selectKey type="post" resultClass="long">
SELECT LAST_INSERT_ID() AS value;
</selectKey>
</insert>
------------------------
But I receive the message:
Cause: org.xml.sax.SAXParseException: Attribute "resultClass" must be
declared for element type "insert".
Any idea ?
Thanks in advance
J