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 Tue, 22 Feb 2011 03:08:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/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="https://cwiki.apache.org/confluence/display/openjpa/Enhancement+with+Eclipse">Enhancement
with Eclipse</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael
Dick</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Add warning about eclipse plugin. <br />
    </div>
        <br/>
                         <h4>Changes (3)</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" >If you are using Eclipse to write
and deploy your application, then you have two choices for *build time* enhancement of your
entities.  But, if you&#39;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. <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2.
OpenJPA Plugin for Eclipse <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">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. <br> <br>Currently it provides
an Eclipse Builder for OpenJPA Enhancement. <br> <br>* [How to install the OpenJPA
Eclipse Tooling|OpenJPAEclipseInstallation] <br>* [How to use the OpenJPA Eclipse Tooling
Builder for Bytecode Enhancement|OpenJPAEclipseEnhancementBuilder] <br>* [How to develop
on and build the OpenJPA Eclipse Tooling|OpenJPAEclipseToolingDevAndBuild] <br> <br>{info:title=Status}
<br>The OpenJPA Eclipse Tooling does not have an official release as some known work-items
still need to be addressed in - https://issues.apache.org/jira/browse/OPENJPA-1412. <br>{info}
 <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h2. Custom ANT Builder <br>
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>!targets.png! <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>h2. OpenJPA Plugin for Eclipse <br> <br>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. <br> <br>{warning:title=Status} <br>The OpenJPA Eclipse
Tooling does not have an official release as some known work-items still need to be addressed
in - https://issues.apache.org/jira/browse/OPENJPA-1412. <br>There are also some known
bugs with the bytecode produced by the eclipse plugin (e.g. [OPENJPA-1879|http://issues.apache.org/jira/browse/OPENJPA-1879],
[OPENJPA-1887|https://issues.apache.org/jira/browse/OPENJPA-1887]). <br>{warning} <br>
<br>Currently it provides an Eclipse Builder for OpenJPA Enhancement. <br> <br>*
[How to install the OpenJPA Eclipse Tooling|OpenJPAEclipseInstallation] <br>* [How to
use the OpenJPA Eclipse Tooling Builder for Bytecode Enhancement|OpenJPAEclipseEnhancementBuilder]
<br>* [How to develop on and build the OpenJPA Eclipse Tooling|OpenJPAEclipseToolingDevAndBuild]
<br> <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <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-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&amp;modificationDate=1242659436000">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 class="atl-forced-newline" /></li>
</ol>


<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/118030/navigator.png?version=1&amp;modificationDate=1242659436000"
style="border: 0px solid black" /></span></p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/118030/main.png?version=1&amp;modificationDate=1242659436000"
style="border: 0px solid black" /></span></p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/118030/targets.png?version=1&amp;modificationDate=1242659436000"
style="border: 0px solid black" /></span></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>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/forbidden.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Status</b><br
/>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"
class="external-link" rel="nofollow">https://issues.apache.org/jira/browse/OPENJPA-1412</a>.<br/>
There are also some known bugs with the bytecode produced by the eclipse plugin (e.g. <a
href="http://issues.apache.org/jira/browse/OPENJPA-1879" class="external-link" rel="nofollow">OPENJPA-1879</a>,
<a href="https://issues.apache.org/jira/browse/OPENJPA-1887" class="external-link" rel="nofollow">OPENJPA-1887</a>).</td></tr></table></div>

<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>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/openjpa/Enhancement+with+Eclipse">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=118030&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://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