Methods Summary |
---|
private static boolean | isCollectionSnapshotValid(org.hibernate.collection.PersistentCollection snapshot)
return snapshot != null &&
snapshot.getRole() != null &&
snapshot.getKey() != null;
|
protected static boolean | isOwnerUnchanged(org.hibernate.collection.PersistentCollection snapshot, org.hibernate.persister.collection.CollectionPersister persister, java.io.Serializable id)Has the owner of the collection changed since the collection
was snapshotted and detached?
return isCollectionSnapshotValid(snapshot) &&
persister.getRole().equals( snapshot.getRole() ) &&
id.equals( snapshot.getKey() );
|
java.lang.Object | processEntity(java.lang.Object value, org.hibernate.type.EntityType entityType)
if (value!=null) {
getSession().getPersistenceContext().reassociateIfUninitializedProxy(value);
// if it is an initialized proxy, let cascade
// handle it later on
}
return null;
|
protected void | reattachCollection(org.hibernate.collection.PersistentCollection collection, org.hibernate.type.CollectionType type)Reattach a detached (disassociated) initialized or uninitialized
collection wrapper, using a snapshot carried with the collection
wrapper
if ( collection.wasInitialized() ) {
CollectionPersister collectionPersister = getSession().getFactory()
.getCollectionPersister( type.getRole() );
getSession().getPersistenceContext()
.addInitializedDetachedCollection( collectionPersister, collection );
}
else {
if ( !isCollectionSnapshotValid(collection) ) {
throw new HibernateException( "could not reassociate uninitialized transient collection" );
}
CollectionPersister collectionPersister = getSession().getFactory()
.getCollectionPersister( collection.getRole() );
getSession().getPersistenceContext()
.addUninitializedDetachedCollection( collectionPersister, collection );
}
|