I am suggesting a supplement to Torque. Torque works very nicely as an O/R tool
mapping classes to tables for rapid development. During performance tuning, however,
it will be necessary to rewrite parts of the logic that uses Torque into lower level
calls. It would be nice if Torque can take care of code generation for this level
also, and become the one stop solution for "descriptive Java/SQL development".
Albert
> Albert,
>
> It sounds like what you're asking for is basically a SQL query library.
> This is a major step above having SQL directly in Java or JSP, because you
> are instead referencing each SQL statement with some tag ("something").
>
> Are you suggesting this approach be used to supplement an O/R tool like
> Torque, or to replace it entirely with this approach?
>
> -- Bill
----- Original Message -----
From: "Albert Kwong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 11, 2002 1:33 PM
Subject: More Code Generation
> 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
---------------------------------
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com