Date: 2004-12-16T05:33:19
   Editor: MichalKwiatek <[EMAIL PROTECTED]>
   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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to