<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang
    $Date: 2013-9-27 上午11:03:38
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                BEGIN
                    sys_user_pkg.change_avatar_by_owner(p_avatar_id  => ${@avatar_id},
                                                        p_user_id    => ${/session/@user_id},
                                                        p_new_avatar => ${@avatar});
                END;
                ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="avatar_id" dataType="java.lang.Long" output="true" outputPath="@avatar_id"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="query">
            <bm:update-sql><![CDATA[
                SELECT avatar
                FROM sys_user_avatar
                WHERE user_id = ${/session/@user_id}
                ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="avatar"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
</bm:model>
