<?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>java rants &#187; jpa</title>
	<atom:link href="http://www.javarants.com/tag/jpa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javarants.com</link>
	<description>Rants about Java and other internet technologies by Sam Pullara</description>
	<lastBuildDate>Wed, 21 Jul 2010 17:36:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using JAX-RS (Jersey) to build a JPA/JAXB-backed JSON REST API</title>
		<link>http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/</link>
		<comments>http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 01:38:46 +0000</pubDate>
		<dc:creator>Sam Pullara</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jax-rs]]></category>
		<category><![CDATA[jersey]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[jsr-311]]></category>
		<category><![CDATA[openjpa]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[toplink]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.javarants.com/?p=926</guid>
		<description><![CDATA[I've been looking for a while though to find that perfect combination of frameworks and libraries that would give me the expressive power that I want for building web applications -- now I think I've found it. <a href="http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Building applications for deployment to the web has evolved over the last several years to be focused on dynamic behavior, separation of model/view/controller, and simplified but scalable configuration and deployment.  From a performance, tools and library perspective I&#8217;m still highly biased to development in Java over more up-and-coming languages.  However, much has been learned in the Java community from the better frameworks like Rails and those lessons should not be ignored.</p>
<p>I&#8217;ve been looking for a while though to find that perfect combination of frameworks and libraries that would give me the expressive power that I want for building web applications.  There have been many contenders from <a href="http://wiki.jruby.org/wiki/JRuby_on_Rails">JRuby on Rails</a>, to <a href="http://grails.org/">Grails</a>, to <a href="http://seamframework.org/">Seam</a> and even just writing everything myself.  Ultimately, I believe in the <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a> principle (like Rails), though I don&#8217;t think many frameworks go far enough when dealing with the database.  When you are building a web application it is rare that you are going to change what database you are using.  In fact, the majority of your scaling architecture is likely highly dependent on how you store your data.  This is why I prefer an application framework that allows me to start with the database and construct my application&#8217;s data object model from it.<br />
<span id="more-926"></span><br />
So what are my acceptance criteria for this über-framework?</p>
<ul>
<li>Great object-relational mapping tool that works well with MySQL + PostgreSQL</li>
<li>Excellent support for consuming and producing XML and JSON that integrates with the well with the data objects that the ORM tool uses</li>
<li>Supports writing MVC applications naturally</li>
<li>Support for building REST APIs with arbitrary URL mapping to service parameters</li>
<li>High straight-line performance with the ability to scale up servers</li>
<li>Great defaults that make configuration mostly unnecessary with simple deployment</li>
<li><a href="http://www.jetbrains.com/idea/">State-of-the-art IDE support</a>. I don&#8217;t like to type anymore nor memorize APIs.</li>
<li>Suitable for quick prototyping and production applications</li>
<li>Support for templating views of any output type (HTML, XML, etc)</li>
<li>Easy to unit and integration test</li>
<li>Open source</li>
</ul>
<p>Certainly a high barrier but I think I have finally found one that is a very strong contender. Amazingly, it is even coming out of the JSR standards process with a nice layer of open source on top of it.  <a href="http://jcp.org/en/jsr/detail?id=311">JSR-311</a> was stated to develop an API for providing support for <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> Web Services in the Java Platform.  Not only does it do that nicely but it also has the right hooks for simple dependency injection, orthogonal to <a href="http://www.jcp.org/en/jsr/detail?id=220">JPA</a> (my favorite ORM), support for both XML and JSON natively, and except in unusual circumstances very DRY.</p>
<p>Because it is in Java and works well with JPA it satisfies a large number of my requirements before we even look at what it offers.  Another aspect of it that didn&#8217;t make the above list is that the production quality reference implementation is available as a couple of dependencies in Maven making it very easy to work with.  It also works well deployed within lightweight containers like <a href="https://grizzly.dev.java.net/">Grizzly</a>, heavier ones like <a href="http://tomcat.apache.org/">Tomcat</a> and <a href="https://glassfish.dev.java.net/">Glassfish</a>, and the REST APIs it creates can even be directly tested without any container at all. There are some things that Jersey supports that are non-standard that I think are excellent additions to the framework and should likely make it into future versions including support for templating (like JSP and Freemarker) that help it satisfy my requirements.</p>
<p>To give you an example of how terse the API can be, here is the simplest example that includes deployment as an operating web service:</p>
<pre>
<span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">class</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> Main {
    </span><span style="color: rgb(128,128,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">@Path</span><span style="color: rgb(0,0,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); background-color: rgb(246,235,188); font-weight: bold; font-style: normal; ">&quot;/helloworld&quot;</span><span style="color: rgb(0,0,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">)</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">static</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">class</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> HelloWorldResource {
        </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@GET</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
        </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Produces</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;text/plain&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
        </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> String getClichedMessage() {
            </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">return</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;Hello World&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">;
        }
    }

    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">static</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">void</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> main(String[] args) </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">throws</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> IOException {
        Map&lt;String, String&gt; initParams = </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">new</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> HashMap&lt;String, String&gt;();
        initParams.put(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;com.sun.jersey.config.property.packages&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, </span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;com.sun.jersey.samples.helloworld&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">);

        System.</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: italic; ">out</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.println(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;Starting grizzly...&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">);
        URI uri = UriBuilder.</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: italic; ">fromUri</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;http://localhost/&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">).port(</span><span style="color: rgb(0,0,255); font-weight: normal; font-style: normal; ">9998</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">).build();
        SelectorThread threadSelector = GrizzlyWebContainerFactory.</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: italic; ">create</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(uri, initParams);
        System.</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: italic; ">out</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.println(String.</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: italic; ">format</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;Try out %shelloworld</span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">\n</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">Hit enter to stop it...&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, uri));
        System.</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: italic; ">in</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.</span><span style="color: rgb(0,0,0); background-color: rgb(246,235,188); font-weight: normal; font-style: normal; ">read</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">();
        threadSelector.stopEndpoint();
    }
}
</span>
</pre>
<p>The @Path annotation lets you use URI path templates to specify the matching paths and path parameters to your REST service.  You can produce any set of content-types and content negotiation will be done for you based on the incoming request.  Exceptions can be mapped directly to error responses.  Query, Matrix, Path, Header and Cookie parameters are all supported and automatically injected based on annotations.  Here is a more sophisticated example from an application I am writing:</p>
<pre>
<span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@GET</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Produces</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;application/json&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Path</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;/network/{id: [0-9]+}/{nid}&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> User getUserByNetworkId(</span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@PathParam</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;id&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">) </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">int</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> id, </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@PathParam</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;nid&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">) String networkId) {
        Query q = </span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.createQuery(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;</span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">SELECT</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> u </span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">FROM</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> User u </span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">WHERE</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> u.networkId = :id </span><span style="color: rgb(0,0,128); background-color: rgb(255,255,255); font-weight: bold; font-style: normal; ">AND</span><span style="color: rgb(0,128,0); background-color: rgb(237,252,237); font-weight: bold; font-style: normal; "> u.networkUserId = :nid</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">);
        q.setParameter(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;id&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, id);
        q.setParameter(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;nid&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, networkId);
        </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">return</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> (User) q.getSingleResult();
    }</span>
</pre>
<p>In this example we are implementing a GET request with two path parameters, id and uid.  They are automatically passed into the method on execution and then I use them in a JPA statement.  EntityNotFoundException is actually mapped to a 404 but I don&#8217;t need to deal with that in the method itself.  PUTs and POSTs are similarly straight-forward.  This method creates a new user:</p>
<pre>
<span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@PUT</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Consumes</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;application/json&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Produces</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;application/json&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(128,128,0); font-weight: normal; font-style: normal; ">@Path</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">(</span><span style="color: rgb(0,128,0); font-weight: bold; font-style: normal; ">&quot;/create&quot;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">)
    </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">public</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> User createUser(User user) {
        user.setNetwork(</span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.getReference(Network.</span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">class</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">, user.getNetworkId()));
        </span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.persist(user);
        </span><span style="color: rgb(102,14,122); font-weight: bold; font-style: normal; ">em</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">.refresh(user);
        </span><span style="color: rgb(0,0,128); font-weight: bold; font-style: normal; ">return</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> user;
    }</span>
</pre>
<p>All very declarative and readable. And works great with JPA objects that also happen to be JAXB objects.  Notice that in those examples I am returning JSON but I don&#8217;t need to explicitly convert my objects.  All that is handled by built in message readers and writers (which can be extended if need be).  </p>
<p>One thing that I will note is that after struggling with both <a href="http://openjpa.apache.org/">OpenJPA</a> (less than ideal support for the standard) and <a href="http://hibernate.org">Hibernate</a> (some very odd runtime class munging) I settled with <a href="http://oss.oracle.com/toplink-essentials-jpa.html">Toplink-Essentials</a> (the open-source version of Oracle Toplink).  It is much more robust than OpenJPA and is much cleaner at runtime than Hibernate.  Finally here is what a typical Maven dependencies look like for creating a Jersey-based web application:</p>
<pre>
<span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repositories</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">maven2-repository.dev.java.net</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">name</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">Java.net</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">Repository</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">for</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; "> </span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">Maven</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">name</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">http://download.java.net/maven/2</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">java.net</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">id</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">http://download.java.net/maven/1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">url</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">layout</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">legacy</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">layout</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repository</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">repositories</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependencies</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">com.sun.jersey</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">jersey-server</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">1.0.1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">com.sun.jersey</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">jersey-json</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">1.0.1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">com.sun.jersey</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">jersey-atom</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">1.0.1</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">mysql</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">mysql-connector-java</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">5.1.6</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">toplink.essentials</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">groupId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">toplink-essentials</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">artifactId</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
      </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: bold; font-style: normal; ">2.1-60</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">version</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
    </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependency</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
  </span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&lt;/</span><span style="color: rgb(0,0,128); background-color: rgb(239,239,239); font-weight: bold; font-style: normal; ">dependencies</span><span style="color: rgb(0,0,0); background-color: rgb(239,239,239); font-weight: normal; font-style: normal; ">&gt;</span><span style="color: rgb(0,0,0); font-weight: normal; font-style: normal; ">
</span>
</pre>
<p>I was very impressed with how little it took to get going, especially with <a href="http://www.jetbrains.com/idea/download/">IntelliJ 8.0</a>&#8216;s awesome support for reading pom.xml files.  So now I&#8217;m a few days into building the application I set out to build and things are going great.  I haven&#8217;t hit any roadblocks so far and I&#8217;ve planned pretty far out already so I don&#8217;t expect to.  Though, with Jersey&#8217;s extensibility API, I think that if I do run into anything I have a great escape valve for augmenting the framework.  I&#8217;m not associated with Jersey or the JSR-311 specification but I might have to join in the fun.  This framework looks like it will have long legs in the Java community.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javarants.com/2008/12/25/using-jax-rs-jersey-to-build-a-jpajaxb-backed-json-rest-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>JPA 2.0 with Criteria</title>
		<link>http://www.javarants.com/2008/03/15/jpa-20-with-criteria/</link>
		<comments>http://www.javarants.com/2008/03/15/jpa-20-with-criteria/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 01:51:12 +0000</pubDate>
		<dc:creator>Sam Pullara</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[gauntlet]]></category>
		<category><![CDATA[criteria]]></category>
		<category><![CDATA[EJB-QL]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[orm]]></category>

		<guid isPermaLink="false">http://www.javarants.com/2008/03/15/jpa-20-with-criteria/</guid>
		<description><![CDATA[(see: JSR 317 Persistently Improving) I love the idea of adding a criteria API to JPA, the only thing I hope that they do differently than Hibernate is to implement that API in addition to string queries.  In Gauntlet we had &#8230; <a href="http://www.javarants.com/2008/03/15/jpa-20-with-criteria/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>(see: <a href="http://www.sdtimes.com/content/article.aspx?ArticleID=31655">JSR 317 Persistently Improving</a>)</p>
<p>I love the idea of adding a criteria API to JPA, the only thing I hope that they do differently than Hibernate is to implement that API in addition to string queries.  In Gauntlet we had issues where we wanted to use EJB-QL for selecting the right data and then a criteria-like API for applying security and filtering constraints on the query.  We ended up writing a criteria-like API that augmented the WHERE clause of the query to get the behavior that we needed (like described <a href="http://www.javalobby.org/articles/hibernatequery102/">here</a>).  For example, you could do this:</p>
<pre>
Query q = em.createQuery("SELECT p FROM Project p");
q.addExpression(Expression.notEqual("id", 2));
</pre>
<p>Or something like that. This would give you the best of both worlds, where you have the expressiveness of the textual query and the ability to further hone that query programmatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javarants.com/2008/03/15/jpa-20-with-criteria/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Generate JPA (or GORM) classes from your database for Java and Grails</title>
		<link>http://www.javarants.com/2007/10/14/generate-jpa-or-gorm-classes-from-your-database-for-java-and-grails/</link>
		<comments>http://www.javarants.com/2007/10/14/generate-jpa-or-gorm-classes-from-your-database-for-java-and-grails/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 17:14:47 +0000</pubDate>
		<dc:creator>Sam Pullara</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[dbmapper]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[gorm]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[schema]]></category>

		<guid isPermaLink="false">http://www.javarants.com/2007/10/14/generate-jpa-or-gorm-classes-from-your-database-for-java-and-grails/</guid>
		<description><![CDATA[Whether you start with the database or start with code, no one wants to do the other one. Certainly by the DRY principle it is a waste of time and potentially a place where you could introduce bugs into your &#8230; <a href="http://www.javarants.com/2007/10/14/generate-jpa-or-gorm-classes-from-your-database-for-java-and-grails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Whether you start with the database or start with code, no one wants to do the other one.  Certainly by the <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself" title="DRY Principle">DRY principle</a> it is a waste of time and potentially a place where you could introduce bugs into your code.  Today <a href="http://www.moonspider.com/">Dave</a> and I are releasing a command-line utility that will handle the case where you start with the database and want to use <a href="http://java.sun.com/developer/technicalArticles/J2EE/jpa/" title="JPA">JPA</a> to access it.  There are other utilities that do this that are generally built into IDEs, however this one fills the niche for those that want to do it in a more automated fashion and don&#8217;t want to edit the actual generated code.  In fact, we used a previous version of this tool at <a href="http://www.borland.com/us/products/silk/gauntlet/index.html">Gauntlet</a> throughout the development process to keep our database and <a href="http://java.sun.com/developer/technicalArticles/J2EE/jpa/" title="JPA">JPA</a> classes in sync with one another.</p>
<p>Introducing&#8230; <a href="http://code.google.com/p/dbmapper/">dbmapper</a>:</p>
<pre>
Usage: com.moonspider.dbmap.GenerateConfig
  -type (-t) [String] The type to generate, either 'jpa' or 'gorm' (experimental) (jpa)
  -destinationDirectory (-d) [String] Destination directory
  -url [String] The url of the database
  -pkg (-package) [String] The target package ()
  -user (-u) [String] Database user (sa)
  -password (-p) [String] Database password ()
  -globalExtends (-extends) [String] Class for all Java classes to extend
  -globalImplements (-implements) [String] Class for all Java classes to implement
  -driver [String] Database drive class
  -extension (-ext) [String] File extension for the generated code (java)
  -hibernate [String] Generate hibernate.cfg.xml to this directory
  -jaxb [flag] Enable xml binding generation</pre>
<p>By default, the tool has a number of rules built into it that I will call &#8216;best practices&#8217; at least as far as we are concerned:</p>
<ol>
<li>Tables should have a primary key column named <strong>id</strong> and it should auto increment.</li>
<li>Foreign keys should be named ${foreignTableName}_id and be specified in the database.</li>
<li>Many-to-many join tables should be named ${tableName1}_${tableName2}.</li>
</ol>
<p>If for some reason you want to break one of these rules you will need to dig into the configuration of <a href="http://code.google.com/p/dbmapper/">dbmapper</a>. On the JPA side there are a number of conventions that it uses:</p>
<ol>
<li>Class and property names are converted from _ separated to <a href="http://en.wikipedia.org/wiki/CamelCase">CamelCase.</a></li>
<li>Many-to-one and one-to-one relationships are marked as eager.</li>
<li>One-to-many and many-to-many relationships are marked as lazy.</li>
<li>Relationship collections are suffixed with List rather than making them plural.</li>
</ol>
<p>Again, these are adjustable through a configuration file that I suggest that you never use unless absolutely necessary.  The most typical use case for the configuration file is when a database identifier conflicts with an identifier used in Java or Grails.  In this case you can either configure dbmapper or change your database.  DBMapper is designed to work well with the <a href="http://code.google.com/p/dbmigrate/">dbmigrate</a> utility and in fact I recommend you use them together for the most leverage.  It is great to be able to add a new migration, execute the migration, generate new classes and see exactly the effect that your database change has on the domain model.</p>
<p>The default functionality is also available directly from <a href="http://grails.codehaus.org/">Grails</a>. On the command-line simply type:</p>
<pre>grails install-plugin dbmapper</pre>
<p>This will contact the plugin repository and install the latest dbmapper plugin directly into your Grails application.  Assuming that you have configured your database in the normal fashion for Grails you can then generate domain classes directly from that connection with a single command:</p>
<pre>grails generate-domain-classes</pre>
<p>Assuming that is successful you will find all of your domain classes in the grails-app/domain directory and also a hibernate configuration file in your grails-app/conf/hibernate directory.  You should then be able to use tasks likes generate-all to create views and controllers for each of your domain classes.</p>
<p>There is also experimental support for creating <a href="http://grails.codehaus.org/GORM">GORM</a> classes instead of JPA classes, however this really is experimental at this time and I suggest that you only try it if you are interested in fixing it.  GORM doesn&#8217;t seem to have the flexibility dbmapper needs quite yet.</p>
<p>Another feature of dbmapper is the ability to create <a href="http://java.sun.com/webservices/jaxb/about.html">JAXB</a> annotations on the JPA classes so the objects can be read from and written to XML in addition to the database. The dbmapper framework itself is designed to be reasonably extensible.  By adding another template you can extend it to generate mappings to other persistence frameworks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javarants.com/2007/10/14/generate-jpa-or-gorm-classes-from-your-database-for-java-and-grails/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
