Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/Tapestry/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Quick%20Start/Tapestry/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/Tapestry/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/Tapestry/index.html Tue May 9 18:10:42 2006
@@ -0,0 +1,86 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Tapestry</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Tapestry</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick
Start/index.html">Quick Start</a><ul>
+<li><a href="../../../../Documentation/User Guide/Quick Start/Cayenne
Application/index.html">Cayenne Application</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/Command-Line
Tutorial/index.html">Command-Line Tutorial</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/Common Setup
Steps/index.html">Common Setup Steps</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/JSP-Struts
Tutorial/index.html">JSP-Struts Tutorial</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick
Start/Tapestry/index.html">Tapestry</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User
Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p><span class="nobr"><a
href="http://jakarta.apache.org/tapestry/" title="Visit page outside
Confluence" rel="nofollow">Tapestry<sup><img class="rendericon"
src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle"
alt="" border="0"/></sup></a></span> is a powerful component-based web
application framework. This section shows how to write and a deploy a Tapestry
web application using Cayenne as an O/R layer.</p>
+
+<h3><a name="Tapestry-TutorialSetup"></a>Tutorial Setup</h3>
+
+<p>Make sure you successfully finished <a href="../../../../Documentation/User
Guide/Quick Start/Common Setup Steps/index.html" title="Common Setup
Steps">common setup steps</a>.</p>
+
+<p>Install a web container. This tutorial was tested with <span
class="nobr"><a href="http://jakarta.apache.org/tomcat/index.html" title="Visit
page outside Confluence" rel="nofollow">Tomcat<sup><img class="rendericon"
src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle"
alt="" border="0"/></sup></a></span>. It should work with any other container
that is compliant with Servlet 2.3 or 2.2 specification. All references to
Tomcat below should apply in some form to other web containers as well.</p>
+
+<p>Use tutorial source directory distributed with Cayenne at
$CAYENNE_HOME/src/tutorials/cayenne-tapestry-app as a project directory.</p>
+
+<p>Copy cayenne.jar to the WEB-INF/lib subdirectory of the tutorial project
directory.</p>
+
+<p>Copy JDBC driver jar file to WEB-INF/lib subdirectory of the tutorial
project.</p>
+
+<p>Obtain the latest <span class="nobr"><a
href="http://jakarta.apache.org/tapestry/" title="Visit page outside
Confluence" rel="nofollow">Tapestry distribution<sup><img class="rendericon"
src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle"
alt="" border="0"/></sup></a></span> and unzip somewhere. This tutorial targets
Tapestry version 3.0 and will not work with earlier versions. Copy
tapestry-*.jar and other libraries required by Tapestry from the Tapestry
distribution to WEB-INF/lib subdirectory of the tutorial project.</p>
+
+<h3><a name="Tapestry-PrepareTutorialDatabase"></a>Prepare Tutorial
Database</h3>
+<p>See <a
href="http://www.objectstyle.org/confluence/confluence/display/CAYDOC/Command-Line+Tutorial#Command-LineTutorial-PrepareTutorialDatabase"
title="Prepare Tutorial Database on Command-Line Tutorial">Command-Line
Tutorial#Prepare Tutorial Database</a>.</p>
+
+<h3><a name="Tapestry-SetupDataNode"></a>Setup DataNode</h3>
+
+<p>See <a
href="http://www.objectstyle.org/confluence/confluence/display/CAYDOC/Command-Line+Tutorial#Command-LineTutorial-SetupDataNode"
title="Setup DataNode on Command-Line Tutorial">Command-Line
Tutorial#Setup DataNode</a>.</p>
+
+<h3><a name="Tapestry-SetupAutomaticPrimaryKeyGeneration"></a>Setup Automatic
Primary Key Generation</h3>
+
+<p>See <a
href="http://www.objectstyle.org/confluence/confluence/display/CAYDOC/Command-Line+Tutorial#Command-LineTutorial-SetupAutomaticPrimaryKeyGeneration"
title="Setup Automatic Primary Key Generation on Command-Line
Tutorial">Command-Line Tutorial#Setup Automatic Primary Key
Generation</a>.</p>
+
+<h3><a name="Tapestry-GenerateJavaCodeforDataObjects"></a>Generate Java Code
for DataObjects</h3>
+
+<p>See <a
href="http://www.objectstyle.org/confluence/confluence/display/CAYDOC/Command-Line+Tutorial#Command-LineTutorial-GenerateJavaCodeforDataObjects"
title="Generate Java Code for Data Objects on Command-Line
Tutorial">Command-Line Tutorial#Generate Java Code for Data Objects</a>.</p>
+
+
+<h3><a name="Tapestry-CompileandDeploytheApplication"></a>Compile and Deploy
the Application</h3>
+
+<p>To compile the application, the easiest way is to use ant. Change into the
cayenne-tapestry-app directory and invoke ant. The application will be built.
Note that "servlet.jar" (or an appropriate jar file with all the servlet
classes) must be accessible to ant. Feel free to modify the buildfile
accordingly.</p>
+
+<p>To deploy, simply copy cayenne-tapestry-app directory to Tomcat webapps
directory and restart the Tomcat. URL of the new applications is <span
class="nobr"><a href="http://localhost:8080/cayenne-tapestry-app/artist"
title="Visit page outside Confluence"
rel="nofollow">http://localhost:8080/cayenne-tapestry-app/artist<sup><img
class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7"
align="absmiddle" alt="" border="0"/></sup></a></span> (on containers other
then Tomcat, the prefix will probably be different). </p></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../../../images/border_bottom.gif'); background-repeat:
repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/Tapestry/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Quick%20Start/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/index.html Tue May 9 18:10:42 2006
@@ -0,0 +1,48 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Quick Start</title>
+ <style type="text/css">@import "../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Quick Start</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/index.html">Quick
Start</a><ul>
+<li><a href="../../../Documentation/User Guide/Quick Start/Cayenne
Application/index.html">Cayenne Application</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/Command-Line
Tutorial/index.html">Command-Line Tutorial</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/Common Setup
Steps/index.html">Common Setup Steps</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/JSP-Struts
Tutorial/index.html">JSP-Struts Tutorial</a></li>
+<li><a href="../../../Documentation/User Guide/Quick
Start/Tapestry/index.html">Tapestry</a></li>
+</ul>
+</li>
+<li><a href="../../../Documentation/User
Guide/Design/index.html">Design</a></li>
+<li><a href="../../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Quick Start/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Executing a Stored Procedure/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Stored%20Procedures/Executing%20a%20Stored%20Procedure/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Executing a Stored Procedure/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Executing a Stored Procedure/index.html Tue May 9
18:10:42 2006
@@ -0,0 +1,119 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Executing a Stored Procedure</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Executing a Stored Procedure</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick
Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User
Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a><ul>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Executing
a Stored Procedure/index.html">Executing a Stored Procedure</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Selecting
Objects/index.html">Selecting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Stored
Procedures and Transactions/index.html">Stored Procedures and
Transactions</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Previous chapter showed how to select a single
set of data rows using a ProcedureQuery. In a more general case stored
procedures can return multiple sets of data, either as ResultSets or via OUT
parameters, execute update/delete/insert queries, etc. To collect the results
of execution of such stored procedure, a special class, QueryResult, is
used.</p>
+
+<h3><a
name="ExecutingaStoredProcedure-UsingQueryResulttoProcessComplexResults"></a>Using
QueryResult to Process Complex Results</h3>
+
+<p>QueryResult implements OperationObserver, so it can be used as a second
parameter to DataContext.performQueries() method. After the query execution is
done, QueryResult instance will contain all the output of the query:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext ctxt;
+
+<span class="code-comment">// <span class="code-quote">"my_procedure"</span>
is a name of a stored procedure,
+</span><span class="code-comment">// that must exist in the DataMap
+</span>ProcedureQuery query = <span class="code-keyword">new</span>
ProcedureQuery(<span class="code-quote">"my_procedure"</span>);
+
+<span class="code-comment">// Set <span class="code-quote">"IN"</span>
parameter values
+</span>query.addParam(<span class="code-quote">"parameter1"</span>, <span
class="code-quote">"abc"</span>);
+query.addParam(<span class="code-quote">"parameter2"</span>, <span
class="code-keyword">new</span> <span class="code-object">Integer</span>(3000));
+
+QueryResult resultsCollection = <span class="code-keyword">new</span>
QueryResult();
+
+<span class="code-comment">// run query
+</span>ctxt.performQueries(Collections.singleton(query), resultsCollection);
+
+<span class="code-comment">// check the results
+</span>
+<span class="code-comment">// note that <span class="code-keyword">this</span>
is a list of lists
+</span><span class="code-comment">// <span class="code-keyword">if</span> you
expect only a single result set, use
+</span><span class="code-comment">// resultCollection.getFirstRows(query) as a
shortcut
+</span>List rowSets = resultsCollection.getRows(query);
+Iterator it = rowSets.iterator();
+<span class="code-keyword">while</span>(it.hasNext()) {
+ <span class="code-comment">// nextResultSet will contain data rows
+</span> List nextResultSet = (List)it.next();
+ ....
+}
+
+<span class="code-comment">// now check update counts
+</span>List updates = resultsCollection.getUpdates(query);
+it = updates.iterator();
+<span class="code-keyword">while</span>(it.hasNext()) {
+ <span class="code-object">Integer</span> nextUpdateCount = (<span
class="code-object">Integer</span>)it.next();
+ <span class="code-object">System</span>.out.println(<span
class="code-quote">"Updated "</span> + nextUpdateCount + <span
class="code-quote">" rows."</span>);
+ ....
+}</pre>
+</div></div>
+
+<h3><a
name="ExecutingaStoredProcedure-UsingQueryResulttoReadOUTParameters"></a>Using
QueryResult to Read OUT Parameters</h3>
+
+<p>Stored Procedure can return data back to the application as ResultSets or
via OUT parameters. To simplify the processing of the query output, QueryResult
treats OUT parameters as if it was a separate ResultSet. If a stored procedure
declares any OUT or INOUT parameters, QueryResult will contain their returned
values in the very first result list:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext ctxt;
+
+<span class="code-comment">// <span class="code-quote">"my_procedure"</span>
is a name of a stored procedure,
+</span><span class="code-comment">// that must exist in the DataMap
+</span>ProcedureQuery query = <span class="code-keyword">new</span>
ProcedureQuery(<span class="code-quote">"my_procedure"</span>);
+
+<span class="code-comment">// Set <span class="code-quote">"IN"</span>
parameter values
+</span>query.addParam(<span class="code-quote">"paramter1"</span>, <span
class="code-quote">"abc"</span>);
+query.addParam(<span class="code-quote">"parameter2"</span>, <span
class="code-keyword">new</span> <span class="code-object">Integer</span>(3000));
+
+QueryResult resultsCollection = <span class="code-keyword">new</span>
QueryResult();
+
+<span class="code-comment">// run query
+</span>ctxt.performQueries(Collections.singleton(query), resultsCollection);
+
+<span class="code-comment">// read OUT parameters
+</span>List outList = resultsCollection.getFirstRows(query);
+
+<span class="code-keyword">if</span>(outList.size() > 0) {
+ Map outParameterValues = (Map) outList.get(0);
+}</pre>
+</div></div></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../../../images/border_bottom.gif'); background-repeat:
repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Executing a Stored Procedure/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Selecting Objects/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Stored%20Procedures/Selecting%20Objects/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Selecting Objects/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Selecting Objects/index.html Tue May 9 18:10:42 2006
@@ -0,0 +1,77 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Selecting Objects</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Selecting Objects</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick
Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User
Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a><ul>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Executing
a Stored Procedure/index.html">Executing a Stored Procedure</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Selecting
Objects/index.html">Selecting Objects</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Stored
Procedures and Transactions/index.html">Stored Procedures and
Transactions</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>If a stored procedure is known to return at
least one result set, procedure queries can be executed just like normal select
queries. Of course in addtion to returning data, such procedures can perform
any other database operations.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro'
border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="../../../../images/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td>Currently all
procedure queries will return data rows, not DataObjects. If the returned row
(Map) contains all the attributes needed to recreate a DataObject, this can be
done by calling <tt>DataContext.objectFromDataRow()</tt>.</td></tr></table>
+
+<p>Below is an example of creating a ProcedureQuery, initializing its
parameters, and processing execution results.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext ctxt;
+
+<span class="code-comment">// <span class="code-quote">"my_procedure"</span>
is a name of a stored procedure,
+</span><span class="code-comment">// that must exist in the DataMap
+</span>ProcedureQuery query = <span class="code-keyword">new</span>
ProcedureQuery(<span class="code-quote">"my_procedure"</span>);
+
+<span class="code-comment">// Set <span class="code-quote">"IN"</span>
parameter values
+</span>query.addParam(<span class="code-quote">"paramter1"</span>, <span
class="code-quote">"abc"</span>);
+query.addParam(<span class="code-quote">"parameter2"</span>, <span
class="code-keyword">new</span> <span class="code-object">Integer</span>(3000));
+
+<span class="code-comment">// run query as a normal select query
+</span>List rows = ctxt.performQuery(query);
+
+<span class="code-comment">// process results
+</span>Iterator it = rows.iterator();
+<span class="code-keyword">while</span>(it.hasNext()) {
+ Map row = (Map)it.next();
+
+ <span class="code-comment">// <span class="code-keyword">do</span> something
with result, e.g. instantiate a real DataObject
+</span> MyDataObject object = (MyDataObject)ctxt.objectFromDataRow(<span
class="code-quote">"MyDataObject"</span>, row);
+ ....
+}</pre>
+</div></div></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../../../images/border_bottom.gif'); background-repeat:
repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Selecting Objects/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Stored Procedures and Transactions/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Stored%20Procedures/Stored%20Procedures%20and%20Transactions/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Stored Procedures and Transactions/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Stored Procedures and Transactions/index.html Tue May
9 18:10:42 2006
@@ -0,0 +1,63 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Stored Procedures and Transactions</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Stored Procedures and Transactions</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick
Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User
Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a><ul>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Executing
a Stored Procedure/index.html">Executing a Stored Procedure</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Selecting
Objects/index.html">Selecting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/Stored
Procedures and Transactions/index.html">Stored Procedures and
Transactions</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>There maybe a situations when stored procedures
handle their own transactions and an application is configured to use
Cayenne-managed transactions. This is obviously conflicting and undesirable
behavior. In this case ProcedureQueries should be executed explicitly wrapped
in an "external" Transaction. This is one of the few cases when a user should
worry about transactions at all.</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext ctxt = ...;
+ProcedureQuery query = ...;
+QueryResult resultsCollection = <span class="code-keyword">new</span>
QueryResult();
+
+<span class="code-comment">// obtain a <span class="code-keyword">new</span>
instance of <span class="code-quote">"external"</span> Transaction
+</span>Transaction externalTransaction = Transaction.externalTransaction(<span
class="code-keyword">null</span>);
+
+<span class="code-comment">// run wrapping in Transaction that would not
commit explicitly
+</span>Transaction.performQueries(ctxt, Collections.singletonList(query),
resultsCollection);
+
+<span class="code-comment">// process results
+</span>List results = resultCollection.getFirstRows(query);
+...</pre>
+</div></div></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../../../images/border_bottom.gif'); background-repeat:
repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/Stored Procedures and Transactions/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Stored%20Procedures/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/index.html Tue May 9 18:10:42 2006
@@ -0,0 +1,46 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Stored Procedures</title>
+ <style type="text/css">@import "../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Stored Procedures</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/index.html">Quick
Start</a></li>
+<li><a href="../../../Documentation/User
Guide/Design/index.html">Design</a></li>
+<li><a href="../../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a><ul>
+<li><a href="../../../Documentation/User Guide/Stored Procedures/Executing a
Stored Procedure/index.html">Executing a Stored Procedure</a></li>
+<li><a href="../../../Documentation/User Guide/Stored Procedures/Selecting
Objects/index.html">Selecting Objects</a></li>
+<li><a href="../../../Documentation/User Guide/Stored Procedures/Stored
Procedures and Transactions/index.html">Stored Procedures and
Transactions</a></li>
+</ul>
+</li>
+<li><a href="../../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>In addition to mapping database tables and
views as entities, Cayenne allows mapping and executing database stored
procedures. Just like table structure is described by DbEntities, stored
procedures are described by Procedure class. Stored procedures are created
using CayenneModeler, and are executed using <span class="nobr"><a
href="http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/query/ProcedureQuery.html"
title="Visit page outside Confluence" rel="nofollow">ProcedureQuery<sup><img
class="rendericon" src="../../../images/linkext7.gif" height="7" width="7"
align="absmiddle" alt="" border="0"/></sup></a></span>, as described in the
following chapters.</p></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/Stored Procedures/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/index.html (added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/index.html Tue May 9 18:10:42 2006
@@ -0,0 +1,60 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - User Guide</title>
+ <style type="text/css">@import "../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">User Guide</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../Documentation/User
Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../Documentation/User
Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../Documentation/User Guide/Quick Start/index.html">Quick
Start</a></li>
+<li><a href="../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../Documentation/User Guide/Generating
Classes/index.html">Generating Classes</a></li>
+<li><a href="../../Documentation/User
Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../Documentation/User
Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../Documentation/User
Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../Documentation/User Guide/Stored
Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../Documentation/User
Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../Documentation/User Guide/Performance
Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../Documentation/User
Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../Documentation/User Guide/Ant Tasks/index.html">Ant
Tasks</a></li>
+<li><a href="../../Documentation/User Guide/Access Stack
Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../Documentation/User
Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><h3><a name="UserGuide-USERGUIDE"></a>USER
GUIDE</h3>
+<ol>
+ <li><a href="../../Documentation/User Guide/Introduction/index.html"
title="Introduction">Introduction</a></li>
+ <li><a href="../../Documentation/User Guide/Installation/index.html"
title="Installation">Installation</a></li>
+ <li><a href="../../Documentation/User Guide/Quick Start/index.html"
title="Quick Start">Quick Start</a></li>
+ <li><a href="../../Documentation/User Guide/Design/index.html"
title="Design">Design</a></li>
+ <li><a href="../../Documentation/User Guide/Generating
Classes/index.html" title="Generating Classes">Generating Classes</a></li>
+ <li><a href="../../Documentation/User Guide/DataContext/index.html"
title="DataContext">DataContext</a></li>
+ <li><a href="../../Documentation/User Guide/Queries/index.html"
title="Queries">Queries</a></li>
+ <li><a href="../../Documentation/User Guide/DataObjects/index.html"
title="DataObjects">DataObjects</a></li>
+ <li><a href="../../Documentation/User Guide/Stored
Procedures/index.html" title="Stored Procedures">Stored Procedures</a></li>
+ <li><a href="../../Documentation/User Guide/Expressions/index.html"
title="Expressions">Expressions</a></li>
+ <li><a href="../../Documentation/User Guide/Performance
Tuning/index.html" title="Performance Tuning">Performance Tuning</a></li>
+ <li><a href="../../Documentation/User Guide/Deployment/index.html"
title="Deployment">Deployment</a></li>
+ <li><a href="../../Documentation/User Guide/Ant Tasks/index.html"
title="Ant Tasks">Ant Tasks</a></li>
+ <li><a href="../../Documentation/User Guide/Access Stack
Internals/index.html" title="Access Stack Internals">Access Stack
Internals</a></li>
+ <li><a href="../../Documentation/User Guide/DataViews/index.html"
title="DataViews">DataViews</a></li>
+</ol>
+
+</div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User
Guide/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/index.html
URL:
http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/index.html?rev=405581&view=auto
==============================================================================
---
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/index.html
(added)
+++
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/index.html
Tue May 9 18:10:42 2006
@@ -0,0 +1,29 @@
+<html>
+ <head>
+ <title>Cayenne Documentation - Documentation</title>
+ <style type="text/css">@import "../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img
src="../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../index.html">Cayenne User
Documentation</a></span><br />
+ <span class="pagetitle">Documentation</span>
+ </div>
+<div id="ConfluenceContent"><h2><a
name="Documentation-CayenneDocumentation"></a>Cayenne Documentation</h2>
+
+<ul>
+ <li><a href="../Documentation/User Guide/index.html" title="User
Guide">User Guide</a>: General information on how to get started with Cayenne,
main Cayenne concepts, API details and deployment procedures.</li>
+ <li><a href="../Documentation/Modeler Guide/index.html" title="Modeler
Guide">Modeler Guide</a>: Object-relational mapping with CayenneModeler GUI
tool.</li>
+ <li><a href="../Documentation/Remote Object Persistence
Guide/index.html" title="Remote Object Persistence Guide">Remote Object
Persistence Guide</a>: Writing distributed Java applications with Cayenne
remote object persistence mechanism.</li>
+</ul>
+</div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image:
url('../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2006 ObjectStyle Group and content authors
+ </div>
+
+</body>
+</html>
Propchange:
incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/index.html
------------------------------------------------------------------------------
svn:eol-style = native