@Test public void testBuildSimpleQuery() throws EdmException, ODataJPARuntimeException { EdmSimpleType edmType = EdmSimpleTypeKind.Int32.getEdmSimpleTypeInstance(); JPQLSelectSingleContext JPQLSelectSingleContextImpl = createSelectContext(edmType); JPQLSelectSingleStatementBuilder = new JPQLSelectSingleStatementBuilder(JPQLSelectSingleContextImpl); String query = JPQLSelectSingleStatementBuilder.build().toString(); query = query.substring(0, query.indexOf("?")); Map<String, Map<Integer,Object>> parameterizedQuery = JPQLSelectSingleContextImpl. getParameterizedQueryMap(); for (Entry<String, Map<Integer, Object>> parameter : parameterizedQuery.entrySet()) { for (Entry<Integer, Object> param : parameter.getValue().entrySet()) { query += param.getValue(); } } assertEquals("SELECT E1 FROM SalesOrderHeader E1 WHERE E1.Field1 = 1", query); }
@Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; }
JPQLSelectSingleStatementBuilder extends JPQLStatementBuilder { @Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; } }
JPQLSelectSingleStatementBuilder extends JPQLStatementBuilder { @Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; } JPQLSelectSingleStatementBuilder(final JPQLContextView context); }
JPQLSelectSingleStatementBuilder extends JPQLStatementBuilder { @Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; } JPQLSelectSingleStatementBuilder(final JPQLContextView context); @Override JPQLStatement build(); }
JPQLSelectSingleStatementBuilder extends JPQLStatementBuilder { @Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; } JPQLSelectSingleStatementBuilder(final JPQLContextView context); @Override JPQLStatement build();  }