本文整理了Java中org.hibernate.ogm.model.spi.Association.reset()
方法的一些代码示例,展示了Association.reset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Association.reset()
方法的具体详情如下:
包路径:org.hibernate.ogm.model.spi.Association
类名称:Association
方法名:reset
[英]Reset the association to the datastore state.
[中]将关联重置为数据存储状态。
代码示例来源:origin: hibernate/hibernate-ogm
public static void updateAssociation(Association association) {
Map<RowKey, Map<String, Object>> underlyingMap = ( (MapAssociationSnapshot) association.getSnapshot() ).getUnderlyingMap();
for ( AssociationOperation action : association.getOperations() ) {
switch ( action.getType() ) {
case CLEAR:
underlyingMap.clear();
break;
case PUT:
underlyingMap.put( action.getKey(), MapHelpers.associationRowToMap( action.getValue() ) );
break;
case REMOVE:
underlyingMap.remove( action.getKey() );
break;
}
}
// the snapshot has been updated so we have to clear the various operations added to the Association
association.reset();
}
代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-infinispan-remote
private void insertOrUpdateAssociation(InsertOrUpdateAssociationOperation insertOrUpdateAssociationOperation) {
AssociationKey associationKey = insertOrUpdateAssociationOperation.getAssociationKey();
org.hibernate.ogm.model.spi.Association association = insertOrUpdateAssociationOperation.getAssociation();
AssociationContext associationContext = insertOrUpdateAssociationOperation.getContext();
if ( !associationStoredWithinEntityEntry( associationKey, associationContext ) ) {
insertOrUpdateAssociationMappedAsDedicatedEntries( associationKey, association, associationContext );
}
association.reset();
}
代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-ehcache
@Override
public void insertOrUpdateAssociation(AssociationKey key, Association association, AssociationContext associationContext) {
Map<SerializableRowKey, Map<String, Object>> associationRows = ( (SerializableMapAssociationSnapshot) association.getSnapshot() ).getUnderlyingMap();
for ( AssociationOperation action : association.getOperations() ) {
switch ( action.getType() ) {
case CLEAR:
associationRows.clear();
break;
case PUT:
associationRows.put( new SerializableRowKey( action.getKey() ), MapHelpers.associationRowToMap( action.getValue() ) );
break;
case REMOVE:
associationRows.remove( new SerializableRowKey( action.getKey() ) );
break;
}
}
association.reset();
final Cache<AK> associationCache = getCacheManager().getAssociationCache( key.getMetadata() );
associationCache.put( new Element( getKeyProvider().getAssociationCacheKey( key ), associationRows ) );
}
内容来源于网络,如有侵权,请联系作者删除!