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

Examples of org.hibernate.ogm.datastore.mongodb.query.parsing.nativequery.impl.NativeQueryParser

@author Gunnar Morling

      query = (MongoDBQueryDescriptor) customQuery.getQueryObject();
    }
    // a string-based native query; need to create the DBObject from that
    else {
      // TODO OGM-414 This should actually be cached in the native query plan
      NativeQueryParser parser = Parboiled.createParser( NativeQueryParser.class );
      ParsingResult<MongoDBQueryDescriptorBuilder> parseResult =  new RecoveringParseRunner<MongoDBQueryDescriptorBuilder>( parser.Query() ).run( customQuery.getQueryString() );
      if (parseResult.hasErrors() ) {
        throw new IllegalArgumentException( "Unsupported native query: " + ErrorUtils.printParseErrors( parseResult.parseErrors ) );
      }

      query = parseResult.resultValue.build();
View Full Code Here


    }
  }

  @Override
  public MongoDBQueryDescriptor parseNativeQuery(String nativeQuery) {
    NativeQueryParser parser = Parboiled.createParser( NativeQueryParser.class );
    ParsingResult<MongoDBQueryDescriptorBuilder> parseResult = new RecoveringParseRunner<MongoDBQueryDescriptorBuilder>( parser.Query() )
        .run( nativeQuery );
    if (parseResult.hasErrors() ) {
      throw new IllegalArgumentException( "Unsupported native query: " + ErrorUtils.printParseErrors( parseResult.parseErrors ) );
    }
View Full Code Here

      query = (MongoDBQueryDescriptor) customQuery.getQueryObject();
    }
    // a string-based native query; need to create the DBObject from that
    else {
      // TODO OGM-414 This should actually be cached in the native query plan
      NativeQueryParser parser = Parboiled.createParser( NativeQueryParser.class );
      ParsingResult<MongoDBQueryDescriptorBuilder> parseResult =  new RecoveringParseRunner<MongoDBQueryDescriptorBuilder>( parser.Query() ).run( customQuery.getQueryString() );
      if (parseResult.hasErrors() ) {
        throw new IllegalArgumentException( "Unsupported native query: " + ErrorUtils.printParseErrors( parseResult.parseErrors ) );
      }

      query = parseResult.resultValue.build();
View Full Code Here

    }
  }

  @Override
  public MongoDBQueryDescriptor parseNativeQuery(String nativeQuery) {
    NativeQueryParser parser = Parboiled.createParser( NativeQueryParser.class );
    ParsingResult<MongoDBQueryDescriptorBuilder> parseResult = new RecoveringParseRunner<MongoDBQueryDescriptorBuilder>( parser.Query() )
        .run( nativeQuery );
    if (parseResult.hasErrors() ) {
      throw new IllegalArgumentException( "Unsupported native query: " + ErrorUtils.printParseErrors( parseResult.parseErrors ) );
    }
View Full Code Here

TOP

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

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.