本文整理汇总了Java中org.hibernate.collection.spi.PersistentCollection.setSnapshot方法的典型用法代码示例。如果您正苦于以下问题:Java PersistentCollection.setSnapshot方法的具体用法?Java PersistentCollection.setSnapshot怎么用?Java PersistentCollection.setSnapshot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.collection.spi.PersistentCollection
的用法示例。
在下文中一共展示了PersistentCollection.setSnapshot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CollectionEntry
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
/**
* For collections just loaded from the database
*/
public CollectionEntry(
final PersistentCollection collection,
final CollectionPersister loadedPersister,
final Serializable loadedKey,
final boolean ignore
) {
this.ignore=ignore;
//collection.clearDirty()
this.loadedKey = loadedKey;
setLoadedPersister(loadedPersister);
collection.setSnapshot(loadedKey, role, null);
//postInitialize() will be called after initialization
}
示例2: postInitialize
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
public void postInitialize(PersistentCollection collection) throws HibernateException {
snapshot = getLoadedPersister().isMutable() ?
collection.getSnapshot( getLoadedPersister() ) :
null;
collection.setSnapshot(loadedKey, role, snapshot);
if (getLoadedPersister().getBatchSize() > 1) {
((AbstractPersistentCollection) collection).getSession().getPersistenceContext().getBatchFetchQueue().removeBatchLoadableCollection(this);
}
}
示例3: postFlush
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
/**
* Called after a successful flush
*/
public void postFlush(PersistentCollection collection) throws HibernateException {
if ( isIgnore() ) {
ignore = false;
}
else if ( !isProcessed() ) {
throw new AssertionFailure( "collection [" + collection.getRole() + "] was not processed by flush()" );
}
collection.setSnapshot(loadedKey, role, snapshot);
}
示例4: resetStoredSnapshot
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
/**
* Reset the stored snapshot for both the persistent collection and this collection entry.
* Used during the merge of detached collections.
*
* @param collection the persistentcollection to be updated
* @param storedSnapshot the new stored snapshot
*/
public void resetStoredSnapshot(PersistentCollection collection, Serializable storedSnapshot) {
LOG.debugf("Reset storedSnapshot to %s for %s", storedSnapshot, this);
if ( fromMerge ) {
return; // EARLY EXIT!
}
snapshot = storedSnapshot;
collection.setSnapshot( loadedKey, role, snapshot );
fromMerge = true;
}