Package org.hibernate.ogm.datastore.mongodb.query.parsing.impl

Examples of org.hibernate.ogm.datastore.mongodb.query.parsing.impl.MongoDBQueryParsingResult


        "{ \"entityName\" : \"Bob\"}" );
  }

  @Test
  public void shouldCreateProjectionQuery() {
    MongoDBQueryParsingResult parsingResult = parseQuery( "select e.id, e.name, e.position from IndexedEntity e" );

    assertThat( parsingResult.getQuery().toString() ).isEqualTo( "{ }" );
    assertThat( parsingResult.getProjection().toString() ).isEqualTo( "{ \"_id\" : 1 , \"entityName\" : 1 , \"position\" : 1}" );
  }
View Full Code Here


  private void assertMongoDbQuery(String queryString, String expectedMongoDbQuery) {
    assertMongoDbQuery( queryString, null, expectedMongoDbQuery );
  }

  private void assertMongoDbQuery(String queryString, Map<String, Object> namedParameters, String expectedMongoDbQuery) {
    MongoDBQueryParsingResult parsingResult = parseQuery( queryString, namedParameters );
    assertThat( parsingResult ).isNotNull();
    assertThat( parsingResult.getEntityType() ).isSameAs( IndexedEntity.class );

    if ( expectedMongoDbQuery == null ) {
      assertThat( parsingResult.getQuery() ).isNull();
    }
    else {
      assertThat( parsingResult.getQuery() ).isNotNull();
      assertThat( parsingResult.getQuery().toString() ).isEqualTo( expectedMongoDbQuery );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.datastore.mongodb.query.parsing.impl.MongoDBQueryParsingResult

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.