public static boolean isAll(final SelectOption select) { if (hasSelect(select)) { for (final SelectItem item : select.getSelectItems()) { if (item.isStar()) { return true; } } return false; } else { return true; } }
public static boolean isAll(final SelectOption select) { if (hasSelect(select)) { for (final SelectItem item : select.getSelectItems()) { if (item.isStar()) { return true; } } return false; } else { return true; } }
private String getSelectString(final SelectItem selectItem) { if (selectItem.isStar()) { if (selectItem.getAllOperationsInSchemaNameSpace() == null) { return "*"; } else { return selectItem.getAllOperationsInSchemaNameSpace().getFullQualifiedNameAsString() + ".*"; } } else { final StringBuilder tmp = new StringBuilder(); for (UriResource resourcePart : selectItem.getResourcePath().getUriResourceParts()) { if (tmp.length() > 0) { tmp.append('/'); } tmp.append(resourcePart.toString()); } return tmp.toString(); } }
private String getSelectString(final SelectItem selectItem) { if (selectItem.isStar()) { if (selectItem.getAllOperationsInSchemaNameSpace() == null) { return "*"; } else { return selectItem.getAllOperationsInSchemaNameSpace().getFullQualifiedNameAsString() + ".*"; } } else { final StringBuilder tmp = new StringBuilder(); for (UriResource resourcePart : selectItem.getResourcePath().getUriResourceParts()) { if (tmp.length() > 0) { tmp.append('/'); } tmp.append(resourcePart.toString()); } return tmp.toString(); } }
private void buildSelectionAddNavigationAndSelect(final UriInfoResource uriResource, final List<JPAPath> jpaPathList, final SelectOption select) throws ODataApplicationException, ODataJPAModelException { final UriResource last = !uriResource.getUriResourceParts().isEmpty() ? uriResource.getUriResourceParts().get( uriResource.getUriResourceParts().size() - 1) : null; final boolean targetIsCollection = (last != null && last instanceof UriResourceProperty && ((UriResourceProperty) last).isCollection()); final String pathPrefix = Util.determineProptertyNavigationPrefix(uriResource.getUriResourceParts()); if (Util.VALUE_RESOURCE.equals(pathPrefix)) jpaPathList.addAll(buildPathValue(jpaEntity)); else if (select == null || select.getSelectItems().isEmpty() || select.getSelectItems().get(0).isStar()) { if (pathPrefix == null || pathPrefix.isEmpty()) copyNonCollectionProperties(jpaPathList, buildEntityPathList(jpaEntity)); else { expandPath(jpaEntity, jpaPathList, pathPrefix, targetIsCollection); } } else { for (SelectItem sItem : select.getSelectItems()) { String pathItem = sItem.getResourcePath().getUriResourceParts().stream().map(path -> (path .getSegmentValue())).collect(Collectors.joining(JPAPath.PATH_SEPERATOR)); expandPath(jpaEntity, jpaPathList, pathPrefix.isEmpty() ? pathItem : pathPrefix + "/" + pathItem, targetIsCollection); } } }
if (select == null || select.getSelectItems().isEmpty() || select.getSelectItems().get(0).isStar()) { for (final JPAPath selectItemPath : jpaEntity.getPathList()) { if (pathContainsCollection(selectItemPath))
|| select.getSelectItems().isEmpty() || select.getSelectItems().get(0).isStar())
private void processSelectOption(SelectOption option, DocumentNode resource, boolean onlyReference) throws TeiidException { if (option == null) { // default select columns resource.addAllColumns(onlyReference); } else { boolean addkeys = true; ArrayList<String> keys = new ArrayList<String>(resource.getKeyColumnNames()); for (SelectItem si:option.getSelectItems()) { if (si.isStar()) { resource.addAllColumns(onlyReference); addkeys = false; continue; } ODataExpressionToSQLVisitor visitor = new ODataExpressionToSQLVisitor( resource, false, getUriInfo(), this.metadata, this.odata, this.nameGenerator, this.params, this.parseService); ElementSymbol expr = (ElementSymbol)visitor.getExpression(si.getResourcePath()); resource.addProjectedColumn(expr.getShortName(), expr); keys.remove(expr.getShortName()); } if (!keys.isEmpty() && addkeys) { for (String key:keys) { ElementSymbol es = new ElementSymbol(key, resource.getGroupSymbol()); resource.addProjectedColumn(key, es); } } } }
if (select == null || select.getSelectItems().isEmpty() || select.getSelectItems().get(0).isStar()) {