ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Hall" <JH...@cihi.ca>
Subject RE: composite keys and procedures
Date Mon, 18 Apr 2005 13:32:53 GMT
on this note. Does ibatis support composite keys not using store procedures but say using <insert>
tag and <selectKey>.
 
Jason.

-----Original Message-----
From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Sunday, April 17, 2005 3:01 AM
To: ibatis-user-java@incubator.apache.org
Subject: Re: composite keys and procedures



It doesn't look like you're even making use of a composite key (at least not a composite key
that gets passed to your proc).

The following only sends a single column to the loadCategories proc.

<result property="rightsCategories" column="ID" select="loadCategories"/>


So...I suppose this should work fine.  As for the Oracle ref cursor stuff, I can't speak to
that.

Cheers,
Clinton



On 4/13/05, ala@kn.nrd.lt < ala@kn.nrd.lt> wrote: 

Hello

 

I'm trying to load list property into root object but always getting list==null. List property
is loaded through stored procedure. I modified ibatis to support Oracle cursors as been described
earlier in this mailing list. Does Ibatis supports composite keys for <procedure> tag,
not only <statement>? Below is mapping xml, problematic resultset is rRole property
rightsCategories which is trying to loadCategories.

 

<sqlMap>

  <resultMap id="rRole" class="com.nrd.nk.logic.security.Role">

    <result property="id" column="ID"/>

    <result property="code" column="ROLE_CODE"/>

    <result property="name" column="ROLE_NAME"/>

    <result property="superOrgUse" column="SUPER_ORG_USE"/>

    <result property="rightsCategories" column="ID" select="loadCategories"/>

  </resultMap>

  <resultMap id="rCategory" class="com.nrd.nk.logic.security.Category">

    <result property="code" column="CODE"/>

    <result property="name" column="MEANING"/>

  </resultMap>

  <parameterMap id="pRolesList" class="com.nrd.utils.PagingInfo">

    <parameter property="result" jdbcType="ORACLECURSOR"

               javaType="java.lang.Object" mode="OUT"/>

    <parameter property="totalRecordCount" jdbcType="NUMERIC"

               javaType="java.lang.Long" mode="OUT"/>

    <parameter property="startRecord" jdbcType="NUMERIC"

               javaType="java.lang.Long" mode="INOUT"/>

    <parameter property="pageRecordCount" jdbcType="NUMERIC"

               javaType="java.lang.Integer" mode="IN"/>

  </parameterMap>

  <parameterMap id="pRole" class="com.nrd.nk.logic.security.Role">

    <parameter property="id" mode="INOUT" jdbcType="NUMERIC"

               javaType="java.lang.Long"/>

    <parameter property="code" mode="INOUT" jdbcType="VARCHAR"

               javaType="java.lang.String"/>

    <parameter property="name" mode="INOUT" jdbcType="VARCHAR"

               javaType="java.lang.String"/>

    <parameter property="superOrgUse" mode="INOUT" jdbcType="NUMERIC"

               javaType="java.lang.Integer"/>

  </parameterMap>

  <parameterMap id="pRoleId" class="java.lang.Long">

    <parameter property="id" mode="IN" jdbcType="NUMERIC"

               javaType="java.lang.Long"/>

  </parameterMap>

  <parameterMap id="pCursor" class="com.nrd.utils.CursorParameter">

    <parameter property="result" jdbcType="ORACLECURSOR"

               javaType="java.lang.Object" mode="OUT"/>

  </parameterMap>

  <procedure id="loadRolesList" resultMap="rRole" parameterMap="pRolesList">

    {?=call sys_users_br.ld_roles_lst(?,?,?)}

  </procedure>

  <procedure id="saveRole" parameterMap="pRole" resultMap="rRole">

    {call sys_users_br.sv_roles(?,?,?,?)}

  </procedure>

  <procedure id="loadRole" parameterMap="pRole">

    {call sys_users_br.ld_roles(?,?,?,?)}

  </procedure>

  <procedure id="deleteRole" parameterMap="pRoleId">

                                           {call sys_users_br.s_roles_state(?,'DELETED')}

                      </procedure>

  <procedure id="loadCategories" resultMap="rCategory" parameterMap="pCursor">

                                           {call sys_classifiers_br.ld_classifier_children(?,'RIGHT_CATH')}

                      </procedure>

</sqlMap>

 



Mime
View raw message