db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torque-...@db.apache.org
Subject [DB Torque Wiki] Updated: FrequentlyAskedQuestions
Date Thu, 16 Dec 2004 13:33:19 GMT
   Date: 2004-12-16T05:33:19
   Editor: MichalKwiatek <michkwia@tlen.pl>
   Wiki: DB Torque Wiki
   Page: FrequentlyAskedQuestions
   URL: http://wiki.apache.org/db-torque/FrequentlyAskedQuestions

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -139,6 +139,17 @@
 
 -- EricPugh
 
+== 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. 
+
+{{{  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 ==
 
 '''Answer:'''

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message