2006-08-25 05:32:37 UTC
hey.
help me, please....
single object,set dynamic table name is very easy,I can use $tableName$.
if object is complex,how i can set dynamic table name in child object.like this:
<typeAlias alias="A" type="A"/>
<typeAlias alias="B" type="B"/>
<resultMap id="RA" class="A">
<result property="id" column="PLUGIN_ID" javaType="java.lang.Long"/>
<result property="name" column="NAME" javaType="java.lang.String"/>
<result property="b" column="PLUGIN_ID" select="queryB"/>
</resultMap>
<resultMap id="RB" class="B">
<result property="id" column="ROLE_ID" javaType="java.lang.Long"/>
<result property="code" column="CODE" javaType="java.lang.String"/>
</resultMap>
<select id="queryA"
parameterClass="ParamPlugin"
resultMap="ResultPluginModel">
<![CDATA[
select *
from $tableName$
]]>
</select>
<select id="queryB"
parameterClass="int"
resultMap="B">
<![CDATA[
select *
from $tableName$ where PLUGIN_ID=#value#
]]>
if this code has't $tableName$,it's right.but if has $tableName$.how i set parameterClass in id="queryB".
if set parameterClass="int" ,then $tableName$ can't get.but set parameterClass="B".parent object's value
can't get...