本文整理汇总了Java中org.hibernate.collection.spi.PersistentCollection.getKey方法的典型用法代码示例。如果您正苦于以下问题:Java PersistentCollection.getKey方法的具体用法?Java PersistentCollection.getKey怎么用?Java PersistentCollection.getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.collection.spi.PersistentCollection
的用法示例。
在下文中一共展示了PersistentCollection.getKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CollectionEntry
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
/**
* For initialized detached collections
*/
public CollectionEntry(PersistentCollection collection, SessionFactoryImplementor factory) throws MappingException {
// detached collections that get found + reattached
// during flush shouldn't be ignored
ignore = false;
loadedKey = collection.getKey();
setLoadedPersister( factory.getCollectionPersister( collection.getRole() ) );
snapshot = collection.getStoredSnapshot();
}
示例2: preFlush
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
public void preFlush(PersistentCollection collection) throws HibernateException {
if ( loadedKey == null && collection.getKey() != null ) {
loadedKey = collection.getKey();
}
boolean nonMutableChange = collection.isDirty() &&
getLoadedPersister()!=null &&
!getLoadedPersister().isMutable();
if (nonMutableChange) {
throw new HibernateException(
"changed an immutable collection instance: " +
MessageHelper.collectionInfoString( getLoadedPersister().getRole(), getLoadedKey() )
);
}
dirty(collection);
if ( LOG.isDebugEnabled() && collection.isDirty() && getLoadedPersister() != null ) {
LOG.debugf( "Collection dirty: %s",
MessageHelper.collectionInfoString( getLoadedPersister().getRole(), getLoadedKey() ) );
}
setDoupdate(false);
setDoremove(false);
setDorecreate(false);
setReached(false);
setProcessed(false);
}
示例3: addUninitializedDetachedCollection
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
@Override
public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) {
final CollectionEntry ce = new CollectionEntry( persister, collection.getKey() );
addCollection( collection, ce, collection.getKey() );
if ( persister.getBatchSize() > 1 ) {
getBatchFetchQueue().addBatchLoadableCollection( collection, ce );
}
}
示例4: isCollectionSnapshotValid
import org.hibernate.collection.spi.PersistentCollection; //导入方法依赖的package包/类
private static boolean isCollectionSnapshotValid(PersistentCollection snapshot) {
return snapshot != null &&
snapshot.getRole() != null &&
snapshot.getKey() != null;
}