<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>spiros.blog() &#187; EclipseLink</title>
	<atom:link href="http://www.tzavellas.com/techblog/tag/eclipselink/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tzavellas.com/techblog</link>
	<description>Spiros Tzavellas’s blog, mostly on software development and Java.</description>
	<lastBuildDate>Fri, 24 Sep 2010 07:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Statically weaving JPA entities for EclipseLink using Maven</title>
		<link>http://www.tzavellas.com/techblog/2008/10/17/statically-weaving-jpa-entities-for-eclipselink-using-maven/</link>
		<comments>http://www.tzavellas.com/techblog/2008/10/17/statically-weaving-jpa-entities-for-eclipselink-using-maven/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 06:31:07 +0000</pubDate>
		<dc:creator>spiros</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[EclipseLink]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.tzavellas.com/techblog/?p=124</guid>
		<description><![CDATA[EclipseLink provides advanced JPA features such as lazy-loading, change tracking and fetch groups using bytecode weaving. To use bytecode weaving you can either dynamically instrument your entity classes at runtime (via a jvm agent) or use a tool to statically process the .class files after compilation. In this post we will present how to use [...]]]></description>
			<content:encoded><![CDATA[<p><a title="EclipseLink" href="http://eclipse.org/eclipselink">EclipseLink</a> provides advanced JPA features such as lazy-loading, change tracking and fetch groups using bytecode weaving. To use bytecode weaving you can either <a href="http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Configure_Dynamic_Weaving_for_JPA_Entities_Using_the_EclipseLink_Agent">dynamically</a> instrument your entity classes at runtime (via a jvm agent) or use a tool to <a href="http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Configure_Static_Weaving_for_JPA_Entities">statically</a> process the <em>.class</em> files after compilation. In this post we will present how to use EclipseLink&#8217;s static weaver in a Maven project.</p>
<p>To enable static weaving in a Maven based project we have to add the Eclipselink weaver in the <em>process-classes</em> phase of the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html">Maven&#8217;s build life cycle</a>. The <em>process-classes</em> phase happens after the <em>compile</em> phase and allows the post-processing of files generated in compile phase. In our case, the EclipseLink weaver will post-process the <em>.class</em> files produced by the compiler to add extra bytecodes that implement the desired JPA functionality (lazy-loading, etc).</p>
<p>In the below code we use the <a href="http://maven.apache.org/plugins/maven-antrun-plugin/">Maven AntRun plugin</a> to call (via the <a href="http://ant.apache.org/manual/CoreTasks/java.html">java ANT task</a>) the command line version of the EclipseLink&#8217;s static weaver. Please note that the class name of the weaver is <strong>org.eclipse.persistence.tools.weaving.jpa.StaticWeave</strong> and not <strong>org.eclipse.persistence.tools.weaving.StaticWeave</strong> as the <a href="http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Configure_Static_Weaving_for_JPA_Entities">EclipseLink JPA Extensions</a> wiki page says.</p>
<pre>
&lt;build&gt;
 &lt;plugins&gt;
   &lt;plugin&gt;
     &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
     &lt;executions&gt;
       &lt;execution&gt;
         &lt;phase&gt;process-classes&lt;/phase&gt;
         &lt;configuration&gt;
           &lt;tasks&gt;
             &lt;java classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeave"
                   classpathref="maven.runtime.classpath" fork="true"&gt;
               &lt;arg line="-loglevel FINE -persistenceinfo src/main/resources target/classes target/classes"/&gt;
             &lt;/java&gt;
           &lt;/tasks&gt;
         &lt;/configuration&gt;
         &lt;goals&gt;
           &lt;goal&gt;run&lt;/goal&gt;
         &lt;/goals&gt;
       &lt;/execution&gt;
     &lt;/executions&gt;
   &lt;/plugin&gt;
 &lt;/plugins&gt;
&lt;/build&gt;
</pre>
<p>In addition to the <em>pom.xml</em> changes in order to use static weaving in EclipseLink you have to set the <strong>eclipselink.weaving</strong> property to <strong>static</strong> in the <em>META-INF/peristence.xml</em> file.</p>
<pre>
&lt;property name="eclipselink.weaving" value="static" /&gt;
</pre>
<p>For more information about EclipseLink&#8217;s static weaving see the <a href="http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Configure_Static_Weaving_for_JPA_Entities">How to Configure Static Weaving for JPA Entities</a> section of the <a href="http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)">Using EclipseLink JPA Extensions</a> wiki page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tzavellas.com/techblog/2008/10/17/statically-weaving-jpa-entities-for-eclipselink-using-maven/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Oracle Toplink is now open source</title>
		<link>http://www.tzavellas.com/techblog/2007/03/13/oracle-toplink-is-now-open-source/</link>
		<comments>http://www.tzavellas.com/techblog/2007/03/13/oracle-toplink-is-now-open-source/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 03:50:12 +0000</pubDate>
		<dc:creator>spiros</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[EclipseLink]]></category>
		<category><![CDATA[jpa]]></category>

		<guid isPermaLink="false">http://www.tzavellas.com/techblog/2007/03/13/oracle-toplink-is-now-open-source/</guid>
		<description><![CDATA[Oracle has released the Toplink O/R mapping framework as open source. They proposed a new persistence project, named Eclipse Persistence Platform (or EclipseLink for short), at the Eclipse Foundation and they are donating the Toplink source code to start the project. The EclipseLink will be a runtime project offering only libraries and no IDE tooling. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oracle.com">Oracle</a> has released the <a href="http://www.oracle.com/technology/products/ias/toplink/index.html">Toplink</a> <acronym title="Object / Relational">O/R</acronym> mapping framework as open source. They proposed a new persistence project, named Eclipse Persistence Platform (or EclipseLink for short), at the <a href="http://www.eclipse.org/">Eclipse Foundation</a> and they are donating the <a href="http://www.oracle.com/technology/products/ias/toplink/index.html">Toplink</a> source code to start the project.</p>
<p>The EclipseLink will be a runtime project offering only libraries and no IDE tooling. Other Eclipse projects, like <a href="http://www.eclipse.org/dali/">Dali</a>, offer tooling for <acronym title="Java Persistence API">JPA</acronym> and <acronym title="Object / Relational">O/R</acronym> mapping. The project will include the <a href="http://http://www.oracle.com/technology/products/ias/toplink/index.html">Toplink</a> <acronym title="Object / Relational">O/R</acronym> mapping tools and APIs, a <acronym title="Java Persistence API">JPA</acronym> implementation, an <acronym title="Object XML Mapping">OXM</acronym> framework, a <acronym title="Service Data Objects">SDO</acronym> implementation and other persistence related technologies.</p>
<p><a href="http://www.oracle.com/technology/products/ias/toplink/index.html">Toplink</a> is a very mature and successful product. It is maybe the fist successful <acronym title="Object / Relational">O/R</acronym> mapping product for <a href="http://java.sun.com">Java</a> and it is great to see <a href="http://www.oracle.com">Oracle</a> donating it to the open source community.</p>
<p>For more information see:</p>
<ul>
<li><a href="http://www.oracle.com/technology/products/ias/toplink/index.html">The Oracle Toplink website</a></li>
<li><a href="http://www.theserverside.com/news/thread.tss?thread_id=44564" title="TheServerSide">Oracle Proposes Open Source Persistence Project at Eclipse</a></li>
<li><a href="http://www.infoq.com/news/2007/03/toplink-open-source" title="InfoQ">Oracle Contributes TopLink ORM Open Source to Eclipse</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tzavellas.com/techblog/2007/03/13/oracle-toplink-is-now-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

