You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/03/15 09:17:13 UTC
isis-site git commit: ISIS-1228: add
RepositoryService#instantiate(...) as a convenience method.
Repository: isis-site
Updated Branches:
refs/heads/asf-site bb938424c -> c8929a078
ISIS-1228: add RepositoryService#instantiate(...) as a convenience method.
Also refactor the simpleapp to use the new services.
Project: http://git-wip-us.apache.org/repos/asf/isis-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis-site/commit/c8929a07
Tree: http://git-wip-us.apache.org/repos/asf/isis-site/tree/c8929a07
Diff: http://git-wip-us.apache.org/repos/asf/isis-site/diff/c8929a07
Branch: refs/heads/asf-site
Commit: c8929a0789a893e81923c2d349c3fa62977d7834
Parents: bb93842
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Mar 15 08:15:58 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Mar 15 08:15:58 2016 +0000
----------------------------------------------------------------------
content/guides/rgant.html | 2 +-
content/guides/rgsvc.html | 46 +++++++++++++++++++++++++-----------------
2 files changed, 28 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis-site/blob/c8929a07/content/guides/rgant.html
----------------------------------------------------------------------
diff --git a/content/guides/rgant.html b/content/guides/rgant.html
index 33889b6..e827817 100644
--- a/content/guides/rgant.html
+++ b/content/guides/rgant.html
@@ -7528,7 +7528,7 @@ discovered automatically on the CLASSPATH.</p>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_rgant-DomainService_repositoryFor"><code>repositoryFor()</code></a></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><div><div class="paragraph">
-<p>if this domain service acts as a repository for an entity type, specify that entity type. (This is currently informational only)</p>
+<p>if this domain service acts as a repository for an entity type, specify that entity type. This is used to determine an icon to use for the service (eg as shown in action prompts).</p>
</div></div></td>
</tr>
<tr>
http://git-wip-us.apache.org/repos/asf/isis-site/blob/c8929a07/content/guides/rgsvc.html
----------------------------------------------------------------------
diff --git a/content/guides/rgsvc.html b/content/guides/rgsvc.html
index 41fc454..d9886af 100644
--- a/content/guides/rgsvc.html
+++ b/content/guides/rgsvc.html
@@ -9277,20 +9277,22 @@ in the <a href="#_rgsvc_intro_overriding-the-services">introduction</a> to this
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="type">interface</span> <span class="class">RepositoryService</span> {
- <span class="type">boolean</span> isPersistent(<span class="predefined-type">Object</span> domainObject); <i class="conum" data-value="1"></i><b>(1)</b>
- <span class="type">void</span> persist(<span class="predefined-type">Object</span> domainObject); <i class="conum" data-value="2"></i><b>(2)</b>
- <span class="type">void</span> remove(<span class="predefined-type">Object</span> persistentDomainObject); <i class="conum" data-value="3"></i><b>(3)</b>
+ <T> T instantiate(<span class="directive">final</span> <span class="predefined-type">Class</span><T> ofType); <i class="conum" data-value="1"></i><b>(1)</b>
- <T> <span class="predefined-type">List</span><T> allInstances(<span class="predefined-type">Class</span><T> ofType, <span class="type">long</span>... range); <i class="conum" data-value="4"></i><b>(4)</b>
+ <span class="type">boolean</span> isPersistent(<span class="predefined-type">Object</span> domainObject); <i class="conum" data-value="2"></i><b>(2)</b>
+ <span class="type">void</span> persist(<span class="predefined-type">Object</span> domainObject); <i class="conum" data-value="3"></i><b>(3)</b>
+ <span class="type">void</span> remove(<span class="predefined-type">Object</span> persistentDomainObject); <i class="conum" data-value="4"></i><b>(4)</b>
- <T> <span class="predefined-type">List</span><T> allMatches(<span class="predefined-type">Query</span><T> query); <i class="conum" data-value="5"></i><b>(5)</b>
- <T> <span class="predefined-type">List</span><T> allMatches(<span class="predefined-type">Class</span><T> ofType, <span class="predefined-type">Predicate</span><? <span class="local-variable">super</span> T> predicate, <span class="type">long</span>... range); <i class="conum" data-value="6"></i><b>(6)</b>
+ <T> <span class="predefined-type">List</span><T> allInstances(<span class="predefined-type">Class</span><T> ofType, <span class="type">long</span>... range); <i class="conum" data-value="5"></i><b>(5)</b>
- <T> T uniqueMatch(<span class="predefined-type">Query</span><T> query); <i class="conum" data-value="7"></i><b>(7)</b>
- <T> T uniqueMatch(<span class="directive">final</span> <span class="predefined-type">Class</span><T> ofType, <span class="directive">final</span> <span class="predefined-type">Predicate</span><T> predicate); <i class="conum" data-value="8"></i><b>(8)</b>
+ <T> <span class="predefined-type">List</span><T> allMatches(<span class="predefined-type">Query</span><T> query); <i class="conum" data-value="6"></i><b>(6)</b>
+ <T> <span class="predefined-type">List</span><T> allMatches(<span class="predefined-type">Class</span><T> ofType, <span class="predefined-type">Predicate</span><? <span class="local-variable">super</span> T> predicate, <span class="type">long</span>... range); <i class="conum" data-value="7"></i><b>(7)</b>
- <T> T firstMatch(<span class="predefined-type">Query</span><T> query); <i class="conum" data-value="9"></i><b>(9)</b>
- <T> T firstMatch(<span class="directive">final</span> <span class="predefined-type">Class</span><T> ofType, <span class="directive">final</span> <span class="predefined-type">Predicate</span><T> predicate); <i class="conum" data-value="10"></i><b>(10)</b>
+ <T> T uniqueMatch(<span class="predefined-type">Query</span><T> query); <i class="conum" data-value="8"></i><b>(8)</b>
+ <T> T uniqueMatch(<span class="directive">final</span> <span class="predefined-type">Class</span><T> ofType, <span class="directive">final</span> <span class="predefined-type">Predicate</span><T> predicate); <i class="conum" data-value="9"></i><b>(9)</b>
+
+ <T> T firstMatch(<span class="predefined-type">Query</span><T> query); <i class="conum" data-value="10"></i><b>(10)</b>
+ <T> T firstMatch(<span class="directive">final</span> <span class="predefined-type">Class</span><T> ofType, <span class="directive">final</span> <span class="predefined-type">Predicate</span><T> predicate); <i class="conum" data-value="11"></i><b>(11)</b>
}</code></pre>
</div>
@@ -9299,42 +9301,48 @@ in the <a href="#_rgsvc_intro_overriding-the-services">introduction</a> to this
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
-<td>test whether a particular domain object is persistent or not</td>
+<td>create a new non-persisted domain entity. This is identical to
+<a href="#_rgsvc_api_FactoryService"><code>FactoryService</code></a>'s <code>instantiate(…​)</code> method, but is provided in the
+<code>RepositoryService</code>'s API too because instantiating and persisting objects are often done together.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
-<td>persist (ie save) an object to the persistent object store (or do nothing if it is already persistent).</td>
+<td>test whether a particular domain object is persistent or not</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
-<td>remove (ie delete) an object from the persistent object store (or do nothing if it has already been deleted).</td>
+<td>persist (ie save) an object to the persistent object store (or do nothing if it is already persistent).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
-<td>return all persisted instances of specified type. Mostly for prototyping, though can be useful to obtain all instances of domain entities if the number is known to be small. The optional varargs parameters are for paging control; more on this below.</td>
+<td>remove (ie delete) an object from the persistent object store (or do nothing if it has already been deleted).</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
-<td>all persistence instances matching the specified <code>Query</code>. Query itself is an Isis abstraction on top of JDO/DataNucleus' Query API. <strong>This is the primary API used for querying</strong></td>
+<td>return all persisted instances of specified type. Mostly for prototyping, though can be useful to obtain all instances of domain entities if the number is known to be small. The optional varargs parameters are for paging control; more on this below.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
-<td>As the previous, but with client-side filtering using a <code>Predicate</code>. Only really intended for prototyping.</td>
+<td>all persistence instances matching the specified <code>Query</code>. Query itself is an Isis abstraction on top of JDO/DataNucleus' Query API. <strong>This is the primary API used for querying</strong></td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
-<td>Returns the first instance that matches the supplied query. If no instance is found then `null `will be returned, while if there is more that one instances a run-time exception will be thrown. Generally this method is preferred for looking up an object by its (primary or alternate) key.</td>
+<td>As the previous, but with client-side filtering using a <code>Predicate</code>. Only really intended for prototyping.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
-<td>As the previous, but with client-side filtering using a <code>Predicate</code>. Only really intended for prototyping.</td>
+<td>Returns the first instance that matches the supplied query. If no instance is found then `null `will be returned, while if there is more that one instances a run-time exception will be thrown. Generally this method is preferred for looking up an object by its (primary or alternate) key.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
-<td>Returns the first instance that matches the supplied query. If no instance is found then <code>null `will be returned. No exception is thrown if more than one matches, so this is less strict that `uniqueMatch(…​)</code>.</td>
+<td>As the previous, but with client-side filtering using a <code>Predicate</code>. Only really intended for prototyping.</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
+<td>Returns the first instance that matches the supplied query. If no instance is found then <code>null `will be returned. No exception is thrown if more than one matches, so this is less strict that `uniqueMatch(…​)</code>.</td>
+</tr>
+<tr>
+<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>As the previous, but with client-side filtering using a <code>Predicate</code>. Only really intended for prototyping.</td>
</tr>
</table>