openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] OpenJPA > Using Criteria API in DayTrader
Date Wed, 26 May 2010 15:19:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/5/_/styles/combined.css?spaceKey=openjpa&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="http://cwiki.apache.org/confluence/display/openjpa/Using+Criteria+API+in+DayTrader">Using
Criteria API in DayTrader</a></h2>
    <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~dianner">Dianne
Richards</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Added more info<br />
    </div>
        <br/>
                         <h4>Changes (4)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" ># Create a root directory for the
download. For this example, we will use a directory called *DayTrader*. <br># Create
subdirectories *branches/2.1.3* under the *DayTrader* directory <br></td></tr>
            <tr><td class="diff-changed-lines" ># cd to <span class="diff-changed-words">*DayTrader<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">/branches/2.1.3</span>*</span>
<br></td></tr>
            <tr><td class="diff-unchanged" ># Issue the following subversion command:
<br></td></tr>
            <tr><td class="diff-changed-lines" >&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
svn checkout <span class="diff-changed-words"><span class="diff-added-chars"style="background-color:
#dfd;">[</span>https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3<span
class="diff-added-chars"style="background-color: #dfd;">] branches/2.1.3[|https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3]</span></span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2.
Build DayTrader <br> <br>You must have maven installed in order to build DayTrader.
Maven can be downloaded from [http://maven.apache.org/download.html]. Unzip the file to a
directory and run mvn.bat\|.sh in the bin subdirectory to install. Add the bin subdirectory
to you path. <br> <br>Maven needs a repository. Typically it is at the following:
<br>* Windows - C:\Documents and Settings\&lt;userid&gt;\.m2\repository <br>*
Linux/unix - \~/.m2/repository <br> <br>From the *DayTrader/branches/2.1.3* directory,
type &quot;mvn clean install&quot; to build the project. <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h2. Setting up Eclipse <br>
<br>First install eclipse by going to&amp;nbsp;[http:/www.eclipse.org|http://www.eclipse.org]
and downloading a version of it. These instructions assume version 3.5. Unzip the downloaded
file into a directory. You can start eclipse by running eclipse.exe in the eclipse directory.
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>Next install subclipse, the Subversion Eclipse Plugin: <br># In Eclipse, go
to Help \-&gt; Install New software <br># Click on Add button - Enter Subclipse
for Name and [http://subclipse.tigris.org/update_1.6.x|http://subclipse.tigris.org/update_1.6.x]
for location <br># Select the Subclipse Plugin and click Next \-&gt; Next <br>#
Read and accept the license and click Finish <br> <br>Generate eclipse files for
the DayTrader project. From the *DayTrader/branches/2.1.3* directory, type &quot;mvn eclipse:eclipse&quot;
<br> <br>Set the M2_REPO classpath variable in Eclipse: <br># Go to Window
\-&gt; Preferences \-&gt; Java \-&gt; Build Path \-&gt; Classpath Variables
<br># Add a new variable called M2_REPO, set to the maven repository directory mentioned
above. <br> <br>Import DayTrader projects into Eclipse. <br> <br>#
From Eclipse, Click on File \-&gt; Import... <br># Under the General folder, select
Existing Projects into Workspace and click on Next. <br># Enter the root directory of
*DayTrader/branches/2.1.3* <br># Select all projects and click Finish <br> <br>h2.
Apply the DayTrader Patch <br> <br>TBD <br> <br>h2. Run DayTrader
on Geronimo <br> <br>Install and start the Geronimo server <br> <br>From
the Geronimo web console: <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="UsingCriteriaAPIinDayTrader-UsingCriteriaAPIinDayTrader"></a>Using
Criteria API in DayTrader</h1>

<p>A current DayTrader project implementation in Apache Geronimo contains several JPQL
queries. These can easily be converted to JPA Criteria API queries. A sample with this conversion
can be created to run on the Apache Geronimo server.</p>

<h2><a name="UsingCriteriaAPIinDayTrader-DownloadingDayTrader"></a>Downloading
DayTrader</h2>

<p>You must have Subversion installed in order to download the DayTrader implementation.Subversion
can be downloaded from&nbsp;<a href="http://subversion.apache.org/packages.html" class="external-link"
rel="nofollow">http://subversion.apache.org/packages.html</a>.  Use the 2.1.3 version
of DayTrader for this sample. Follow the following steps:</p>
<ol>
	<li>Create a root directory for the download. For this example, we will use a directory
called <b>DayTrader</b>.</li>
	<li>Create subdirectories <b>branches/2.1.3</b> under the <b>DayTrader</b>
directory</li>
	<li>cd to <b>DayTrader</b></li>
	<li>Issue the following subversion command:<br/>
&nbsp;&nbsp;&nbsp;&nbsp; svn checkout <a href="https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3"
class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3</a>
branches/2.1.3<a href="https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3"
class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3</a></li>
</ol>


<h2><a name="UsingCriteriaAPIinDayTrader-BuildDayTrader"></a>Build DayTrader</h2>

<p>You must have maven installed in order to build DayTrader. Maven can be downloaded
from <a href="http://maven.apache.org/download.html" class="external-link" rel="nofollow">http://maven.apache.org/download.html</a>.
Unzip the file to a directory and run mvn.bat&#124;.sh in the bin subdirectory to install.
Add the bin subdirectory to you path.</p>

<p>Maven needs a repository. Typically it is at the following:</p>
<ul>
	<li>Windows - C:\Documents and Settings\&lt;userid&gt;\.m2\repository</li>
	<li>Linux/unix - &#126;/.m2/repository</li>
</ul>


<p>From the <b>DayTrader/branches/2.1.3</b> directory, type "mvn clean install"
to build the project.</p>


<h2><a name="UsingCriteriaAPIinDayTrader-SettingupEclipse"></a>Setting up
Eclipse</h2>

<p>First install eclipse by going to&nbsp;<a href="http://www.eclipse.org" class="external-link"
rel="nofollow">http:/www.eclipse.org</a> and downloading a version of it. These instructions
assume version 3.5. Unzip the downloaded file into a directory. You can start eclipse by running
eclipse.exe in the eclipse directory.</p>

<p>Next install subclipse, the Subversion Eclipse Plugin:</p>
<ol>
	<li>In Eclipse, go to Help &#45;&gt; Install New software</li>
	<li>Click on Add button - Enter Subclipse for Name and <a href="http://subclipse.tigris.org/update_1.6.x"
class="external-link" rel="nofollow">http://subclipse.tigris.org/update_1.6.x</a>
for location</li>
	<li>Select the Subclipse Plugin and click Next &#45;&gt; Next</li>
	<li>Read and accept the license and click Finish</li>
</ol>


<p>Generate eclipse files for the DayTrader project. From the <b>DayTrader/branches/2.1.3</b>
directory, type "mvn eclipse:eclipse"</p>

<p>Set the M2_REPO classpath variable in Eclipse:</p>
<ol>
	<li>Go to Window &#45;&gt; Preferences &#45;&gt; Java &#45;&gt;
Build Path &#45;&gt; Classpath Variables</li>
	<li>Add a new variable called M2_REPO, set to the maven repository directory mentioned
above.</li>
</ol>


<p>Import DayTrader projects into Eclipse.</p>

<ol>
	<li>From Eclipse, Click on File &#45;&gt; Import...</li>
	<li>Under the General folder, select Existing Projects into Workspace and click on
Next.</li>
	<li>Enter the root directory of <b>DayTrader/branches/2.1.3</b></li>
	<li>Select all projects and click Finish</li>
</ol>


<h2><a name="UsingCriteriaAPIinDayTrader-ApplytheDayTraderPatch"></a>Apply
the DayTrader Patch</h2>

<p>TBD</p>

<h2><a name="UsingCriteriaAPIinDayTrader-RunDayTraderonGeronimo"></a>Run
DayTrader on Geronimo</h2>

<p>Install and start the Geronimo server</p>

<p>From the Geronimo web console:</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="http://cwiki.apache.org/confluence/display/openjpa/Using+Criteria+API+in+DayTrader">View
Online</a>
        |
        <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=21791034&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="http://cwiki.apache.org/confluence/display/openjpa/Using+Criteria+API+in+DayTrader?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message