Java 类org.hibernate.ogm.model.spi.TupleSnapshot 实例源码

项目:hibernate-ogm-ignite    文件:IgniteTestHelper.java   
@Override
public Map<String, Object> extractEntityTuple(Session session, EntityKey key) {
    SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor) session.getSessionFactory();
    IgniteCache<Object, BinaryObject> cache = getEntityCache( sessionFactory, key.getMetadata() );
    Object cacheKey = getProvider( sessionFactory ).createKeyObject( key );

    Map<String, Object> result = new HashMap<>();
    BinaryObject po = cache.get( cacheKey );

    TupleSnapshot snapshot = new IgniteTupleSnapshot( cacheKey, po, key.getMetadata() );
    for ( String fieldName : snapshot.getColumnNames() ) {
        result.put( fieldName, snapshot.get( fieldName ) );
    }

    return result;
}
项目:hibernate-ogm-ignite    文件:IgniteDialect.java   
@Override
TupleSnapshot createTupleSnapshot(List<?> value) {
    Map<String, Object> map = new HashMap<>();
    for ( int i = 0; i < value.size(); i++ ) {
        ScalarReturn ret = (ScalarReturn) queryReturns.get( i );
        map.put( ret.getColumnAlias(), value.get( i ) );
    }
    return new MapTupleSnapshot( map );
}
项目:hibernate-ogm-ignite    文件:IgniteEmbeddedAssociationSnapshot.java   
@Override
public Tuple get(RowKey rowKey) {
    TupleSnapshot row = rows.get( rowKey );
    return row != null ? new Tuple( row, SnapshotType.UPDATE ) : null;
}
项目:hibernate-ogm-ignite    文件:IgniteAssociationSnapshot.java   
@Override
public Tuple get(RowKey rowKey) {
    TupleSnapshot row = rows.get( rowKey );
    return row != null ? new Tuple( row, SnapshotType.UPDATE ) : null;
}
项目:hibernate-ogm-ignite    文件:IgniteDialect.java   
@Override
TupleSnapshot createTupleSnapshot(List<?> value) {
    return new IgniteTupleSnapshot( /* _KEY */ value.get( 0 ), /* _VAL */ (BinaryObject) value.get( 1 ), keyMetadata );
}
项目:hibernate-ogm-ignite    文件:IgniteDialect.java   
abstract TupleSnapshot createTupleSnapshot(T value);