public class HibernateSupport
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
org.springframework.orm.hibernate.support.HibernateDaoSupport
.Constructor and Description |
---|
HibernateSupport()
Constructs the object.
|
Modifier and Type | Method and Description |
---|---|
static void |
merge(org.springframework.orm.hibernate3.HibernateTemplate aTemplate,
Persistent aPersistent)
As
merge(Persistent) but with a given template. |
void |
merge(Persistent aPersistent)
Performes a hibernate
Session.merge() and updates the object
with the correct primary key and version. |
static void |
processList(List aPersistent,
List aMerged,
List<org.wamblee.persistence.hibernate.HibernateSupport.ObjectElem> aProcessed)
Process the persistent objects in the collections.
|
static <Key,Value> |
processMap(Map<Key,Value> aPersistent,
Map<Key,Value> aMerged,
List<org.wamblee.persistence.hibernate.HibernateSupport.ObjectElem> aProcessed)
Process the Map objects in the collections.
|
static void |
processPersistent(Persistent aPersistent,
Persistent aMerged,
List<org.wamblee.persistence.hibernate.HibernateSupport.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 aPersistent,
Set aMerged,
List<org.wamblee.persistence.hibernate.HibernateSupport.ObjectElem> aProcessed)
Process the persistent objects in sets.
|
public void merge(Persistent aPersistent)
Session.merge()
and updates the object
with the correct primary key and version. This is an extension to the
hibernate merge operation because hibernate itself leaves the object
passed to merge untouched. Use this method with extreme caution since it
will recursively load all objects that the current object has relations
with and for which cascade="merge" was specified in the Hibernate mapping
file.aPersistent
- Object to merge.public static void merge(org.springframework.orm.hibernate3.HibernateTemplate aTemplate, Persistent aPersistent)
merge(Persistent)
but with a given template. This method can
be accessed in a static way.aTemplate
- Hibernate templateaPersistent
- Object to merge.public static void processPersistent(Persistent aPersistent, Persistent aMerged, List<org.wamblee.persistence.hibernate.HibernateSupport.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 aPersistent, List aMerged, List<org.wamblee.persistence.hibernate.HibernateSupport.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 aPersistent, Set aMerged, List<org.wamblee.persistence.hibernate.HibernateSupport.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> aPersistent, Map<Key,Value> aMerged, List<org.wamblee.persistence.hibernate.HibernateSupport.ObjectElem> aProcessed)
aPersistent
- Collection in the original object.aMerged
- Collection as a result of the merge.aProcessed
- List of processed persistent objects.Copyright © 2022. All rights reserved.