Package org.hibernate.ogm.query

Examples of org.hibernate.ogm.query.NoSQLQuery.addScalar()


    session.close();
  }

  private void assertCountQueryResult(OgmSession session, String queryString, long expectedCount) {
    NoSQLQuery query = session.createNativeQuery( queryString );
    query.addScalar( "n" );
    long actualCount = (Long) query.list().iterator().next();
    assertThat( actualCount ).describedAs( "Count query didn't yield expected result" ).isEqualTo( expectedCount );
  }

  @Override
View Full Code Here


    session.close();
  }

  private void assertCountQueryResult(OgmSession session, String queryString, long expectedCount) {
    NoSQLQuery query = session.createNativeQuery( queryString );
    query.addScalar( "n" );
    long actualCount = (Long) query.list().iterator().next();
    assertThat( actualCount ).describedAs( "Count query didn't yield expected result" ).isEqualTo( expectedCount );
  }

  @Override
View Full Code Here

    // Register the result types of the query; Currently either a number of scalar values or an entity return
    // are supported only; JP-QL would actually a combination of both, though (see OGM-514)
    if ( result.getProjection() != null ) {
      for ( String field : result.getProjection().keySet() ) {
        query.addScalar( field );
      }
    }
    else {
      query.addEntity( result.getEntityType() );
    }
View Full Code Here

    // Register the result types of the query; Currently either a number of scalar values or an entity return
    // are supported only; JP-QL would actually a combination of both, though (see OGM-514)
    if ( result.getProjection() != null ) {
      for ( String field : result.getProjection().keySet() ) {
        query.addScalar( field );
      }
    }
    else {
      query.addEntity( result.getEntityType() );
    }
View Full Code Here

    NoSQLQuery query = new NoSQLQueryImpl( result.getQuery(), (SessionImplementor) session, new ParameterMetadata( null, null ) );
    // Register the result types of the query; Currently either a number of scalar values or an entity return
    // are supported only; JP-QL would actually a combination of both, though (see OGM-514)
    if ( hasProjections( result ) ) {
      for ( String field : result.getProjections() ) {
        query.addScalar( field );
      }
    }
    else {
      query.addEntity( result.getEntityType() );
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.