private ServiceRegistryImplementor serviceRegistry(SessionImplementor session) {
return session.getFactory().getServiceRegistry();
}
private <T> T entity(SessionImplementor session, Tuple tuple, OgmLoader loader) {
OgmLoadingContext ogmLoadingContext = new OgmLoadingContext();
ogmLoadingContext.setTuples( Arrays.asList( tuple ) );
@SuppressWarnings("unchecked")
List<T> entities = (List<T>) loader.loadEntities( session, LockOptions.NONE, ogmLoadingContext );
return entities.get( 0 );
}