I am dreaming of the following world ...
<sql-function name="something" type="select">
<parameter name="javaParam1" type="someBean"/>
<parameter name="javaParam2" type="someBean"/>
<return type="someBeanName" create="true">
<field name="Attribute1" type="String"/> <!-- will be mapped
to the first column -->
<field name="Attribute2" type="double"/> <!-- will be mapped
to the second column -->
</return>
<sql dbms="mysql">
<statement>select column1, column2 from table1, table2 where a
= ? and b = ?</statement> <!-- parameterized statement -->
<statement-param param="javaParam1"
attribute="javaAttributeName1" type="String"/>
<statement-param param="javaParam1"
attribute="javaAttributeName2" type="int"/>
</sql>
</sql-function>
There will be some tools that reads this XML and splits out the code
for the function that performs the select maps the ResultSet to a
generated result class.
This will also remove complicated code for building Criteria, and the
SQL gurus can happily tune their SQL statements for the Java guru to
happily paste them into the XML. By building the query statically, the
performance will also improve.
Am I dreaming? Does it already exist somewhere?
Albert
---------------------------------
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com