/** * Get special meta property path object for dynamic attribute id */ @Nullable public MetaPropertyPath getMetaPropertyPath(MetaClass metaClass, UUID attributeId) { Collection<CategoryAttribute> attributes = dynamicAttributes.getAttributesForMetaClass(metaClass); CategoryAttribute attribute = null; for (CategoryAttribute theAttribute : attributes) { if (theAttribute.getId().equals(attributeId)) { attribute = theAttribute; break; } } if (attribute != null) { return DynamicAttributesUtils.getMetaPropertyPath(metaClass, attribute); } else { return null; } }
protected void fillAttributeSelect(Category category) { UUID attrId = condition.getCategoryAttributeId(); CategoryAttribute selectedAttribute = null; Map<String, CategoryAttribute> attributesMap = new TreeMap<>(); for (CategoryAttribute attribute : category.getCategoryAttrs()) { attributesMap.put(attribute.getLocaleName(), attribute); if (attribute.getId().equals(attrId)) { selectedAttribute = attribute; } } attributeLookup.setOptionsMap(attributesMap); attributeLookup.setValue(selectedAttribute); }
propertyPath + ".id and " + cavAlias + ".categoryAttribute.id='" + attributeLookup.<CategoryAttribute>getValue().getId() + "'))"; } else { String valueFieldName = "stringValue"; operation + (op.isUnary() ? " " : paramStr) + "and " + cavAlias + ".categoryAttribute.id='" + attributeLookup.<CategoryAttribute>getValue().getId() + "'"; where = where.replace("?", ":" + paramName); } else { " where " + cavAlias + ".entity." + cavEntityId + "=" + "{E}" + propertyPath + ".id and " + cavAlias + "." + valueFieldName + " = :" + paramName + " and " + cavAlias + ".categoryAttribute.id='" + attributeLookup.<CategoryAttribute>getValue().getId() + "'))"; .setInExpr(condition.getInExpr()) .setRequired(condition.getRequired()) .setCategoryAttrId(attribute.getId()) .build(); condition.setCategoryAttributeId(attributeLookup.getValue().getId()); condition.setIsCollection(BooleanUtils.isTrue(attributeLookup.getValue().getIsCollection())); condition.setLocCaption(attribute.getLocaleName());