Map<String, Object> entityTuple = extractEntityTuple( sessions, key );
final Tuple tuple = new Tuple( new MapTupleSnapshot( entityTuple ) );
EntityPersister persister = ( (SessionFactoryImplementor) session.getSessionFactory() )
.getEntityPersister( Feeling.class.getName() );
OgmLoader loader = new OgmLoader( new OgmEntityPersister[] { (OgmEntityPersister) persister } );
OgmLoadingContext ogmLoadingContext = new OgmLoadingContext();
List<Tuple> tuples = new ArrayList<Tuple>();
tuples.add( tuple );
ogmLoadingContext.setTuples( tuples );
List<Object> entities = loader.loadEntities( (SessionImplementor) session, LockOptions.NONE, ogmLoadingContext );
assertThat( entities.size() ).isEqualTo( 1 );
assertThat( ( (Feeling) entities.get( 0 ) ).getName() ).isEqualTo( "Moody" );
transaction.commit();
session.close();
}