Package org.hibernate.ogm.datastore.spi

Examples of org.hibernate.ogm.datastore.spi.Tuple


  public void forEachTuple(Consumer consumer, EntityKeyMetadata... entityKeyMetadatas) {
    DB db = provider.getDatabase();
    for ( EntityKeyMetadata entityKeyMetadata : entityKeyMetadatas ) {
      DBCollection collection = db.getCollection( entityKeyMetadata.getTable() );
      for ( DBObject dbObject : collection.find() ) {
        consumer.consume( new Tuple( new MassIndexingMongoDBTupleSnapshot( dbObject, entityKeyMetadata ) ) );
      }
    }
  }
View Full Code Here


  }

  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

    }
  }

  private void executeBatchUpdate(Map<DBCollection, BatchInsertionTask> inserts, UpdateTupleOperation tupleOperation) {
    EntityKey entityKey = tupleOperation.getEntityKey();
    Tuple tuple = tupleOperation.getTuple();
    MongoDBTupleSnapshot snapshot = (MongoDBTupleSnapshot) tupleOperation.getTuple().getSnapshot();
    WriteConcern writeConcern = getWriteConcern( tupleOperation.getTupleContext() );

    if ( INSERT == snapshot.getOperationType() && columnNamesAllowBatchInsert( tupleOperation ) ) {
      prepareForInsert( inserts, snapshot, entityKey, tuple, writeConcern );
View Full Code Here

    }

    @Override
    public Tuple next() {
      DBObject dbObject = cursor.next();
      return new Tuple( new MassIndexingMongoDBTupleSnapshot( dbObject, metadata ) );
    }
View Full Code Here

    FineGrainedAtomicMap<String, Object> atomicMap = AtomicMapLookup.getFineGrainedAtomicMap( cache, key, false );
    if ( atomicMap == null ) {
      return null;
    }
    else {
      return new Tuple( new InfinispanTupleSnapshot( atomicMap ) );
    }
  }
View Full Code Here

  public Tuple createTuple(EntityKey key) {
    //TODO we don't verify that it does not yet exist assuming that this has been done before by the calling code
    //should we improve?
    Cache<EntityKey, Map<String, Object>> cache = provider.getCache(ENTITY_STORE);
    FineGrainedAtomicMap<String,Object> atomicMap =  AtomicMapLookup.getFineGrainedAtomicMap( cache, key, true );
    return new Tuple( new InfinispanTupleSnapshot( atomicMap ) );
  }
View Full Code Here

    AtomicMapLookup.removeAtomicMap( cache, key );
  }

  @Override
  public Tuple createTupleAssociation(AssociationKey associationKey, RowKey rowKey) {
    return new Tuple( EmptyTupleSnapshot.SINGLETON );
  }
View Full Code Here

  @Override
  public Tuple get(RowKey rowKey) {
    for ( Relationship relationship : relationships() ) {
      if ( matches( rowKey, relationship ) ) {
        return new Tuple( new Neo4jTupleSnapshot( relationship.getEndNode() ) );
      }
    }
    return null;
  }
View Full Code Here

    }
    return createTuple( entityNode );
  }

  private Tuple createTuple(Node entityNode) {
    return new Tuple( new Neo4jTupleSnapshot( entityNode ) );
  }
View Full Code Here

    return new Tuple( new Neo4jTupleSnapshot( entityNode ) );
  }

  @Override
  public Tuple createTuple(EntityKey key) {
    return new Tuple();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.datastore.spi.Tuple

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.