@Test public void buildGetEntitySetTest() { try { JPAQueryInfo info = builder.build((GetEntitySetUriInfo) mockURIInfoWithListener(false)); assertNotNull(info.getQuery()); assertEquals(true, info.isTombstoneQuery()); } catch (ODataException e) { fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2); } }
public JPAQueryInfo build(GetEntitySetUriInfo uriInfo) throws ODataJPARuntimeException { JPAQueryInfo queryInfo = new JPAQueryInfo(); Query query = null; try { ODataJPATombstoneEntityListener listener = getODataJPATombstoneEntityListener((UriInfo) uriInfo); if (listener != null) { query = listener.getQuery(uriInfo, em); JPQLContext jpqlContext = JPQLContext.getJPQLContext(); query = getParameterizedQueryForListeners(jpqlContext, query); } if (query == null) { query = buildQuery((UriInfo) uriInfo, UriInfoType.GetEntitySet); } else { queryInfo.setTombstoneQuery(true); } } catch (Exception e) { throw ODataJPARuntimeException.throwException( ODataJPARuntimeException.ERROR_JPQL_QUERY_CREATE, e); } finally { JPQLContext.removeJPQLContext(); ODataExpressionParser.removePositionalParametersThreadLocal(); } queryInfo.setQuery(query); return queryInfo; }
JPAQueryBuilder { public JPAQueryInfo build(GetEntitySetUriInfo uriInfo) throws ODataJPARuntimeException { JPAQueryInfo queryInfo = new JPAQueryInfo(); Query query = null; try { ODataJPATombstoneEntityListener listener = getODataJPATombstoneEntityListener((UriInfo) uriInfo); if (listener != null) { query = listener.getQuery(uriInfo, em); JPQLContext jpqlContext = JPQLContext.getJPQLContext(); query = getParameterizedQueryForListeners(jpqlContext, query); } if (query == null) { query = buildQuery((UriInfo) uriInfo, UriInfoType.GetEntitySet); } else { queryInfo.setTombstoneQuery(true); } } catch (Exception e) { throw ODataJPARuntimeException.throwException( ODataJPARuntimeException.ERROR_JPQL_QUERY_CREATE, e); } finally { JPQLContext.removeJPQLContext(); ODataExpressionParser.removePositionalParametersThreadLocal(); } queryInfo.setQuery(query); return queryInfo; } }
JPAQueryBuilder { public JPAQueryInfo build(GetEntitySetUriInfo uriInfo) throws ODataJPARuntimeException { JPAQueryInfo queryInfo = new JPAQueryInfo(); Query query = null; try { ODataJPATombstoneEntityListener listener = getODataJPATombstoneEntityListener((UriInfo) uriInfo); if (listener != null) { query = listener.getQuery(uriInfo, em); JPQLContext jpqlContext = JPQLContext.getJPQLContext(); query = getParameterizedQueryForListeners(jpqlContext, query); } if (query == null) { query = buildQuery((UriInfo) uriInfo, UriInfoType.GetEntitySet); } else { queryInfo.setTombstoneQuery(true); } } catch (Exception e) { throw ODataJPARuntimeException.throwException( ODataJPARuntimeException.ERROR_JPQL_QUERY_CREATE, e); } finally { JPQLContext.removeJPQLContext(); ODataExpressionParser.removePositionalParametersThreadLocal(); } queryInfo.setQuery(query); return queryInfo; } JPAQueryBuilder(ODataJPAContext odataJPAContext); }
JPAQueryBuilder { public JPAQueryInfo build(GetEntitySetUriInfo uriInfo) throws ODataJPARuntimeException { JPAQueryInfo queryInfo = new JPAQueryInfo(); Query query = null; try { ODataJPATombstoneEntityListener listener = getODataJPATombstoneEntityListener((UriInfo) uriInfo); if (listener != null) { query = listener.getQuery(uriInfo, em); JPQLContext jpqlContext = JPQLContext.getJPQLContext(); query = getParameterizedQueryForListeners(jpqlContext, query); } if (query == null) { query = buildQuery((UriInfo) uriInfo, UriInfoType.GetEntitySet); } else { queryInfo.setTombstoneQuery(true); } } catch (Exception e) { throw ODataJPARuntimeException.throwException( ODataJPARuntimeException.ERROR_JPQL_QUERY_CREATE, e); } finally { JPQLContext.removeJPQLContext(); ODataExpressionParser.removePositionalParametersThreadLocal(); } queryInfo.setQuery(query); return queryInfo; } JPAQueryBuilder(ODataJPAContext odataJPAContext); JPAQueryInfo build(GetEntitySetUriInfo uriInfo); void getCount(GetEntitySetUriInfo uriInfo); Query build(GetEntityUriInfo uriInfo); Query build(GetEntitySetCountUriInfo uriInfo); Query build(GetEntityCountUriInfo uriInfo); Query build(DeleteUriInfo uriInfo); Query build(PutMergePatchUriInfo uriInfo); ODataJPAQueryExtensionEntityListener getODataJPAQueryEntityListener(UriInfo uriInfo); ODataJPATombstoneEntityListener getODataJPATombstoneEntityListener(UriInfo uriParserResultView); JPQLContext buildJPQLContext(JPQLContextType contextType, UriInfo uriParserResultView); JPQLContextType determineJPQLContextType(UriInfo uriParserResultView, UriInfoType type); }
JPAQueryBuilder { public JPAQueryInfo build(GetEntitySetUriInfo uriInfo) throws ODataJPARuntimeException { JPAQueryInfo queryInfo = new JPAQueryInfo(); Query query = null; try { ODataJPATombstoneEntityListener listener = getODataJPATombstoneEntityListener((UriInfo) uriInfo); if (listener != null) { query = listener.getQuery(uriInfo, em); JPQLContext jpqlContext = JPQLContext.getJPQLContext(); query = getParameterizedQueryForListeners(jpqlContext, query); } if (query == null) { query = buildQuery((UriInfo) uriInfo, UriInfoType.GetEntitySet); } else { queryInfo.setTombstoneQuery(true); } } catch (Exception e) { throw ODataJPARuntimeException.throwException( ODataJPARuntimeException.ERROR_JPQL_QUERY_CREATE, e); } finally { JPQLContext.removeJPQLContext(); ODataExpressionParser.removePositionalParametersThreadLocal(); } queryInfo.setQuery(query); return queryInfo; } JPAQueryBuilder(ODataJPAContext odataJPAContext); JPAQueryInfo build(GetEntitySetUriInfo uriInfo); void getCount(GetEntitySetUriInfo uriInfo); Query build(GetEntityUriInfo uriInfo); Query build(GetEntitySetCountUriInfo uriInfo); Query build(GetEntityCountUriInfo uriInfo); Query build(DeleteUriInfo uriInfo); Query build(PutMergePatchUriInfo uriInfo); ODataJPAQueryExtensionEntityListener getODataJPAQueryEntityListener(UriInfo uriInfo); ODataJPATombstoneEntityListener getODataJPATombstoneEntityListener(UriInfo uriParserResultView); JPQLContext buildJPQLContext(JPQLContextType contextType, UriInfo uriParserResultView); JPQLContextType determineJPQLContextType(UriInfo uriParserResultView, UriInfoType type);  }