pankajagar2002 0 Light Poster

With the help of ibatis we can perform insertion and many other sql operation with direct queries. I have an update query. On the updation on table. a trigger fires which insert a row in another table. Query is written in ibatis and trigger on database. i want to remove the trigger. Could any body suggest me help.


Update tag of ibatis

<update id="up" parameterClass="changePwD">
UPDATE user
<dynamic prepend="SET">
<isNotNull prepend=", " property="password">password = #password#</isNotNull>
</dynamic>
WHERE user_name = #userName#
<insert>
</insert>
</update>

and trigger on database is

BEGIN
if NEW.password != OLD.password then
INSERT INTO user_password (user_name, password) values (NEW.user_name, NEW.password);
end if;
END


Can i use nested tags in ibatis. means insert tag inside update tag. If yes then what will be id and parameter class and how it will be called.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.