You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Dave Rodenbaugh <dr...@WILDBLUECORP.COM> on 2006/12/01 00:40:55 UTC
Mismatch of DTD and documentation?
Hi everyone,
I searched the archives and JIRA for some resolution on this matter with
no luck...perhaps someone could enlighten me on this one.
According to the documentation:
3.3.4.8. extends
When writing Sql, you often encounter duplicate fragments of SQL. iBATIS
offers a simple yet powerful attribute to reuse them.
<select id="GetAllAccounts"
resultMap="indexed-account-result">
select
Account_ID,
Account_FirstName,
Account_LastName,
Account_Email
from Accounts
</select>
<select id="GetAllAccountsOrderByName"
extends="GetAllAccounts"
resultMap="indexed-account-result">
order by Account_FirstName
</select>
which is GREAT! Just what I needed. However, looking at the latest 2.0
DTD:
<!ELEMENT select (#PCDATA | include | dynamic | iterate |
isParameterPresent | isNotParameterPresent | isEmpty | isNotEmpty |
isNotNull | isNull | isNotEqual | isEqual | isGreaterThan |
isGreaterEqual | isLessThan | isLessEqual | isPropertyAvailable |
isNotPropertyAvailable)*>
<!ATTLIST select
id CDATA #REQUIRED
parameterMap CDATA #IMPLIED
parameterClass CDATA #IMPLIED
resultMap CDATA #IMPLIED
resultClass CDATA #IMPLIED
cacheModel CDATA #IMPLIED
resultSetType (FORWARD_ONLY | SCROLL_INSENSITIVE | SCROLL_SENSITIVE)
#IMPLIED
fetchSize CDATA #IMPLIED
xmlResultName CDATA #IMPLIED
remapResults (true|false) #IMPLIED
timeout CDATA #IMPLIED
>
Notice the lack of a definition for 'extends'. This is only a problem
in my XML validator inside Eclipse which tells me this element isn't
allowed...I haven't actually got this to run yet, but wanted to know if
this was a known issue, or will affect my usage of the mapping XML?
Thanks,
-Dave
Re: Mismatch of DTD and documentation?
Posted by Jeff Butler <je...@gmail.com>.
I'm not sure what documentation you're referring to, but you're looking at
the wrong thing!
Current iBATIS documentation is available here:
http://ibatis.apache.org/javadownloads.html
But I think you want to use includes, which are documented here:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+reuse+SQL-fragments
Jeff Butler
On 11/30/06, Dave Rodenbaugh <dr...@wildbluecorp.com> wrote:
>
> Hi everyone,
>
> I searched the archives and JIRA for some resolution on this matter with
> no luck...perhaps someone could enlighten me on this one.
>
> According to the documentation:
> 3.3.4.8. extends
>
> When writing Sql, you often encounter duplicate fragments of SQL. iBATIS
> offers a simple yet powerful attribute to reuse them.
>
> <select id="GetAllAccounts"
> resultMap="indexed-account-result">
> select
> Account_ID,
> Account_FirstName,
> Account_LastName,
> Account_Email
> from Accounts
> </select>
>
> <select id="GetAllAccountsOrderByName"
> extends="GetAllAccounts"
> resultMap="indexed-account-result">
> order by Account_FirstName
> </select>
>
> which is GREAT! Just what I needed. However, looking at the latest 2.0 DTD:
>
> <!ELEMENT select (#PCDATA | include | dynamic | iterate | isParameterPresent | isNotParameterPresent | isEmpty | isNotEmpty | isNotNull | isNull | isNotEqual | isEqual | isGreaterThan | isGreaterEqual | isLessThan | isLessEqual | isPropertyAvailable | isNotPropertyAvailable)*>
> <!ATTLIST select
> id CDATA #REQUIRED
> parameterMap CDATA #IMPLIED
> parameterClass CDATA #IMPLIED
> resultMap CDATA #IMPLIED
> resultClass CDATA #IMPLIED
> cacheModel CDATA #IMPLIED
> resultSetType (FORWARD_ONLY | SCROLL_INSENSITIVE | SCROLL_SENSITIVE) #IMPLIED
> fetchSize CDATA #IMPLIED
> xmlResultName CDATA #IMPLIED
> remapResults (true|false) #IMPLIED
> timeout CDATA #IMPLIED
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Notice the lack of a definition for 'extends'. This is only a problem in
> my XML validator inside Eclipse which tells me this element isn't
> allowed...I haven't actually got this to run yet, but wanted to know if this
> was a known issue, or will affect my usage of the mapping XML?
>
> Thanks,
> -Dave
>