Package org.hibernate.ogm.datastore.map.impl

Examples of org.hibernate.ogm.datastore.map.impl.MapTupleSnapshot


    }
  }

  @SuppressWarnings("unchecked")
  private Tuple createTuple(final Element element) {
    return new Tuple( new MapTupleSnapshot( (Map<String, Object>) element.getObjectValue() ) );
  }
View Full Code Here


  public Tuple createTuple(EntityKey key, TupleContext tupleContext) {
    final Cache<SerializableEntityKey> entityCache = datastoreProvider.getEntityCache();
    final HashMap<String, Object> tuple = new HashMap<String, Object>();
    entityCache.put( new Element( new SerializableEntityKey( key ), tuple ) );

    return new Tuple( new MapTupleSnapshot( tuple ) );
  }
View Full Code Here

  public Tuple next() {
    return convert( iterator.next() );
  }

  protected Tuple convert(Map<String, Object> next) {
    return new Tuple( new MapTupleSnapshot( next ) );
  }
View Full Code Here

  }

  @Override
  public Tuple get(RowKey column) {
    Map<String, Object> rawResult = associationMap.get( new SerializableRowKey( column ) );
    return rawResult != null ? new Tuple( new MapTupleSnapshot( rawResult ) ) : null;
  }
View Full Code Here

    return new MongoDBResultsCursor( cursor, entityKeyMetadata );
  }

  private ClosableIterator<Tuple> doCount(MongoDBQueryDescriptor query, DBCollection collection) {
    long count = collection.count( query.getCriteria() );
    MapTupleSnapshot snapshot = new MapTupleSnapshot( Collections.<String, Object>singletonMap( "n", count ) );
    return CollectionHelper.newClosableIterator( Collections.singletonList( new Tuple( snapshot ) ) );
  }
View Full Code Here

    session.clear();

    transaction = session.beginTransaction();
    EntityKey key = new EntityKey( new EntityKeyMetadata( "Feeling", new String[] { "UUID" } ), new Object[] { feeling.getUUID() } );
    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();
View Full Code Here

    Map<String, Object> entityMap = provider.getEntityTuple( key );
    if ( entityMap == null ) {
      return null;
    }
    else {
      return new Tuple( new MapTupleSnapshot( entityMap ) );
    }
  }
View Full Code Here

  @Override
  public Tuple createTuple(EntityKey key, TupleContext tupleContext) {
    HashMap<String,Object> tuple = new HashMap<String,Object>();
    provider.putEntity( key, tuple );
    return new Tuple( new MapTupleSnapshot( tuple ) );
  }
View Full Code Here

  public void forEachTuple(Consumer consumer, EntityKeyMetadata... metadatas) {
    Map<EntityKey, Map<String, Object>> entityMap = provider.getEntityMap();
    for ( EntityKey key : entityMap.keySet() ) {
      for ( EntityKeyMetadata metadata : metadatas ) {
        if ( key.getTable().equals( metadata.getTable() ) ) {
          consumer.consume( new Tuple( new MapTupleSnapshot( entityMap.get( key ) ) ) );
        }
      }
    }
  }
View Full Code Here

  public Tuple next() {
    return convert( iterator.next() );
  }

  protected Tuple convert(Map<String, Object> next) {
    return new Tuple( new MapTupleSnapshot( next ) );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.datastore.map.impl.MapTupleSnapshot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.