Hi Cesare,
I can't help you about stored procedures but this is an excerpt of the
sql-map-2.dtd:
<!ELEMENT parameterMap (parameter+)>
<!ATTLIST parameterMap
id CDATA #REQUIRED
class CDATA #REQUIRED
>
So a parameter map has two required attributes and at least one child
element of type "parameter".
This is an excerpt of sql-map.dtd:
<!ELEMENT parameter-map (property+)>
<!ATTLIST parameter-map
name ID #REQUIRED
>
So a parameter map has one required attribute and at least one child
element of type "property".
The dtd used to validate your sql map file depends on which version of
Ibatis you're using.
However about this xml:
<parameterMap id="EmptyParam"></parameterMap>
If the sql-map.dtd is used the xml isn't valid because the content of
the element parameterMap is incomplete.
If the sql-map-2.dtd is used the xml isn't valid because the attribute
"class" is required and must be specified for element type
"parameterMap" (and the content of the element parameterMap is incomplete).
Hope this help.
Best regards,
aris
[EMAIL PROTECTED] wrote:
Hi all.
Thanks to Jeff Butler both for the support and for the invitation to the
community and this list (and to Clinton Begin, as well).
(I state in advance that I'm new to iBatis and that the main document I
tend to refer to is iBATIS-SqlMaps-2.pdf. Sorry in advance for any trivial
question, if any).
There are two related threads
Problem calling stored procedure having no parameter
http://www.mail-archive.com/[email protected]/msg01069.html
in the forum about C sharp and
Procedures in iBatis
http://www.mail-archive.com/[email protected]/msg03964.html
in this forum about iBatis for Java.
I have to call, from a Java unit test, two procedures
procedure ut_setup;
procedure ut_teardown;
which prepare some test data and part of an Oracle PL/SQL unit testing
package called ut_Tipo_Dato and .
Please note that those procedures do not have neither an argument nor a
return value.
I googled the internet and searched these forums, as well, I discovered the
two thread quoted above
In the
Problem calling stored procedure having no parameter
http://www.mail-archive.com/[email protected]/msg01069.html
discussion you can find a technique (for iBatis for C#) for a parameterMap
for a no-argument procedure that is used to call ut_setup() and
ut_teardown()
<sqlMap namespace="GPJ">
<parameterMap id="EmptyParam">
</parameterMap>
<procedure id="setUp" parameterMap="EmptyParam">
{call ut_Tipo_Dato.ut_setup}
</procedure>
<procedure id="tearDown" parameterMap="EmptyParam">
{call ut_Tipo_Dato.ut_teardown}
</procedure>
</sqlMap>
The technique does not work: when I call to construct my SqlMapClient
singleton by calling SqlMapClientBuilder.buildSqlMapClient() the following
error is reported
com.ibatis.common.exception.NestedRuntimeException: Error occurred.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing
XPath '/sqlMapConfig/sqlMap'. Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
org.xml.sax.SAXParseException: Attribute "class" is required and must be
specified for element type "parameterMap".
[...]
1)
What is wrong?
How does it work in iBatis for Java in the XML files when you have to
configure procedures with no arguments / with no return value?
Somewhere (I got lost but somewhere I googled and found the syntax for the
parameterMap statement and the class attribute was reported as optional)
Please note that the question posted by Suman . Mishra
(http://www.mail-archive.com/[email protected]/msg03967.html) has
been, substantially, unanswered.
So, let me try again.
2)
Generally, are considerations about XML configuration files in one language
generally (e.g C#) valid also for the other language (e.g Java)?
Thanks in advance for any help
ciao
Cesare
P.S.
To answer to the comment from Beemsterboer Software
http://www.mail-archive.com/[email protected]/msg03967.html
this is a case where a procedure has both no argument and no return value.
A procedure with no return value should normally be the canonical form for
a procedure! But this is another story... ;)