private < T > QueryRequest < T > query ( String fql , JavaType type ) { this . checkForBatchExecution ( ) ; if ( this . multiqueryRequest == null ) { this . multiqueryRequest = new MultiqueryRequest ( mapper , this . createUnmappedChain ( ) ) ; this . graphRequests . add ( this . multiqueryRequest ) ; } // There is a circular reference between the extractor and request, so construction of the chain // is a little complicated QueryNodeExtractor extractor = new QueryNodeExtractor ( this . multiqueryRequest ) ; String name = "__q" + this . generatedQueryNameIndex ++ ; QueryRequest < T > q = new QueryRequest < T > ( fql , name , new MapperWrapper < T > ( type , this . mapper , extractor ) ) ; extractor . setRequest ( q ) ; this . multiqueryRequest . addQuery ( q ) ; return q ; }
Implementation now that we have chosen a Jackson JavaType for the return value