openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] OpenJPA > Enhancement with Eclipse
Date Fri, 05 Mar 2010 18:47:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=openjpa&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/openjpa/Enhancement+with+Eclipse">Enhancement
with Eclipse</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~drwoods">Donald
Woods</a>
    </h4>
     added pointer to new eclipse plugin under openjpa/devtools
          <div id="versionComment" class="noteMacro" style="display:none; padding: 5px;">
     added pointer to new eclipse plugin under openjpa/devtools<br />
     </div>
          <br/>
     <div class="notificationGreySide">
         <h1><a name="EnhancementwithEclipse-EnhancingEntitieswithEclipse"></a>Enhancing
Entities with Eclipse</h1>

<p>If you are using Eclipse to write and deploy your application, then you have two
choices for <b>build time</b> enhancement of your entities.  But, if you're using
orm.xml to map the Entities, then you can only use the Custom ANT Builder method below, as
the OpenJPA Plugin for Eclipse currently does not handle that scenario.</p>

<h2><a name="EnhancementwithEclipse-OpenJPAPluginforEclipse"></a>OpenJPA
Plugin for Eclipse</h2>

<p>The OpenJPA Eclipse Tooling is a sub-project of the OpenJPA project.  It develops
IDE tooling for OpenJPA as an Eclipse feature with plug-ins.</p>

<p>Currently it provides an Eclipse Builder for OpenJPA Enhancement.</p>

<ul>
	<li><a href="/confluence/display/openjpa/OpenJPAEclipseInstallation" title="OpenJPAEclipseInstallation">How
to install the OpenJPA Eclipse Tooling</a></li>
	<li><a href="/confluence/display/openjpa/OpenJPAEclipseEnhancementBuilder" title="OpenJPAEclipseEnhancementBuilder">How
to use the OpenJPA Eclipse Tooling Builder for Bytecode Enhancement</a></li>
	<li><a href="/confluence/display/openjpa/OpenJPAEclipseToolingDevAndBuild" title="OpenJPAEclipseToolingDevAndBuild">How
to develop on and build the OpenJPA Eclipse Tooling</a></li>
</ul>


<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Status</b><br
/><p>The OpenJPA Eclipse Tooling does not have an official release as some known
work-items still need to be addressed in - <a href="https://issues.apache.org/jira/browse/OPENJPA-1412"
rel="nofollow">https://issues.apache.org/jira/browse/OPENJPA-1412</a>.</p></td></tr></table></div>



<h2><a name="EnhancementwithEclipse-CustomANTBuilder"></a>Custom ANT Builder</h2>

<p>For steps documented below, I have the following directory structure. Note, these
steps must be followed for each project that has Entities that need to be enhanced.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
/builder_project
    enhance.xml &lt;- the OpenJPA builder....
/bin &lt;- Compile directory
/src &lt;- Source directory
/jpa_lib &lt;- OpenJPA binary and all jars from the lib dir of the binary download
    commons-collections-3.2.jar
    commons-lang-2.1.jar
    commons-pool-1.3.jar
    derby-10.2.2.0.jar
    geronimo-jpa_2.0_spec-1.0-EA-SNAPSHOT.jar
    geronimo-jta_1.1_spec-1.1.1.jar
    openjpa-2.0.0-SNAPSHOT.jar
    serp-1.13.1.jar
/lib &lt;- other libs
</pre>
</div></div>

<ol>
	<li>After you add the <a href="/confluence/download/attachments/118030/enhance.xml?version=1">enhance.xml</a>
file to your file system, make sure to refresh your Eclipse workspace so it knows about the
newly added file. Make sure that the enhance.xml file is listed in the Navigator view (screenshot
#1 below.)</li>
	<li>Right click on the Eclipse project that you want to enhance and click on Properties.</li>
	<li>Click on the builders filter, and Create a new Ant builder.</li>
	<li>Name your builder, then click on "Browse Workspace" in the buildfile box. If you
downloaded the enhance.xml file and refreshed your workspace, it should be listed there. If
not, go back to step 1 and make sure that Eclipse detects your enhance.xml file.</li>
	<li>In the "Base Directory" box, click on the variables button and select build_project.
This should refer to the root of your project. In the directory structure above, it refers
to "builder_project".</li>
	<li>In the "Arguments" box you need to add the following properties <b>-Dopenjpa.libs</b>
and <b>-Dbuild.dir</b> (see screenshot #2 below.) The -Dopenjpa.libs is the path
to the OpenJPA libs, relative to the root of the project. The -Dbuild.dir is the path to the
build directory, relative to the root of the project. In the directory structure above, openjpa.libs
should be set to jpa_lib and build.dir should be set to bin.</li>
	<li>Click on the "Targets" tab along the top.</li>
	<li>You need to set the enhance target to run as a part of "Manual Build" and "Auto
Build" (see screenshot #3 below.)
<br clear="all" /></li>
</ol>


<p><img src="/confluence/download/attachments/118030/navigator.png" align="absmiddle"
border="0" /></p>

<p><img src="/confluence/download/attachments/118030/main.png" align="absmiddle"
border="0" /></p>

<p><img src="/confluence/download/attachments/118030/targets.png" align="absmiddle"
border="0" /></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/Enhancement+with+Eclipse">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=118030&revisedVersion=3&originalVersion=2">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/openjpa/Enhancement+with+Eclipse?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message