@Override
public Tuple getTuple(EntityKey key, TupleContext tupleContext) {
DBObject found = this.getObject( key, tupleContext );
if ( found != null ) {
return new Tuple( new MongoDBTupleSnapshot( found, key, UPDATE ) );
}
else if ( isInTheQueue( key, tupleContext ) ) {
// The key has not been inserted in the db but it is in the queue
return new Tuple( new MongoDBTupleSnapshot( prepareIdObject( key ), key, INSERT ) );
}
else {
return null;
}
}