From commits-return-6663-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed May 26 15:19:22 2010 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 86543 invoked from network); 26 May 2010 15:19:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 May 2010 15:19:22 -0000 Received: (qmail 16379 invoked by uid 500); 26 May 2010 15:19:22 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 16329 invoked by uid 500); 26 May 2010 15:19:21 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 16318 invoked by uid 99); 26 May 2010 15:19:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 15:19:21 +0000 X-ASF-Spam-Status: No, hits=-1395.5 required=10.0 tests=ALL_TRUSTED,AWL,HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 15:19:20 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4QFJ0oF011455 for ; Wed, 26 May 2010 15:19:00 GMT Date: Wed, 26 May 2010 11:19:00 -0400 (EDT) From: confluence@apache.org To: commits@openjpa.apache.org Message-ID: <3419553.1124.1274887140020.JavaMail.confluence@thor> Subject: [CONF] OpenJPA > Using Criteria API in DayTrader MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Auto-Submitted: auto-generated

Using Criteria API in DayTrader

Page edited by Dianne Richards

Comment: Added more info

Changes (4)

=20 =20
<= /tr>
...
# Create a root directory for= the download. For this example, we will use a directory called *DayTrader*= .
# Create subdirectories *branches/2.1.3* under the *DayTrader* direct= ory
# cd to *DayTrader/branches/2.1.3= *
# Issue the following subvers= ion command:
&nbsp;&nbsp;&= nbsp;&nbsp; svn checkout [https://svn.= apache.org/repos/asf/geronimo/daytrader/branches/2.1.3] branches/2.1.3[|https://svn.= apache.org/repos/asf/geronimo/daytrader/branches/2.1.3]
<= /td>

h2. Build DayTrader

You must have maven installed in order t= o build DayTrader. Maven can be downloaded from [http://maven.apache.org/do= wnload.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.

Ma= ven needs a repository. Typically it is at the following:
* Windows - C= :\Documents and Settings\<userid>\.m2\repository
* Linux/unix - \= ~/.m2/repository

From the *DayTrader/branches/2.1.3* directory, ty= pe "mvn clean install" to build the project.


h2. Setting up Eclipse
<= br>First install eclipse by going to&nbsp;[http:/www.eclipse.org|http:/= /www.eclipse.org] and downloading a version of it. These instructions assum= e version 3.5. Unzip the downloaded file into a directory. You can start ec= lipse by running eclipse.exe in the eclipse directory.

Next install subclipse, the Subversion Eclipse Plugin:
# In = Eclipse, go to Help \-> Install New software
# Click on Add button -= Enter Subclipse for Name and [http://subclipse.tigris.org/update_1.6.x|htt= p://subclipse.tigris.org/update_1.6.x] for location
# Select the Subcli= pse Plugin and click Next \-> Next
# Read and accept the license and= click Finish

Generate eclipse files for the DayTrader project. Fr= om the *DayTrader/branches/2.1.3* directory, type "mvn eclipse:eclipse= "

Set the M2_REPO classpath variable in Eclipse:
# Go to = Window \-> Preferences \-> Java \-> Build Path \-> Classpath Va= riables
# Add a new variable called M2_REPO, set to the maven repositor= y directory mentioned above.

Import DayTrader projects into Eclips= e.

# From Eclipse, Click on File \-> Import...
# Under the = General folder, select Existing Projects into Workspace and click on Next. =
# Enter the root directory of *DayTrader/branches/2.1.3*
# Select a= ll projects and click Finish

h2. Apply the DayTrader Patch
TBD

h2. Run DayTrader on Geronimo

Install and start the= Geronimo server

From the Geronimo web console:

Full Content

Using Criteria API in DayTrader

A current DayTrader project implementation in Apache Geronimo contains s= everal JPQL queries. These can easily be converted to JPA Criteria API quer= ies. A sample with this conversion can be created to run on the Apache Gero= nimo server.

Downlo= ading DayTrader

You must have Subversion installed in order to download the DayTrader im= plementation.Subversion can be downloaded from ht= tp://subversion.apache.org/packages.html. Use the 2.1.3 version of Day= Trader for this sample. Follow the following steps:

    =09
  1. Create a root directory for the download. For this example, we will = use a directory called DayTrader.
  2. =09
  3. Create subdirectories branches/2.1.3 under the DayTrader directory
  4. =09
  5. cd to DayTrader
  6. =09
  7. Issue the following subversion command:
         svn checkout https://svn.apache.org/repos/asf/geronimo/daytrader/branches/2.1.3<= /a> branches/2.1.3https://svn.= apache.org/repos/asf/geronimo/daytrader/branches/2.1.3

Build DayTra= der

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 subdirect= ory to install. Add the bin subdirectory to you path.

Maven needs a repository. Typically it is at the following:

    =09
  • Windows - C:\Documents and Settings\<userid>\.m2\repository =09
  • Linux/unix - ~/.m2/repository

From the DayTrader/branches/2.1.3 directory, type "mvn clean inst= all" to build the project.

Setting up= Eclipse

First install eclipse by going to http:/www.eclipse.org and do= wnloading 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.

Next install subclipse, the Subversion Eclipse Plugin:

    =09
  1. In Eclipse, go to Help -> Install New software
  2. =09
  3. Click on Add button - Enter Subclipse for Name and http://subclipse.tigris.org/update_1.6.x for location
  4. =09
  5. Select the Subclipse Plugin and click Next -> Next
  6. =09
  7. Read and accept the license and click Finish

Generate eclipse files for the DayTrader project. From the DayTrader/= branches/2.1.3 directory, type "mvn eclipse:eclipse"

Set the M2_REPO classpath variable in Eclipse:

    =09
  1. Go to Window -> Preferences -> Java -> Build Pa= th -> Classpath Variables
  2. =09
  3. Add a new variable called M2_REPO, set to the maven repository direc= tory mentioned above.

Import DayTrader projects into Eclipse.

    =09
  1. From Eclipse, Click on File -> Import...
  2. =09
  3. Under the General folder, select Existing Projects into Workspace an= d click on Next.
  4. =09
  5. Enter the root directory of DayTrader/branches/2.1.3
  6. =09
  7. Select all projects and click Finish

Appl= y the DayTrader Patch

TBD

Run = DayTrader on Geronimo

Install and start the Geronimo server

From the Geronimo web console: