Date: 2004-12-16T05:36:19
Editor: MichalKwiatek <[EMAIL PROTECTED]>
Wiki: DB Torque Wiki
Page: FrequentlyAskedQuestions
URL: http://wiki.apache.org/db-torque/FrequentlyAskedQuestions
no comment
Change Log:
------------------------------------------------------------------------------
@@ -141,13 +141,14 @@
== Can I run a stored procedure (or a complex query), but use Torque's mapping
to return the results as objects? ==
-'''Answer:''' Yes, you can! Here's the answer for a query.
+'''Answer:''' Yes, you can! Here's an example.
-{{{ String sql = "select * from jps_containers c where not exists (select *
from jps_apps a where a.container_id =c.container_id)";
+{{{String sql = "select * from jps_containers c where not exists (select *
from jps_apps a where a.container_id =c.container_id)";
List records = ContainerConfigPeer.executeQuery(sql);
List listOfContainerConfigs = ContainerConfigPeer.populateObjects(records); }}}
This is very similar to the previous answer (How can I execute a stored
procedure), but you don't have to worry after you add a column to the
underlying table.
+
-- MichalKwiatek
== How to add P6Spy for printing SQL ==
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]