public RelationalValueSearchQuery clone() { RelationalValueSearchQuery clone = new RelationalValueSearchQuery(column, searchValue, searchType); if (this.paging != null) { clone.paging = this.paging.clone(); } return clone; }
@Override public Query item(QName column) { checkRelationalValueSearchQuery(); relationalValueSearchQuery.setColumn(column); return this; }
private Query comparison(RelationalValueSearchType type, String value) { checkRelationalValueSearchQuery(); relationalValueSearchQuery.setSearchType(type); relationalValueSearchQuery.setSearchValue(value); return this; }
if (queryDef.getColumn() != null && queryDef.getSearchType() != null && StringUtils.isNotEmpty(queryDef.getSearchValue())) { String value = queryDef.getSearchValue(); if (LookupTableRowType.F_LABEL.equals(queryDef.getColumn())) { param = root.get("label").get("norm"); PolyString poly = new PolyString(value); value = poly.getNorm(); } else { param = root.get(queryDef.getColumn().getLocalPart()); switch (queryDef.getSearchType()) { case EXACT: where.add(cb.equal(param, value)); ObjectPaging paging = queryDef.getPaging(); if (paging == null) { return session.createQuery(cq);
public <T extends ObjectType> void updateLoadedLookupTable(PrismObject<T> object, Collection<SelectorOptions<GetOperationOptions>> options, Session session) throws SchemaException { if (!SelectorOptions.hasToLoadPath(LookupTableType.F_ROW, options)) { return; } LOGGER.debug("Loading lookup table data."); GetOperationOptions getOption = findLookupTableGetOption(options); RelationalValueSearchQuery queryDef = getOption == null ? null : getOption.getRelationalValueSearchQuery(); Query query = setupLookupTableRowsQuery(session, queryDef, object.getOid()); if (queryDef != null && queryDef.getPaging() != null) { ObjectPaging paging = queryDef.getPaging(); if (paging.getOffset() != null) { query.setFirstResult(paging.getOffset()); } if (paging.getMaxSize() != null) { query.setMaxResults(paging.getMaxSize()); } } List<RLookupTableRow> rows = query.list(); if (rows == null || rows.isEmpty()) { return; } LookupTableType lookup = (LookupTableType) object.asObjectable(); List<LookupTableRowType> jaxbRows = lookup.getRow(); for (RLookupTableRow row : rows) { LookupTableRowType jaxbRow = row.toJAXB(); jaxbRows.add(jaxbRow); } }
public GetOperationOptions clone() { GetOperationOptions clone = new GetOperationOptions(); clone.noFetch = this.noFetch; clone.doNotDiscovery = this.doNotDiscovery; clone.raw = this.raw; clone.resolve = this.resolve; clone.resolveNames = this.resolveNames; clone.retrieve = this.retrieve; clone.allowNotFound = this.allowNotFound; clone.readOnly = this.readOnly; clone.pointInTimeType = this.pointInTimeType; clone.staleness = this.staleness; clone.distinct = this.distinct; clone.attachDiagData = this.attachDiagData; clone.executionPhase = this.executionPhase; if (this.relationalValueSearchQuery != null) { clone.relationalValueSearchQuery = this.relationalValueSearchQuery.clone(); } clone.definitionProcessing = this.definitionProcessing; return clone; }
@Override public Query retrieveQuery() { if (relationalValueSearchQuery != null) { throw new IllegalStateException("Already constructing relational value search query"); } relationalValueSearchQuery = new RelationalValueSearchQuery(null); return retrieve(relationalValueSearchQuery); }