You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Rohan Lenard (JIRA)" <ib...@incubator.apache.org> on 2005/02/02 04:50:29 UTC
[jira] Created: (IBATIS-65) Recursive inclusions don't expand
Recursive inclusions don't expand
---------------------------------
Key: IBATIS-65
URL: http://issues.apache.org/jira/browse/IBATIS-65
Project: iBatis for Java
Type: Bug
Components: SQL Maps
Versions: 2.0.9
Reporter: Rohan Lenard
Given the documentation doesn't mention this it is hard to know what is correct.
I have an SQL Map like this
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap>
<select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
SELECT sum(a) as a FROM tablea
<dynamic prepend="WHERE">
$externalClause$
</dynamic>
GROUP BY
<isNotNull property="timeChunkClause">
begin,
</isNotNull>
<!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
lowerlimit, upperlimit
</select>
</sqlMap>
Now external clause is passed as a parameter with a value like this .
( criteria = #criteria_0# )
What I expected the SQL to end up as is
SELECT sum(a) as a FROM tablea WHERE criteria = ?
But it gets expanded as
SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (IBATIS-65) Recursive inclusions don't expand
Posted by "Rohan Lenard (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-65?page=comments#action_58483 ]
Rohan Lenard commented on IBATIS-65:
------------------------------------
Where is it documented as such ??
> Recursive inclusions don't expand
> ---------------------------------
>
> Key: IBATIS-65
> URL: http://issues.apache.org/jira/browse/IBATIS-65
> Project: iBatis for Java
> Type: Wish
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Rohan Lenard
> Priority: Minor
>
> Given the documentation doesn't mention this it is hard to know what is correct.
> I have an SQL Map like this
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap
> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
> <sqlMap>
> <select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
> SELECT sum(a) as a FROM tablea
> <dynamic prepend="WHERE">
> $externalClause$
> </dynamic>
> GROUP BY
> <isNotNull property="timeChunkClause">
> begin,
> </isNotNull>
> <!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
> lowerlimit, upperlimit
> </select>
> </sqlMap>
> Now external clause is passed as a parameter with a value like this .
> ( criteria = #criteria_0# )
> What I expected the SQL to end up as is
> SELECT sum(a) as a FROM tablea WHERE criteria = ?
> But it gets expanded as
> SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
> Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (IBATIS-65) Recursive inclusions don't expand
Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-65?page=history ]
Clinton Begin updated IBATIS-65:
--------------------------------
type: Wish (was: Bug)
Priority: Minor (was: Major)
Two things:
1) No, currently expansion of parameters is not supported (for various reasons), which is also why it is not documented as such.
2) The <include> element has nothing to do with what you're trying to do. It's for including common pieces of SQL that are defined in <sql> elements in the document.
I've left this open, but changed it to a "wish".
> Recursive inclusions don't expand
> ---------------------------------
>
> Key: IBATIS-65
> URL: http://issues.apache.org/jira/browse/IBATIS-65
> Project: iBatis for Java
> Type: Wish
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Rohan Lenard
> Priority: Minor
>
> Given the documentation doesn't mention this it is hard to know what is correct.
> I have an SQL Map like this
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap
> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
> <sqlMap>
> <select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
> SELECT sum(a) as a FROM tablea
> <dynamic prepend="WHERE">
> $externalClause$
> </dynamic>
> GROUP BY
> <isNotNull property="timeChunkClause">
> begin,
> </isNotNull>
> <!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
> lowerlimit, upperlimit
> </select>
> </sqlMap>
> Now external clause is passed as a parameter with a value like this .
> ( criteria = #criteria_0# )
> What I expected the SQL to end up as is
> SELECT sum(a) as a FROM tablea WHERE criteria = ?
> But it gets expanded as
> SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
> Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (IBATIS-65) Recursive inclusions don't expand
Posted by "Rohan Lenard (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-65?page=comments#action_58485 ]
Rohan Lenard commented on IBATIS-65:
------------------------------------
D'oh - take that last comment back - old version of library :-(
> Recursive inclusions don't expand
> ---------------------------------
>
> Key: IBATIS-65
> URL: http://issues.apache.org/jira/browse/IBATIS-65
> Project: iBatis for Java
> Type: Wish
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Rohan Lenard
> Priority: Minor
>
> Given the documentation doesn't mention this it is hard to know what is correct.
> I have an SQL Map like this
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap
> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
> <sqlMap>
> <select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
> SELECT sum(a) as a FROM tablea
> <dynamic prepend="WHERE">
> $externalClause$
> </dynamic>
> GROUP BY
> <isNotNull property="timeChunkClause">
> begin,
> </isNotNull>
> <!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
> lowerlimit, upperlimit
> </select>
> </sqlMap>
> Now external clause is passed as a parameter with a value like this .
> ( criteria = #criteria_0# )
> What I expected the SQL to end up as is
> SELECT sum(a) as a FROM tablea WHERE criteria = ?
> But it gets expanded as
> SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
> Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (IBATIS-65) Recursive inclusions don't expand
Posted by "Rohan Lenard (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-65?page=comments#action_58484 ]
Rohan Lenard commented on IBATIS-65:
------------------------------------
Also you can put <include> - I was trying to use it as an alternative way of getting the same behaviour within <isNotNull>.. Seems like that'd be useful.
> Recursive inclusions don't expand
> ---------------------------------
>
> Key: IBATIS-65
> URL: http://issues.apache.org/jira/browse/IBATIS-65
> Project: iBatis for Java
> Type: Wish
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Rohan Lenard
> Priority: Minor
>
> Given the documentation doesn't mention this it is hard to know what is correct.
> I have an SQL Map like this
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap
> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
> <sqlMap>
> <select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
> SELECT sum(a) as a FROM tablea
> <dynamic prepend="WHERE">
> $externalClause$
> </dynamic>
> GROUP BY
> <isNotNull property="timeChunkClause">
> begin,
> </isNotNull>
> <!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
> lowerlimit, upperlimit
> </select>
> </sqlMap>
> Now external clause is passed as a parameter with a value like this .
> ( criteria = #criteria_0# )
> What I expected the SQL to end up as is
> SELECT sum(a) as a FROM tablea WHERE criteria = ?
> But it gets expanded as
> SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
> Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (IBATIS-65) Recursive inclusions don't expand
Posted by "Rohan Lenard (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-65?page=comments#action_58480 ]
Rohan Lenard commented on IBATIS-65:
------------------------------------
I notice in 2.0.9 there is now meant to be <include> - but this doesn't conform to the DTD .. how is it meant to be done
> Recursive inclusions don't expand
> ---------------------------------
>
> Key: IBATIS-65
> URL: http://issues.apache.org/jira/browse/IBATIS-65
> Project: iBatis for Java
> Type: Bug
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Rohan Lenard
>
> Given the documentation doesn't mention this it is hard to know what is correct.
> I have an SQL Map like this
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap
> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
> <sqlMap>
> <select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
> SELECT sum(a) as a FROM tablea
> <dynamic prepend="WHERE">
> $externalClause$
> </dynamic>
> GROUP BY
> <isNotNull property="timeChunkClause">
> begin,
> </isNotNull>
> <!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
> lowerlimit, upperlimit
> </select>
> </sqlMap>
> Now external clause is passed as a parameter with a value like this .
> ( criteria = #criteria_0# )
> What I expected the SQL to end up as is
> SELECT sum(a) as a FROM tablea WHERE criteria = ?
> But it gets expanded as
> SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
> Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (IBATIS-65) Recursive inclusions don't expand
Posted by "Rohan Lenard (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-65?page=comments#action_58482 ]
Rohan Lenard commented on IBATIS-65:
------------------------------------
Ignore comment about DTD.
> Recursive inclusions don't expand
> ---------------------------------
>
> Key: IBATIS-65
> URL: http://issues.apache.org/jira/browse/IBATIS-65
> Project: iBatis for Java
> Type: Wish
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Rohan Lenard
> Priority: Minor
>
> Given the documentation doesn't mention this it is hard to know what is correct.
> I have an SQL Map like this
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap
> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
> <sqlMap>
> <select id="getFrequencyTableData" parameterClass="java.util.Map" resultMap="frequency-table-result">
> SELECT sum(a) as a FROM tablea
> <dynamic prepend="WHERE">
> $externalClause$
> </dynamic>
> GROUP BY
> <isNotNull property="timeChunkClause">
> begin,
> </isNotNull>
> <!-- Note: upperlimit is "strictly" required - but not by MYSQL - for HSQLDB and probably other DBs -->
> lowerlimit, upperlimit
> </select>
> </sqlMap>
> Now external clause is passed as a parameter with a value like this .
> ( criteria = #criteria_0# )
> What I expected the SQL to end up as is
> SELECT sum(a) as a FROM tablea WHERE criteria = ?
> But it gets expanded as
> SELECT sum(a) as a FROM tablea WHERE criteria = #criteria_0#
> Shouldn't it be expanded ??
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira