[ http://issues.apache.org/jira/browse/IBATIS-144?page=all ]
Larry Meadors closed IBATIS-144:
--------------------------------
Resolution: Invalid
Functionality already exists
> Using Templates in SQL Maps
> ---------------------------
>
> Key: IBATIS-144
> URL: http://issues.apache.org/jira/browse/IBATIS-144
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> Environment: all
> Reporter: Steffen Legler
> Priority: Minor
>
> For readability and writing less redundant code ist would be nice to have
> templates within a SQLMap.
> ---CURRENT------------------------------------------------------------
> <sqlMap namespace="someNs">
> <typeAlias alias="class1" type="com.someCompany.class1"/>
> <insert id="insert" parameterClass="class1">
> insert into table(id,
> <isEqual property="selectionId" compareValue="1">
> column1
> </isEqual>
> <isEqual property="selectionId" compareValue="2">
> column2
> </isEqual>
> ) values (#instanceId#, #value# )
> </insert>
> <update id="update" parameterClass="class1">
> update table set
> <isEqual property="selectionId" compareValue="1">
> column1
> </isEqual>
> <isEqual property="selectionId" compareValue="2">
> column2
> </isEqual>
> = #value# where id = #instanceId#
> </update>
> </sqlMap>
> ---WISH TO HAVE------------------------------------------------------------
> <sqlMap namespace="someNs">
> <typeAlias alias="class1" type="com.someCompany.class1"/>
> <template alias="columnSelection" type="
> <isEqual property="selectionId" compareValue="1">
> column1
> </isEqual>
> <isEqual property="selectionId" compareValue="2">
> column2
> </isEqual>
> "/>
> <insert id="insert" parameterClass="class1">
> insert into table(id,$columnSelection) values (#instanceId#,
> #value# )
> </insert>
> <update id="update" parameterClass="class1">
> update table set $columnSelection
> = #value# where id = #instanceId#
> </update>
> </sqlMap>
> ---
> The following is taken from the velocity tutorial:
> In almost all cases the shorthand notation for references can be used, but in
> some cases the formal notation is required for correct processing.
> Jack is a $vicemaniac.
> There is ambiguity here, and Velocity assumes that $vicemaniac, not $vice, is
> the Identifier that you mean to use. Finding no value for $vicemaniac, it
> will return $vicemaniac. Using formal notation can resolve this problem.
> Jack is a ${vice}maniac.
> Now Velocity knows that $vice, not $vicemaniac, is the reference. Formal
> notation is often useful when references are directly adjacent to text in a
> template.
> ---
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira