blob: ec2322b89c876dcbc31b9f39e8b98f0f46aa2ce0 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>RESTful Data Services API Reference | EclipseLink 2.7 Understanding EclipseLink</title>
<meta name="generator" content="Oracle DARB XHTML Converter (Mode = document) - Version 1.0.22 Build 1" />
<meta name="date" content="2014-06-10T10:35:15Z" />
<meta name="robots" content="noarchive" />
<meta name="doctitle" content="RESTful Data Services API Reference" />
<meta name="relnum" content="Release 2.7" />
<link rel="stylesheet" type="text/css" href="../../dcommon/style.css" media="screen" />
<link rel="copyright" href="../../dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
<link rel="start" href="../../index.htm" title="Home" type="text/html" />
<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
<link rel="prev" href="restful_jpa003.htm" title="Previous" type="text/html" />
<link rel="next" href="qcn.htm" title="Next" type="text/html" />
<!-- START: Disqus --><script type="text/javascript"> var disqus_developer = 0; </script><!-- END: Disqus --><!-- START: Sharethis --><script type="text/javascript">var switchTo5x=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript" src="http://s.sharethis.com/loader.js"></script> <!-- END: Sharethis --></head>
<body bgcolor="#FFFFFF"><iframe id="docheader" frameborder="0" framemargin="0" scrolling="no" src="../../dcommon/header.html"></iframe><script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchOptions = {}; var googleAnalyticsOptions = {}; googleAnalyticsOptions['queryParameter'] = 'q'; googleAnalyticsOptions['categoryParameter'] = ''; customSearchOptions['googleAnalyticsOptions'] = googleAnalyticsOptions; var customSearchControl = new google.search.CustomSearchControl( '016171230611334810008:enkkfjmsqju', customSearchOptions); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setSearchFormRoot('cse-search-form'); customSearchControl.draw('cse', options); }, true);</script><link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /><div id="cse" style="width:100%;"></div>
<div class="header"><a id="top" name="top"></a>
<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="top"><font face="helvetica, arial, sans-serif"><b>EclipseLink Solutions Guide for EclipseLink</b><br />
Release 2.7</div></td>
<td valign="bottom" align="right" width="144">
<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>&nbsp;</td>
<td align="center" valign="top"><a href="toc.htm"><img src="../../dcommon/images/contents.png" alt="Go To Table Of Contents" border="0" height="16" width="16" /><br />
</td><td>&nbsp;</td><td align="center"><a href="../../" target="_top" class="external text" title="Search" rel="nofollow"><img src="../../dcommon/images/search.png" alt="Search" style="border:0;" /><br /><span class="mini"></span></a></td><td>&nbsp;</td><td align="center"><a href="../eclipselink_otlcg.pdf" title="PDF" target="_blank"><img src="../../dcommon/images/pdf_icon.png" style="padding-right:5px;border:0" alt="PDF"></a></td>
</tr>
</table>
</td>
</tr>
</table>
<hr />
<table class="navigation simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100" align="center">
<tr>
<td align="center"><a href="restful_jpa003.htm"><img src="../../dcommon/images/larrow.png" alt="Previous" border="0" height="16" width="16" /></a></td>
<td align="center"><a href="qcn.htm"><img src="../../dcommon/images/rarrow.png" alt="Next" border="0" height="16" width="16" /></a></td>
<td>&nbsp;</td>
</tr>
</table>
</div>
<!-- class="header" -->
<div class="ind"><!-- End Header --><a id="CHDEGJIG" name="CHDEGJIG"></a><a id="TLADG1172" name="TLADG1172"></a>
<div class="sect1"><!-- infolevel="all" infotype="General" -->
<h1 class="sect1"><font face="arial, helvetica, sans-serif" color="#330099">RESTful Data Services API Reference</font></h1>
<p>The following types of RESTful operations can be used with JPA via HTTP when using RESTful Data Services:</p>
<ul>
<li>
<p><a href="#CHDEIFFJ">Entity Operations</a></p>
</li>
<li>
<p><a href="#CHDDAJBI">Entity Operations on Relationships</a></p>
</li>
<li>
<p><a href="#CHDJFCIF">Query Operations</a></p>
</li>
<li>
<p><a href="#CHDEHGDH">Base Operations</a></p>
</li>
<li>
<p><a href="#CHDFCFFA">Metadata Operations</a></p>
</li>
</ul>
</div>
<!-- class="sect1" -->
<a id="CHDEIFFJ" name="CHDEIFFJ"></a><a id="TLADG1173" name="TLADG1173"></a>
<hr />
<div class="refsect1"><!-- infolevel="all" infotype="General" -->
<h1 class="refsect1"><font face="arial, helvetica, sans-serif" color="#330099">Entity Operations</font></h1>
<p>Entity operations are those performed against a specific entity type within the persistence unit.</p>
<p>The base URI for entity operations is as follows:</p>
<p><code>/persistence/{version}/{unit-name}/entity/{type}/*</code></p>
<p>The <code>{type}</code> value refers to the type name (descriptor alias).</p>
<p>Supported entity operations are:</p>
<ul>
<li>
<p><a href="#CHDEBJID">FIND</a></p>
</li>
<li>
<p><a href="#CHDCIIIG">PERSIST</a></p>
</li>
<li>
<p><a href="#CHDGJGDD">MERGE</a></p>
</li>
<li>
<p><a href="#CHDDDDAB">DELETE</a></p>
</li>
</ul>
<a id="CHDEBJID" name="CHDEBJID"></a><a id="TLADG1174" name="TLADG1174"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">FIND</font></h2>
<a id="sthref160" name="sthref160"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/entity/{type}/{id}?{hints}</code></p>
<p>where:</p>
<ul>
<li>
<p><code>{id}</code> is a string</p>
</li>
<li>
<p><em><code>hints</code></em> are specified using HTTP query parameters, with the key being the name of the EclipseLink query hint</p>
</li>
</ul>
<a id="sthref161" name="sthref161"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo/1</code></p>
<a id="sthref162" name="sthref162"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref163" name="sthref163"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<ul>
<li>
<p><code>OK</code>, with a payload containing the entity</p>
</li>
<li>
<p><code>NOT_FOUND</code> if the entity does not exist</p>
</li>
</ul>
<a id="sthref164" name="sthref164"></a>
<p><strong><br /><span class="refsubsect">Usage</span></strong></p>
<a id="sthref165" name="sthref165"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Composite Keys</font></strong></p>
<p>Composite keys are supported. The <code>+</code> character is reserved and therefore cannot be used in fields that represent keys. Composite keys are separated using the <code>+</code> character and should be specified in an order corresponding to the Java default sorting of the attribute names.</p>
<p>For example, consider an entity <code>Phone</code>, with attributes <code>extB</code>=<code>123</code> and <code>extA</code>=<code>321</code>. The URL to find the entity is:</p>
<p><code>http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Phone/321+123</code></p>
<p>The <code>321</code> comes before the <code>123</code> because <code>extA</code> comes before <code>extB</code> when sorted in Java.</p>
<a id="sthref166" name="sthref166"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Result Caching</font></strong></p>
<p>Default EclipseLink and HTTP caching is enabled and configured through standard means.</p>
<a id="CHDJGEFH" name="CHDJGEFH"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Refresh</font></strong></p>
<p>The <code>EntityManager.refresh</code> operation can be invoked using the <code>find</code> with the query hint for <code>Refresh</code>.</p>
<a id="sthref167" name="sthref167"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Attributes</font></strong></p>
<p>Navigating into the attributes of an entity (for example, to get the <code>Address</code> entity associated with an employee in a single REST request) is supported to one level, for example:</p>
<p><code>/persistence/v1.0/{unit-name}/entity/{type}/{id}/{relationship}</code> will work</p>
<p>while</p>
<p><code>/persistence/v1.0/{unit-name}/entity/{type}/{id}/{relationship}/{index}/{relationship2</code>} will not</p>
<a id="CHDCIIIG" name="CHDCIIIG"></a><a id="TLADG1175" name="TLADG1175"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">PERSIST</font></h2>
<a id="sthref168" name="sthref168"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>PUT /persistence/{version}/{unit-name}/entity/{type}</code></p>
<a id="sthref169" name="sthref169"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>PUT http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo</code></p>
<a id="sthref170" name="sthref170"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Consumes</font></strong></p>
<p>JSON or XML</p>
<a id="sthref171" name="sthref171"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Payload</font></strong></p>
<p>Entity</p>
<a id="sthref172" name="sthref172"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref173" name="sthref173"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>Payload containing the entity returned by the persist operation</p>
<a id="sthref174" name="sthref174"></a>
<p><strong><br /><span class="refsubsect">Usage</span></strong></p>
<p><code>PUT</code> is required to be idempotent. As a result, it will fail if called with an object that expects the server to provide an ID field. Typically this will occur if the metadata specifies a generated key and the field that contains that key is unpopulated.</p>
<a id="CHDGJGDD" name="CHDGJGDD"></a><a id="TLADG1176" name="TLADG1176"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">MERGE</font></h2>
<a id="sthref175" name="sthref175"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>POST /persistence/{version}/{unit-name}/entity/{type}</code></p>
<a id="sthref176" name="sthref176"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>POST http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo</code></p>
<a id="sthref177" name="sthref177"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Consumes</font></strong></p>
<p>JSON or XML</p>
<a id="sthref178" name="sthref178"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Payload</font></strong></p>
<p>Entity</p>
<a id="sthref179" name="sthref179"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref180" name="sthref180"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>Payload containing the entity returned by the merge operation.</p>
<p>Merge takes an object graph and makes it part of the persistence context through comparison. It compares the object and all related objects to the ones that already exist and issues <code>INSERT</code>s, <code>UPDATE</code>s, and <code>DELETE</code>s to put the object in the persistence context.</p>
<a id="CHDDDDAB" name="CHDDDDAB"></a><a id="TLADG1177" name="TLADG1177"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">DELETE</font></h2>
<a id="sthref181" name="sthref181"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>DELETE /persistence/{version}/{unit-name}/entity/{type}{id}</code></p>
<p>where <code>{id}</code> is defined using a string</p>
<a id="sthref182" name="sthref182"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>DELETE http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo/1</code></p>
<a id="sthref183" name="sthref183"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p><code>OK</code></p>
</div>
<!-- class="refsect1" -->
<a id="CHDDAJBI" name="CHDDAJBI"></a><a id="TLADG1178" name="TLADG1178"></a>
<hr />
<div class="refsect1"><!-- infolevel="all" infotype="General" -->
<h1 class="refsect1"><font face="arial, helvetica, sans-serif" color="#330099">Entity Operations on Relationships</font></h1>
<p>The base URI for relationship operations is as follows:</p>
<p><code>/persistence/{version}/{unit-name}/entity/{entity}/{id}/{relationship}</code></p>
<p>Supported relationship operations are:</p>
<ul>
<li>
<p><a href="#CHDCEJCC">READ</a></p>
</li>
<li>
<p><a href="#CHDBEDDA">ADD</a></p>
</li>
<li>
<p><a href="#CHDDGAII">REMOVE</a></p>
</li>
</ul>
<a id="CHDCEJCC" name="CHDCEJCC"></a><a id="TLADG1179" name="TLADG1179"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">READ</font></h2>
<p>Use this operation to get the values of a relationship.</p>
<a id="sthref184" name="sthref184"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/entity/{type}/{id}/{relationship}</code></p>
<p>where:</p>
<ul>
<li>
<p><code>{id}</code> is a string.</p>
</li>
<li>
<p><code>{relationship}</code> is the JPA name of the relationship.</p>
</li>
</ul>
<a id="sthref185" name="sthref185"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo/1/myRelationship</code></p>
<a id="sthref186" name="sthref186"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref187" name="sthref187"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<ul>
<li>
<p><code>OK</code>, Payload containing an entity or a list of entities.</p>
</li>
<li>
<p><code>NOT_FOUND</code> if the entity does not exist</p>
</li>
</ul>
<a id="CHDBEDDA" name="CHDBEDDA"></a><a id="TLADG1180" name="TLADG1180"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">ADD</font></h2>
<p>Use this operation to add to a list or replace the value of a many-to-one relationship.</p>
<a id="sthref188" name="sthref188"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>POST /persistence/{version}/{unit-name}/entity/{type}/{id}/{relationship}?{partner}</code></p>
<div align="center">
<div class="inftblnote"><br />
<table class="Note oac_no_warn" summary="" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td align="left">
<p class="note"><img src="../../dcommon/images/note_icon.png" width="16" height="16" alt="Note" style="vertical-align:middle;padding-right:5px;" />Note:</p>
<p>As of EclipseLink 2.4.2, <code>partner</code> should be specified as a query parameter. Specifying <code>partner</code> as a matrix parameter is deprecated.</p>
</td>
</tr>
</tbody>
</table>
<br /></div>
<!-- class="inftblnote" --></div>
<a id="sthref189" name="sthref189"></a>
<p><strong><br /><span class="refsubsect">Examples</span></strong></p>
<p>For unidirectional relationships, <code>{partner}</code> is not required, for example:</p>
<p><code>POST http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo/1/myRelationship</code></p>
<p>For bi-directional relationships, you must provide the name of the attribute that makes up the opposite side of the relationship. For example, to update an <code>Auction.bid</code> where the opposite side of the relationship is <code>Bid.auction</code>, use the following:</p>
<p><code>POST http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo/1/myRelationship?partner=bid</code></p>
<a id="sthref190" name="sthref190"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Consumes</font></strong></p>
<p>JSON or XML</p>
<a id="sthref191" name="sthref191"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Payload</font></strong></p>
<p>Entity with the new value.</p>
<div align="center">
<div class="inftblnote"><br />
<table class="Note oac_no_warn" summary="" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td align="left">
<p class="note"><img src="../../dcommon/images/note_icon.png" width="16" height="16" alt="Note" style="vertical-align:middle;padding-right:5px;" />Note:</p>
<p>Relationship objects can be passed by value or by reference. See <a href="restful_jpa002.htm#CHDBDBHJ">"Passing By Value vs. Passing By Reference"</a>.</p>
</td>
</tr>
</tbody>
</table>
<br /></div>
<!-- class="inftblnote" --></div>
<a id="sthref192" name="sthref192"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref193" name="sthref193"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>Payload containing the entity with the added element</p>
<a id="CHDDGAII" name="CHDDGAII"></a><a id="TLADG1181" name="TLADG1181"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">REMOVE</font></h2>
<p>Use this operation to remove a specific entity from the list or a null on a many-to-one relationship.</p>
<a id="sthref194" name="sthref194"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>DELETE /persistence/{version}/{unit-name}/entity/{type}/{id}/{relationship}?{relationshipListItemId}</code></p>
<p>where <code>relationshipListItemId</code> is an optional query parameter. The <code>relationshipListItemId</code> is meaningful only when the <code>{relationship}</code> to be removed is a list. The <code>relationshipListItemId</code> should be set to the <code>id</code> of a member in the relationship list when only that member of the relationship list needs to be removed. The entire list specified by the <code>{relationship}</code> will be removed when <code>relationshipListItemId</code> is not specified.</p>
<a id="sthref195" name="sthref195"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>DELETE http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/entity/Foo/1/myRelationship</code></p>
<a id="sthref196" name="sthref196"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Consumes</font></strong></p>
<p>JSON or XML</p>
<div align="center">
<div class="inftblnote"><br />
<table class="Note oac_no_warn" summary="" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td align="left">
<p class="note"><img src="../../dcommon/images/note_icon.png" width="16" height="16" alt="Note" style="vertical-align:middle;padding-right:5px;" />Note:</p>
<p>Relationship objects can be passed by value or by reference. See <a href="restful_jpa002.htm#CHDBDBHJ">"Passing By Value vs. Passing By Reference"</a>.</p>
</td>
</tr>
</tbody>
</table>
<br /></div>
<!-- class="inftblnote" --></div>
<a id="sthref197" name="sthref197"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref198" name="sthref198"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<ul>
<li>
<p>OK</p>
</li>
<li>
<p>Payload containing the entity with the removed element</p>
</li>
</ul>
</div>
<!-- class="refsect1" -->
<a id="CHDJFCIF" name="CHDJFCIF"></a><a id="TLADG1182" name="TLADG1182"></a>
<hr />
<div class="refsect1"><!-- infolevel="all" infotype="General" -->
<h1 class="refsect1"><font face="arial, helvetica, sans-serif" color="#330099">Query Operations</font></h1>
<p>The base URI for query operations is as follows:</p>
<p><code>GET /persistence/{version}/{unit-name}/query/{name}{params}</code></p>
<p>The following query operations are supported:</p>
<p>Named queries doing reads can be run two ways in JPA. Both are supported in the REST API. They are:</p>
<ul>
<li>
<p><a href="#CHDBDEBE">Query Returning List of Results</a></p>
</li>
<li>
<p><a href="#CHDIHEJJ">Update/Delete Query</a></p>
</li>
</ul>
<a id="CHDBDEBE" name="CHDBDEBE"></a><a id="TLADG1183" name="TLADG1183"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">Query Returning List of Results</font></h2>
<a id="sthref199" name="sthref199"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/query/{name};{parameters}? {hints}</code></p>
<p>where:</p>
<ul>
<li>
<p><em><code>parameters</code></em> are specified using HTTP matrix parameters</p>
</li>
<li>
<p><em><code>hints</code></em> are specified using HTTP query parameters and with the key being the name of the EclipseLink query hint</p>
</li>
</ul>
<a id="sthref200" name="sthref200"></a>
<p><strong><br /><span class="refsubsect">Examples</span></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/query/Foo.findByName;name=myname</code></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/query/Foo.findByName;name=myname?eclipselink.jdbc.max-results=500</code></p>
<a id="sthref201" name="sthref201"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref202" name="sthref202"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>A payload containing a list of entities. An XML response contains a <code>List</code> as a grouping name for a collection of items and <code>item</code> as a grouping name for each member of a collection returned. JSON responses use square brackets <code>[]</code> to encapsulate a collection and curly braces <code>{}</code> to encapsulate each member of a collection. For example:</p>
<p><strong>XML Example</strong></p>
<pre xml:space="preserve" class="oac_no_warn">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;List&gt;
&lt;item&gt;
&lt;firstName&gt;Miles&lt;/firstName&gt;
&lt;lastName&gt;Davis&lt;/lastName&gt;
&lt;manager&gt;
&lt;firstName&gt;Charlie&lt;/firstName&gt;
&lt;lastName&gt;Parker&lt;/lastName&gt;
&lt;gender&gt;Male&lt;/gender&gt;
&lt;id&gt;26&lt;/id&gt;
&lt;/manager&gt;
&lt;/item&gt;
&lt;item&gt;
&lt;firstName&gt;Charlie&lt;/firstName&gt;
&lt;lastName&gt;Parker&lt;/lastName&gt;
&lt;manager&gt;
&lt;firstName&gt;Louis&lt;/firstName&gt;
&lt;lastName&gt;Armstrong&lt;/lastName&gt;
&lt;gender&gt;Male&lt;/gender&gt;
&lt;id&gt;27&lt;/id&gt;
&lt;/manager&gt;
&lt;/item&gt;
&lt;/List&gt;
</pre>
<p><strong>JSON Example</strong></p>
<pre xml:space="preserve" class="oac_no_warn">
[
{
"firstName": "Miles",
"lastName": "Davis",
"manager": {
"firstName": "Charlie",
"lastName": "Parker",
"gender": "Male",
"id": 26
}
},
{
"firstName": "Charlie",
"lastName": "Parker",
"manager": {
"firstName": "Louis",
"lastName": "Armstrong",
"gender": "Male",
"id": 27
}
}
]
</pre>
<a id="CHDIHEJJ" name="CHDIHEJJ"></a><a id="TLADG1184" name="TLADG1184"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">Update/Delete Query</font></h2>
<a id="sthref203" name="sthref203"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>POST /persistence/{version}/{unit-name}/query/{name};parameters?hints</code></p>
<p>where:</p>
<ul>
<li>
<p><em><code>parameters</code></em> are specified using HTTP matrix parameters</p>
</li>
<li>
<p><em><code>hints</code></em> are specified using HTTP query parameters and with the key being the name of the EclipseLink query hint</p>
</li>
</ul>
<a id="sthref204" name="sthref204"></a>
<p><strong><br /><span class="refsubsect">Examples</span></strong></p>
<p><code>POST http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/query/Foo.deleteAllByName;name=myname</code></p>
<p><code>POST http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/query/Foo.updateName;name=myname?eclipselink.jdbc.max-results=500</code></p>
<a id="sthref205" name="sthref205"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref206" name="sthref206"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>A payload containing the number of entities updated or deleted</p>
</div>
<!-- class="refsect1" -->
<a id="CHDHEJAJ" name="CHDHEJAJ"></a><a id="TLADG1185" name="TLADG1185"></a>
<hr />
<div class="refsect1">
<h1 class="refsect1"><font face="arial, helvetica, sans-serif" color="#330099">Single Result Queries</font></h1>
<a id="sthref207" name="sthref207"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/singleResultQuery/{name};{parameters}?{hints}</code></p>
<p>where:</p>
<ul>
<li>
<p><em><code>parameters</code></em> are specified using HTTP matrix parameters</p>
</li>
<li>
<p><em><code>hints</code></em> are specified using HTTP query parameters and with the key being the name of the EclipseLink query hint</p>
</li>
</ul>
<a id="sthref208" name="sthref208"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/singleResultQuery/Foo.findByName;name=myname</code></p>
<a id="sthref209" name="sthref209"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON, XML, or application/octet-stream</p>
<a id="sthref210" name="sthref210"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>A payload containing an entity</p>
</div>
<!-- class="refsect1" -->
<a id="CHDEHGDH" name="CHDEHGDH"></a><a id="TLADG1186" name="TLADG1186"></a>
<hr />
<div class="refsect1"><!-- infolevel="all" infotype="General" -->
<h1 class="refsect1"><font face="arial, helvetica, sans-serif" color="#330099">Base Operations</font></h1>
<p>Base operations are:</p>
<ul>
<li>
<p><a href="#CHDCCFCI">List Existing Persistence Units</a></p>
</li>
</ul>
<a id="CHDCCFCI" name="CHDCCFCI"></a><a id="TLADG1187" name="TLADG1187"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">List Existing Persistence Units</font></h2>
<a id="sthref211" name="sthref211"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}</code></p>
<a id="sthref212" name="sthref212"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0</code></p>
<a id="sthref213" name="sthref213"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON or XML</p>
<a id="sthref214" name="sthref214"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<p>A payload containing a list of persistence unit names and links to metadata about them. For example:</p>
<pre xml:space="preserve" class="oac_no_warn">
[
{
"_link": {
"href": "http://localhost:8080/exampleApp/persistence/v1.0/employee/metadata",
"method": "application/json",
"rel": "employee"
}
},
{
"_link": {
"href": "http://localhost:8080/exampleApp/persistence/v1.0/traveler/metadata",
"method": "application/json",
"rel": "traveler"
}
}
]
</pre></div>
<!-- class="refsect1" -->
<a id="CHDFCFFA" name="CHDFCFFA"></a><a id="TLADG1189" name="TLADG1189"></a>
<hr />
<div class="refsect1"><!-- infolevel="all" infotype="General" -->
<h1 class="refsect1"><font face="arial, helvetica, sans-serif" color="#330099">Metadata Operations</font></h1>
<p>The following metadata operations are supported:</p>
<ul>
<li>
<p><a href="#CHDGHGHB">List Types in a Persistence Unit</a></p>
</li>
<li>
<p><a href="#CHDGEFIJ">List Queries in a Persistence Unit</a></p>
</li>
<li>
<p><a href="#CHDJBAFI">Describe a Specific Entity</a></p>
</li>
</ul>
<a id="CHDGHGHB" name="CHDGHGHB"></a><a id="TLADG1190" name="TLADG1190"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">List Types in a Persistence Unit</font></h2>
<a id="sthref215" name="sthref215"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/metadata</code></p>
<a id="sthref216" name="sthref216"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/metadata</code></p>
<a id="sthref217" name="sthref217"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON</p>
<a id="sthref218" name="sthref218"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<ul>
<li>
<p><code>OK</code>, with a payload containing a list of types, with links to more detailed metadata, for example:</p>
<pre xml:space="preserve" class="oac_no_warn">
</pre>
<pre xml:space="preserve" class="oac_no_warn">
{
"persistenceUnitName": "hr",
"types": [
{
"_link": {
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/metadata/entity/Employee",
"method": "application/json",
"rel": "Employee"
}
},
{
"_link": {
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/metadata/entity/PhoneNumber",
"method": "application/json",
"rel": "PhoneNumber"
}
}
]
}
</pre></li>
<li>
<p><code>NOT_FOUND</code> if the persistence unit is not found</p>
</li>
</ul>
<a id="CHDGEFIJ" name="CHDGEFIJ"></a><a id="TLADG1191" name="TLADG1191"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">List Queries in a Persistence Unit</font></h2>
<a id="sthref219" name="sthref219"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/metadata/query</code></p>
<a id="sthref220" name="sthref220"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/exampleApp/persistence/v1.0/ExamplePU/metadata/query</code></p>
<a id="sthref221" name="sthref221"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON</p>
<a id="sthref222" name="sthref222"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<ul>
<li>
<p><code>OK</code> with a payload containing a list of all available queries, for example:</p>
<pre xml:space="preserve" class="oac_no_warn">
[
{
"queryName": "Employee.count",
"returnTypes": [
"Long"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.count",
"rel": "execute"
},
"jpql": "SELECT count(e) FROM Employee e"
},
{
"queryName": "EmployeeAddress.getRegion",
"returnTypes": [
"String",
"String",
"String"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/EmployeeAddress.getRegion",
"rel": "execute"
},
"jpql": "SELECT u.postalCode, u.province, u.street FROM EmployeeAddress u"
},
{
"queryName": "Employee.getPhoneNumbers",
"returnTypes": [
"String",
"String",
"PhoneNumber"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.getPhoneNumbers",
"rel": "execute"
},
"jpql": "SELECT e.firstName, e.lastName, pn FROM Employee e JOIN e.phoneNumbers pn"
},
{
"queryName": "EmployeeAddress.getPicture",
"returnTypes": [
"byte[]"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/EmployeeAddress.getPicture;id={id}",
"rel": "execute"
},
"jpql": "SELECT u.areaPicture FROM EmployeeAddress u where u.id = :id"
},
{
"queryName": "EmployeeAddress.updatePostalCode",
"returnTypes": [
"EmployeeAddress"
],
"linkTemplate": {
"method": "post",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/EmployeeAddress.updatePostalCode;postalCode={postalCode};id={id}",
"rel": "execute"
},
"jpql": "UPDATE EmployeeAddress u SET u.postalCode = :postalCode where u.id = :id"
},
{
"queryName": "Employee.salaryMax",
"returnTypes": [
"int",
"Object"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.salaryMax",
"rel": "execute"
},
"jpql": "SELECT e.id, max(e.salary) AS max_salary from Employee e GROUP BY e.id, e.salary"
},
{
"queryName": "EmployeeAddress.getAll",
"returnTypes": [
"EmployeeAddress"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/EmployeeAddress.getAll",
"rel": "execute"
},
"jpql": "SELECT u FROM EmployeeAddress u"
},
{
"queryName": "EmployeeAddress.getById",
"returnTypes": [
"EmployeeAddress"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/EmployeeAddress.getById;id={id}",
"rel": "execute"
},
"jpql": "SELECT u FROM EmployeeAddress u where u.id = :id"
},
{
"queryName": "Employee.getManagerById",
"returnTypes": [
"String",
"String",
"Employee"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.getManagerById;id={id}",
"rel": "execute"
},
"jpql": "select u.firstName, u.lastName, u.manager from Employee u where u.id = :id"
},
{
"queryName": "Employee.findAll",
"returnTypes": [
"Employee"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.findAll",
"rel": "execute"
},
"jpql": "SELECT e FROM Employee e ORDER BY e.id"
},
{
"queryName": "Employee.getManager",
"returnTypes": [
"String",
"String",
"Employee"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.getManager",
"rel": "execute"
},
"jpql": "select u.firstName, u.lastName, u.manager from Employee u"
}
]
</pre></li>
<li>
<p><code>NOT_FOUND</code> if persistence unit is not found</p>
</li>
</ul>
<a id="CHDJBAFI" name="CHDJBAFI"></a><a id="TLADG1192" name="TLADG1192"></a>
<hr />
<h2 class="refsect2"><font face="arial, helvetica, sans-serif" color="#330099">Describe a Specific Entity</font></h2>
<a id="sthref223" name="sthref223"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">HTTP Request Syntax</font></strong></p>
<p><code>GET /persistence/{version}/{unit-name}/metadata/entity/</code> <em><code>type</code></em></p>
<a id="sthref224" name="sthref224"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Example</font></strong></p>
<p><code>GET http://localhost:8080/CustomerApp/persistence/v1.0/Inventory/metadata/entity/Customer</code></p>
<a id="sthref225" name="sthref225"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Produces</font></strong></p>
<p>JSON</p>
<a id="sthref226" name="sthref226"></a>
<p><strong><font face="arial, helvetica, sans-serif" color="#330099">Response</font></strong></p>
<ul>
<li>
<p><code>OK</code>, with a payload containing details about the entity and available operations on it, for example,</p>
<pre xml:space="preserve" class="oac_no_warn">
{
"name": "Employee",
"attributes": [
{
"name": "id",
"type": "int"
},
{
"name": "firstName",
"type": "String"
},
{
"name": "gender",
"type": "Gender"
},
{
"name": "lastName",
"type": "String"
},
{
"name": "salary",
"type": "double"
},
{
"name": "version",
"type": "Long"
},
{
"name": "period",
"type": "EmploymentPeriod"
},
{
"name": "manager",
"type": "Employee"
},
{
"name": "office",
"type": "Office"
},
{
"name": "address",
"type": "EmployeeAddress"
},
{
"name": "certifications",
"type": "List&lt;Certification&gt;"
},
{
"name": "responsibilities",
"type": "List&lt;String&gt;"
},
{
"name": "projects",
"type": "List&lt;Project&gt;"
},
{
"name": "expertiseAreas",
"type": "List&lt;Expertise&gt;"
},
{
"name": "managedEmployees",
"type": "List&lt;Employee&gt;"
},
{
"name": "phoneNumbers",
"type": "List&lt;PhoneNumber&gt;"
}
],
"linkTemplates": [
{
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/entity/Employee/{primaryKey}",
"rel": "find"
},
{
"method": "put",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/entity/Employee",
"rel": "persist"
},
{
"method": "post",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/entity/Employee",
"rel": "update"
},
{
"method": "delete",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/entity/Employee/{primaryKey}",
"rel": "delete"
}
],
"queries": [
{
"queryName": "Employee.count",
"returnTypes": [
"Long"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.count",
"rel": "execute"
},
"jpql": "SELECT count(e) FROM Employee e"
},
{
"queryName": "Employee.getPhoneNumbers",
"returnTypes": [
"String",
"String",
"PhoneNumber"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.getPhoneNumbers",
"rel": "execute"
},
"jpql": "SELECT e.firstName, e.lastName, pn FROM Employee e JOIN e.phoneNumbers pn"
},
{
"queryName": "Employee.salaryMax",
"returnTypes": [
"int",
"Object"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.salaryMax",
"rel": "execute"
},
"jpql": "SELECT e.id, max(e.salary) AS max_salary from Employee e GROUP BY e.id, e.salary"
},
{
"queryName": "Employee.getManagerById",
"returnTypes": [
"String",
"String",
"Employee"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.getManagerById;id={id}",
"rel": "execute"
},
"jpql": "select u.firstName, u.lastName, u.manager from Employee u where u.id = :id"
},
{
"queryName": "Employee.findAll",
"returnTypes": [
"Employee"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.findAll",
"rel": "execute"
},
"jpql": "SELECT e FROM Employee e ORDER BY e.id"
},
{
"queryName": "Employee.getManager",
"returnTypes": [
"String",
"String",
"Employee"
],
"linkTemplate": {
"method": "get",
"href": "http://localhost:8080/eclipselink.jpars.test/persistence/v1.0/hr/query/Employee.getManager",
"rel": "execute"
},
"jpql": "select u.firstName, u.lastName, u.manager from Employee u"
}
]
}
</pre></li>
<li>
<p><code>NOT_FOUND</code> if the persistence unit is not found</p>
</li>
</ul>
</div>
<!-- class="refsect1" --></div>
<!-- class="ind" -->
<!-- Start Footer -->
<div class="footer">
<hr />
<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
<col width="33%" />
<col width="*" />
<col width="33%" />
<tr>
<td valign="bottom">
<table class="navigation simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100" align="center">
<col width="*" />
<col width="48%" />
<col width="48%" />
<tr>
<td>&nbsp;</td>
<td align="center"><a href="restful_jpa003.htm"><img src="../../dcommon/images/larrow.png" alt="Previous" border="0" height="16" width="16" /></a></td>
<td align="center"><a href="qcn.htm"><img src="../../dcommon/images/rarrow.png" alt="Next" border="0" height="16" width="16" /></a></td>
</tr>
</table>
</td>
<td align="center" width="34%"><a href="http://www.eclipse.org/eclipselink/" title="EclipseLink home"><img src="../../dcommon/images/ellogo.png" alt="EclipseLink" width="150" border="0" /></a><br />
<font size="-2">Copyright&nbsp;&copy;&nbsp;2014,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</font> <a href="../../dcommon/html/cpyr.htm"><br />
<td valign="bottom" align="right">
<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="225">
<tr>
<td>&nbsp;</td>
<td align="center" valign="top"><a href="toc.htm"><img src="../../dcommon/images/contents.png" alt="Go To Table Of Contents" border="0" height="16" width="16" /><br />
</td><td>&nbsp;</td><td align="center"><a href="../../" target="_top" class="external text" title="Search" rel="nofollow"><img src="../../dcommon/images/search.png" alt="Search" style="border:0;" /><br /><span class="mini"></span></a></td><td>&nbsp;</td><td align="center"><a href="../eclipselink_otlcg.pdf" title="PDF" target="_blank"><img src="../../dcommon/images/pdf_icon.png" style="padding-right:5px;border:0" alt="PDF"></a></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- class="footer" -->
<div id="copyright">Copyright &copy; 2014 by The Eclipse Foundation under the <a href="http://www.eclipse.org/org/documents/epl-v10.php">Eclipse Public License (EPL)</a><br /> <script type="text/javascript">var LastUpdated = document.lastModified;document.writeln ("Updated: " + LastUpdated);</script> </div><!-- START: Analytics --><script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1608008-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script><!-- END: Analytics --><!-- START: Sharethis --><script>var options={ "publisher": "e2fe9e07-fab6-4f84-83ea-0991b429842c", "position": "right", "ad": { "visible": false, "openDelay": 5, "closeDelay": 0}};var st_hover_widget = new sharethis.widgets.hoverbuttons(options);</script><!-- END: Sharethis --></body>
</html>