File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -485,8 +485,8 @@ ps.setInt(1,id);]]></source>
485
485
<subsection name =" sql" >
486
486
<p >
487
487
This element can be used to define a reusable fragment of SQL code that can be
488
- included in other statements. It can be statically (during load phase) parametrized and also included many time
489
- with different property values . For example:
488
+ included in other statements. It can be statically (during load phase) parametrized. Different property values can
489
+ vary in include instances . For example:
490
490
</p >
491
491
492
492
<source ><![CDATA[ <sql id="userColumns"> ${alias}.id,${alias}.username,${alias}.password </sql>]]> </source >
@@ -496,13 +496,15 @@ ps.setInt(1,id);]]></source>
496
496
</p >
497
497
498
498
<source ><![CDATA[ <select id="selectUsers" resultType="map">
499
- select <include refid="userColumns"><property name="alias" value="t"/></include>
500
- from some_table t
501
- where id = #{id}
499
+ select
500
+ <include refid="userColumns"><property name="alias" value="t1"/></include>,
501
+ <include refid="userColumns"><property name="alias" value="t2"/></include>
502
+ from some_table t1
503
+ cross join some_table t2
502
504
</select>]]> </source >
503
505
504
506
<p >
505
- Property value can be also used in include attributes (e.g. refid) , for example:
507
+ Property value can be also used in include refid attribute or property values inside include clause , for example:
506
508
</p >
507
509
508
510
<source ><![CDATA[ <sql id="sometable">
You can’t perform that action at this time.
0 commit comments