public class JpaMergeSupport extends Object
Constructor and Description |
---|
JpaMergeSupport()
Constructs the object.
|
Modifier and Type | Method and Description |
---|---|
static void |
merge(Object aMerged,
Object aPersistent)
As
#merge(Persistent) but with a given template. |
static void |
processList(List aMerged,
List aPersistent,
List<ObjectElem> aProcessed)
Process the persistent objects in the collections.
|
static <Key,Value> |
processMap(Map<Key,Value> aMerged,
Map<Key,Value> aPersistent,
List<ObjectElem> aProcessed)
Process the Map objects in the collections.
|
static void |
processPersistent(Object aMerged,
Object aPersistent,
List<ObjectElem> aProcessed)
Copies primary keys and version from the result of the merged to the
object that was passed to the merge operation.
|
static void |
processSet(Set aMerged,
Set aPersistent,
List<ObjectElem> aProcessed)
Process the persistent objects in sets.
|
public static void merge(Object aMerged, Object aPersistent)
#merge(Persistent)
but with a given template. This method can
be accessed in a static way.aMerge
- The result of the call to EntityManager.merge(Object)
.aPersistent
- Object that was passed to EntityManager.merge(Object)
.public static void processPersistent(Object aMerged, Object aPersistent, List<ObjectElem> aProcessed)
Persistent
and applies the
same rules to objects in maps and sets as well (i.e. recursively).aPersistent
- Object whose primary key and version are to be set.aMerged
- Object that was the result of the merge.aProcessed
- List of already processed Persistent objects of the persistent
part.public static void processList(List aMerged, List aPersistent, List<ObjectElem> aProcessed)
aPersistent
- Collection in the original object.aMerged
- Collection as a result of the merge.aProcessed
- List of processed persistent objects.public static void processSet(Set aMerged, Set aPersistent, List<ObjectElem> aProcessed)
aPersistent
- Collection in the original object.aMerged
- Collection as a result of the merge.aProcessed
- List of processed persistent objects.public static <Key,Value> void processMap(Map<Key,Value> aMerged, Map<Key,Value> aPersistent, List<ObjectElem> aProcessed)
aPersistent
- Collection in the original object.aMerged
- Collection as a result of the merge.aProcessed
- List of processed persistent objects.Copyright © 2024. All rights reserved.