use of com.haulmont.cuba.gui.components.filter.descriptor.PropertyConditionDescriptor in project cuba by cuba-platform.
the class RelatedEntitiesBean method getNonOptimizedCondition.
protected PropertyCondition getNonOptimizedCondition(MetaClass metaClass, List<Object> ids, Filter component, String filterComponentName, String primaryKey) {
PropertyConditionDescriptor conditionDescriptor = new PropertyConditionDescriptor(primaryKey, primaryKey, AppConfig.getMessagesPack(), filterComponentName, ((FilterImplementation) component).getEntityMetaClass(), ((FilterImplementation) component).getEntityAlias());
PropertyCondition condition = (PropertyCondition) conditionDescriptor.createCondition();
condition.setInExpr(true);
condition.setHidden(true);
condition.setOperator(Op.IN);
@SuppressWarnings("ConstantConditions") Class idType = metaClass.getProperty(primaryKey).getJavaType();
Param param = Param.Builder.getInstance().setName(paramBuilder.createParamName(condition)).setJavaClass(idType).setEntityWhere("").setEntityView("").setMetaClass(((FilterImplementation) component).getEntityMetaClass()).setProperty(metaClass.getProperty(primaryKey)).setInExpr(true).setRequired(true).build();
param.setValue(ids);
condition.setParam(param);
return condition;
}
Aggregations