openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] OpenJPA > Enhancement with Eclipse
Date Fri, 05 Mar 2010 18:47:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=openjpa&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="">Enhancement
with Eclipse</a></h2>
     <h4>Page <b>edited</b> by             <a href="">Donald
     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 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>

	<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>

<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=""

<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">
    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
/lib &lt;- other libs

	<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>

<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 id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>

       <a href="">View
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message