INT-3029 JPA: Support Iterables for Persist/Merge

* Add test cases
* Add documentation

Jira: https://jira.springsource.org/browse/INT-3029

INT-3029 Update copyright year

Doc Polishing
This commit is contained in:
Gunnar Hillert
2013-09-17 10:52:05 -04:00
committed by Gary Russell
parent 772a01be79
commit bbf93e1385
8 changed files with 386 additions and 11 deletions

View File

@@ -634,6 +634,19 @@
them to <emphasis>PERSIST</emphasis>,<emphasis>MERGE</emphasis> or <emphasis>DELETE</emphasis>
it from the underlying data source.
</para>
<note>
<para>
As of <emphasis>Spring Integration 3.0</emphasis>,
payloads to <emphasis>persist</emphasis> or
<emphasis>merge</emphasis> can also be of type
<interfacename><ulink url="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html">java.lang.Iterable</ulink></interfacename>.
In that case, each object returned by the
<interfacename>Iterable</interfacename> is treated as
an entity and persisted or merged using the underlying
<interfacename>EntityManager</interfacename>.
<emphasis>NULL</emphasis> values returned by the iterator are ignored.
</para>
</note>
</section>
<section>
<title>Using JPA Query Language (JPA QL)</title>
@@ -893,10 +906,23 @@ public class Student {
</callout>
<callout arearefs="outAdaptPersistMode">
<para>
Accepts one of the <emphasis>PERSIST</emphasis>,<emphasis>MERGE</emphasis> or <emphasis>DELETE</emphasis>. Indicates the operation that the adapter needs to perform.
Accepts one of the following: <emphasis>PERSIST</emphasis>,
<emphasis>MERGE</emphasis> or <emphasis>DELETE</emphasis>.
Indicates the operation that the adapter needs to perform.
Relevant only if an entity is being used for JPA operations.
Ignored if JPA QL, named query or native query is provided. Defaults to <emphasis>MERGE</emphasis>. <emphasis>Optional</emphasis>.
</para>
<para>
As of <emphasis role="bold">Spring Integration 3.0</emphasis>,
payloads to <emphasis>persist</emphasis> or
<emphasis>merge</emphasis> can also be of type
<interfacename><ulink url="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html">java.lang.Iterable</ulink></interfacename>.
In that case, each object returned by the
<interfacename>Iterable</interfacename> is treated as
an entity and persisted or merged using the underlying
<interfacename>EntityManager</interfacename>.
<emphasis>NULL</emphasis> values returned by the iterator are ignored.
</para>
</callout>
<callout arearefs="outAdaptUserPayloadAsParamSrc">
<para>

View File

@@ -194,6 +194,21 @@
please see <xref linkend="jdbc-message-store-generic"/>.
</para>
</section>
<section id="3.0-jpa-persist-merge-collections">
<title>JPA Support Improvements</title>
<para>
Payloads to <emphasis>persist</emphasis> or
<emphasis>merge</emphasis> can now be of type
<interfacename><ulink url="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html">java.lang.Iterable</ulink></interfacename>.
</para>
<para>
In that case, each object returned by the
<interfacename>Iterable</interfacename> is treated as
an entity and persisted or merged using the underlying
<interfacename>EntityManager</interfacename>.
<emphasis>NULL</emphasis> values returned by the iterator are ignored.
</para>
</section>
<section id="3.0-json-transformers">
<title>Jackson Support (JSON)</title>
<para>