Search in sources :

Example 1 with SqlSelectValue

use of de.metas.ui.web.window.descriptor.sql.SqlSelectValue in project metasfresh-webui-api by metasfresh.

the class HUEditorViewFactoryTemplate method createSqlViewBinding.

private SqlViewBinding createSqlViewBinding() {
    // Get HU's standard entity descriptor. We will needed all over.
    final DocumentEntityDescriptor huEntityDescriptor = getHUEntityDescriptor();
    // 
    // Static where clause
    final StringBuilder sqlWhereClause = new StringBuilder();
    {
        // top level
        sqlWhereClause.append(I_M_HU.COLUMNNAME_M_HU_Item_Parent_ID + " is null");
        // Consider window tab's where clause if any
        final I_AD_Tab huTab = Services.get(IADWindowDAO.class).retrieveFirstTab(WEBUI_HU_Constants.WEBUI_HU_Window_ID.toAdWindowId());
        if (!Check.isEmpty(huTab.getWhereClause(), true)) {
            sqlWhereClause.append("\n AND (").append(huTab.getWhereClause()).append(")");
        }
    }
    // 
    // Start preparing the sqlViewBinding builder
    final List<String> displayFieldNames = ImmutableList.of(I_M_HU.COLUMNNAME_M_HU_ID);
    final SqlViewBinding.Builder sqlViewBinding = SqlViewBinding.builder().tableName(I_M_HU.Table_Name).displayFieldNames(displayFieldNames).sqlWhereClause(sqlWhereClause.toString()).rowIdsConverter(HUSqlViewRowIdsConverter.instance);
    // 
    // View fields: from M_HU's entity descriptor
    {
        // NOTE: we need to add all HU's standard fields because those might be needed for some of the standard filters defined
        final SqlDocumentEntityDataBindingDescriptor huEntityBindings = SqlDocumentEntityDataBindingDescriptor.cast(huEntityDescriptor.getDataBinding());
        huEntityBindings.getFields().stream().map(huField -> SqlViewBindingFactory.createViewFieldBinding(huField, displayFieldNames)).forEach(sqlViewBinding::field);
    }
    // 
    // View field: BestBeforeDate
    {
        final String sqlBestBeforeDate = HUAttributeConstants.sqlBestBeforeDate(sqlViewBinding.getTableAlias() + "." + I_M_HU.COLUMNNAME_M_HU_ID);
        sqlViewBinding.field(SqlViewRowFieldBinding.builder().fieldName(HUEditorRow.FIELDNAME_BestBeforeDate).widgetType(DocumentFieldWidgetType.LocalDate).sqlSelectValue(SqlSelectValue.builder().virtualColumnSql(sqlBestBeforeDate).columnNameAlias(HUEditorRow.FIELDNAME_BestBeforeDate).build()).fieldLoader((rs, adLanguage) -> rs.getTimestamp(HUEditorRow.FIELDNAME_BestBeforeDate)).build());
    }
    // 
    // View filters and converters
    {
        sqlViewBinding.filterDescriptors(createFilterDescriptorsProvider()).filterConverter(HUBarcodeSqlDocumentFilterConverter.instance).filterConverter(HUIdsFilterHelper.SQL_DOCUMENT_FILTER_CONVERTER).filterConverters(createFilterConverters());
    }
    // 
    return sqlViewBinding.build();
}
Also used : SqlViewRowFieldBinding(de.metas.ui.web.view.descriptor.SqlViewRowFieldBinding) Autowired(org.springframework.beans.factory.annotation.Autowired) ImmutableDocumentFilterDescriptorsProvider(de.metas.ui.web.document.filter.provider.ImmutableDocumentFilterDescriptorsProvider) ISysConfigBL(org.adempiere.service.ISysConfigBL) DocumentFilterList(de.metas.ui.web.document.filter.DocumentFilterList) GuavaCollectors(de.metas.util.GuavaCollectors) ViewLayout(de.metas.ui.web.view.descriptor.ViewLayout) PanelLayoutType(de.metas.ui.web.window.datatypes.PanelLayoutType) ConstantQueryFilter(org.adempiere.ad.dao.ConstantQueryFilter) IViewFactory(de.metas.ui.web.view.IViewFactory) OverridingMethodsMustInvokeSuper(javax.annotation.OverridingMethodsMustInvokeSuper) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) ITranslatableString(de.metas.i18n.ITranslatableString) NonNull(lombok.NonNull) Collection(java.util.Collection) DocumentFilterParamDescriptor(de.metas.ui.web.document.filter.DocumentFilterParamDescriptor) Set(java.util.Set) IQueryBuilder(org.adempiere.ad.dao.IQueryBuilder) SqlViewBinding(de.metas.ui.web.view.descriptor.SqlViewBinding) ISqlQueryFilter(org.adempiere.ad.dao.ISqlQueryFilter) Objects(java.util.Objects) HUAttributeConstants(de.metas.handlingunits.attribute.HUAttributeConstants) List(java.util.List) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) SqlHUEditorViewRepositoryBuilder(de.metas.ui.web.handlingunits.SqlHUEditorViewRepository.SqlHUEditorViewRepositoryBuilder) DocumentFieldWidgetType(de.metas.ui.web.window.descriptor.DocumentFieldWidgetType) IMsgBL(de.metas.i18n.IMsgBL) LogManager(de.metas.logging.LogManager) IHandlingUnitsBL(de.metas.handlingunits.IHandlingUnitsBL) DocumentPath(de.metas.ui.web.window.datatypes.DocumentPath) SqlOptions(de.metas.ui.web.window.model.sql.SqlOptions) JSONViewDataType(de.metas.ui.web.view.json.JSONViewDataType) PlainContextAware(org.adempiere.model.PlainContextAware) DocumentFilterDescriptor(de.metas.ui.web.document.filter.DocumentFilterDescriptor) SqlViewBindingFactory(de.metas.ui.web.view.descriptor.SqlViewBindingFactory) Value(lombok.Value) IADWindowDAO(org.adempiere.ad.window.api.IADWindowDAO) ImmutableList(com.google.common.collect.ImmutableList) I_AD_Tab(org.compiere.model.I_AD_Tab) SqlDocumentEntityDataBindingDescriptor(de.metas.ui.web.window.descriptor.sql.SqlDocumentEntityDataBindingDescriptor) SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue) DocumentEntityDescriptor(de.metas.ui.web.window.descriptor.DocumentEntityDescriptor) DocumentFilter(de.metas.ui.web.document.filter.DocumentFilter) I_M_HU(de.metas.handlingunits.model.I_M_HU) BarcodeScannerType(de.metas.process.BarcodeScannerType) Nullable(javax.annotation.Nullable) Check(de.metas.util.Check) SqlDocumentFilterConverterContext(de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverterContext) Logger(org.slf4j.Logger) DocumentDescriptorFactory(de.metas.ui.web.window.descriptor.factory.DocumentDescriptorFactory) InArrayQueryFilter(org.adempiere.ad.dao.impl.InArrayQueryFilter) ViewProfileId(de.metas.ui.web.view.ViewProfileId) DocumentFilterDescriptorsProvider(de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvider) WindowId(de.metas.ui.web.window.datatypes.WindowId) IHandlingUnitsDAO(de.metas.handlingunits.IHandlingUnitsDAO) CCache(de.metas.cache.CCache) Services(de.metas.util.Services) SqlDocumentFilterConverter(de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverter) HuId(de.metas.handlingunits.HuId) HUReservationService(de.metas.handlingunits.reservation.HUReservationService) SqlViewFactory(de.metas.ui.web.view.SqlViewFactory) CreateViewRequest(de.metas.ui.web.view.CreateViewRequest) LayoutFactory(de.metas.ui.web.window.descriptor.factory.standard.LayoutFactory) SqlParamsCollector(de.metas.ui.web.document.filter.sql.SqlParamsCollector) ViewId(de.metas.ui.web.view.ViewId) I_AD_Tab(org.compiere.model.I_AD_Tab) SqlDocumentEntityDataBindingDescriptor(de.metas.ui.web.window.descriptor.sql.SqlDocumentEntityDataBindingDescriptor) SqlViewBinding(de.metas.ui.web.view.descriptor.SqlViewBinding) DocumentEntityDescriptor(de.metas.ui.web.window.descriptor.DocumentEntityDescriptor) ITranslatableString(de.metas.i18n.ITranslatableString)

Example 2 with SqlSelectValue

use of de.metas.ui.web.window.descriptor.sql.SqlSelectValue in project metasfresh-webui-api by metasfresh.

the class SqlDefaultDocumentFilterConverter method replaceTableNameWithTableAliasIfNeeded.

@VisibleForTesting
SqlSelectValue replaceTableNameWithTableAliasIfNeeded(@NonNull final SqlSelectValue columnSql, @NonNull final SqlOptions sqlOpts) {
    if (sqlOpts.isUseTableAlias()) {
        SqlSelectValue columnSqlEffective = columnSql;
        columnSqlEffective = columnSqlEffective.withJoinOnTableNameOrAlias(sqlOpts.getTableAlias());
        if (columnSqlEffective.isVirtualColumn()) {
            final String virtualColumnSql = replaceTableNameWithTableAlias(columnSqlEffective.getVirtualColumnSql(), sqlOpts.getTableAlias());
            columnSqlEffective = columnSqlEffective.withVirtualColumnSql(virtualColumnSql);
        }
        return columnSqlEffective;
    } else {
        return columnSql;
    }
}
Also used : SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 3 with SqlSelectValue

use of de.metas.ui.web.window.descriptor.sql.SqlSelectValue in project metasfresh-webui-api by metasfresh.

the class SqlViewSelectData method selectFieldValues.

public SqlAndParams selectFieldValues(@NonNull final ViewEvaluationCtx viewEvalCtx, @NonNull final String selectionId, @NonNull final String fieldName, final int limit) {
    Check.assumeGreaterThanZero(limit, "limit");
    final SqlViewRowFieldBinding field = fieldsByFieldName.get(fieldName);
    if (field == null) {
        throw new AdempiereException("Field `" + fieldName + "` not found. Available fields are: " + fieldsByFieldName.keySet());
    }
    final SqlSelectValue sqlValue = field.getSqlSelectValue();
    final SqlSelectDisplayValue sqlDisplayValue;
    if (field.getSqlSelectDisplayValue() != null && displayFieldNames.contains(fieldName)) {
        sqlDisplayValue = field.getSqlSelectDisplayValue();
    } else {
        sqlDisplayValue = null;
    }
    final CompositeStringExpression.Builder sqlExpression = IStringExpression.composer().append("SELECT DISTINCT ").append(sqlValue.getColumnNameAlias());
    if (sqlDisplayValue != null) {
        sqlExpression.append(", ").append(sqlDisplayValue.getColumnNameAlias());
    }
    sqlExpression.append("\n FROM (").append("\n SELECT ").append("\n ").append(sqlValue.withJoinOnTableNameOrAlias(sqlTableName).toSqlStringWithColumnNameAlias());
    if (sqlDisplayValue != null) {
        sqlExpression.append("\n, ").append(sqlDisplayValue.withJoinOnTableNameOrAlias(sqlTableName).toStringExpressionWithColumnNameAlias());
    }
    sqlExpression.append("\n FROM " + I_T_WEBUI_ViewSelection.Table_Name + " sel").append("\n INNER JOIN " + sqlTableName + " ON (" + keyColumnNamesMap.getSqlJoinCondition(sqlTableName, "sel") + ")").append("\n WHERE sel." + I_T_WEBUI_ViewSelection.COLUMNNAME_UUID + "=?").append("\n ORDER BY sel." + I_T_WEBUI_ViewSelection.COLUMNNAME_Line).append("\n) t").append("\n LIMIT ?");
    final String sql = sqlExpression.build().evaluate(viewEvalCtx.toEvaluatee(), OnVariableNotFound.Fail);
    return SqlAndParams.of(sql, selectionId, limit);
}
Also used : AdempiereException(org.adempiere.exceptions.AdempiereException) CompositeStringExpression(org.adempiere.ad.expression.api.impl.CompositeStringExpression) SqlSelectDisplayValue(de.metas.ui.web.window.descriptor.sql.SqlSelectDisplayValue) SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue)

Example 4 with SqlSelectValue

use of de.metas.ui.web.window.descriptor.sql.SqlSelectValue in project metasfresh-webui-api by metasfresh.

the class SqlDefaultDocumentFilterConverter method buildSqlWhereClause_StandardWidget.

private String buildSqlWhereClause_StandardWidget(final SqlParamsCollector sqlParams, final DocumentFilterParam filterParam, final SqlOptions sqlOpts) {
    final SqlEntityFieldBinding paramBinding = getParameterBinding(filterParam.getFieldName());
    final DocumentFieldWidgetType widgetType = paramBinding.getWidgetType();
    final String columnSqlString;
    {
        final IQueryFilterModifier fieldModifier = extractFieldModifier(widgetType);
        final SqlSelectValue columnSqlEffective = replaceTableNameWithTableAliasIfNeeded(paramBinding.getSqlSelectValue(), sqlOpts);
        columnSqlString = fieldModifier.getColumnSql(columnSqlEffective.toSqlString());
    }
    final IQueryFilterModifier valueModifier = extractValueModifier(widgetType);
    final Operator operator = filterParam.getOperator();
    switch(operator) {
        case EQUAL:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final boolean negate = false;
                return buildSqlWhereClause_Equals(columnSqlString, sqlValue, negate, sqlParams);
            }
        case NOT_EQUAL:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final boolean negate = true;
                return buildSqlWhereClause_Equals(columnSqlString, sqlValue, negate, sqlParams);
            }
        case IN_ARRAY:
            {
                final List<Object> sqlValuesList = filterParam.getValueAsList(itemObj -> convertToSqlValue(itemObj, paramBinding, valueModifier));
                return buildSqlWhereClause_InArray(columnSqlString, sqlValuesList, sqlParams);
            }
        case GREATER:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                return buildSqlWhereClause_Compare(columnSqlString, ">", sqlValue, sqlParams);
            }
        case GREATER_OR_EQUAL:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                return buildSqlWhereClause_Compare(columnSqlString, ">=", sqlValue, sqlParams);
            }
        case LESS:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                return buildSqlWhereClause_Compare(columnSqlString, "<", sqlValue, sqlParams);
            }
        case LESS_OR_EQUAL:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                return buildSqlWhereClause_Compare(columnSqlString, "<=", sqlValue, sqlParams);
            }
        case LIKE:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final boolean negate = false;
                final boolean ignoreCase = false;
                return buildSqlWhereClause_Like(columnSqlString, negate, ignoreCase, sqlValue, sqlParams);
            }
        case NOT_LIKE:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final boolean negate = true;
                final boolean ignoreCase = false;
                return buildSqlWhereClause_Like(columnSqlString, negate, ignoreCase, sqlValue, sqlParams);
            }
        case LIKE_I:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final boolean negate = false;
                final boolean ignoreCase = true;
                return buildSqlWhereClause_Like(columnSqlString, negate, ignoreCase, sqlValue, sqlParams);
            }
        case NOT_LIKE_I:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final boolean negate = true;
                final boolean ignoreCase = true;
                return buildSqlWhereClause_Like(columnSqlString, negate, ignoreCase, sqlValue, sqlParams);
            }
        case BETWEEN:
            {
                final Object sqlValue = convertToSqlValue(filterParam.getValue(), paramBinding, valueModifier);
                final Object sqlValueTo = convertToSqlValue(filterParam.getValueTo(), paramBinding, valueModifier);
                return buildSqlWhereClause_Between(columnSqlString, sqlValue, sqlValueTo, sqlParams);
            }
        default:
            {
                throw new IllegalArgumentException("Operator not supported: " + operator);
            }
    }
}
Also used : Operator(de.metas.ui.web.document.filter.DocumentFilterParam.Operator) DateTruncQueryFilterModifier(org.adempiere.ad.dao.impl.DateTruncQueryFilterModifier) IQueryFilterModifier(org.adempiere.ad.dao.IQueryFilterModifier) SqlOptions(de.metas.ui.web.window.model.sql.SqlOptions) ArrayList(java.util.ArrayList) DB(org.compiere.util.DB) Operator(de.metas.ui.web.document.filter.DocumentFilterParam.Operator) SqlEntityFieldBinding(de.metas.ui.web.window.descriptor.sql.SqlEntityFieldBinding) SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue) DBConstants(org.adempiere.db.DBConstants) DocumentFilter(de.metas.ui.web.document.filter.DocumentFilter) LookupValuesList(de.metas.ui.web.window.datatypes.LookupValuesList) LookupValue(de.metas.ui.web.window.datatypes.LookupValue) NonNull(lombok.NonNull) DocumentFilterParamDescriptor(de.metas.ui.web.document.filter.DocumentFilterParamDescriptor) SqlDocumentsRepository(de.metas.ui.web.window.model.sql.SqlDocumentsRepository) DocumentFilterParam(de.metas.ui.web.document.filter.DocumentFilterParam) MoreObjects(com.google.common.base.MoreObjects) List(java.util.List) LabelsLookup(de.metas.ui.web.window.model.lookup.LabelsLookup) AdempiereException(org.adempiere.exceptions.AdempiereException) Check(de.metas.printing.esb.base.util.Check) DocumentFieldWidgetType(de.metas.ui.web.window.descriptor.DocumentFieldWidgetType) SqlEntityBinding(de.metas.ui.web.window.descriptor.sql.SqlEntityBinding) VisibleForTesting(com.google.common.annotations.VisibleForTesting) NullQueryFilterModifier(org.adempiere.ad.dao.impl.NullQueryFilterModifier) IQueryFilterModifier(org.adempiere.ad.dao.IQueryFilterModifier) DocumentFieldWidgetType(de.metas.ui.web.window.descriptor.DocumentFieldWidgetType) ArrayList(java.util.ArrayList) LookupValuesList(de.metas.ui.web.window.datatypes.LookupValuesList) List(java.util.List) SqlEntityFieldBinding(de.metas.ui.web.window.descriptor.sql.SqlEntityFieldBinding) SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue)

Example 5 with SqlSelectValue

use of de.metas.ui.web.window.descriptor.sql.SqlSelectValue in project metasfresh-webui-api by metasfresh.

the class SqlViewSelectionQueryBuilder method buildSqlCreateSelectionFromSelection.

/**
 * @return
 *
 *         <pre>
 * INSERT INTO T_WEBUI_ViewSelection (UUID, Line, keys)
 * SELECT ... FROM T_WEBUI_ViewSelection sel INNER JOIN ourTable WHERE sel.UUID=[fromUUID]
 *         </pre>
 */
public SqlAndParams buildSqlCreateSelectionFromSelection(@NonNull final ViewEvaluationCtx viewEvalCtx, @NonNull final ViewId newViewId, @NonNull final String fromSelectionId, @NonNull final DocumentFilterList filters, @NonNull final DocumentQueryOrderByList orderBys, @NonNull final SqlDocumentFilterConverterContext filterConverterCtx) {
    final String sqlTableAlias = getTableAlias();
    final SqlViewKeyColumnNamesMap keyColumnNamesMap = getSqlViewKeyColumnNamesMap();
    final DocumentQueryOrderByList orderBysEffective = orderBys.stream().flatMap(this::flatMapEffectiveFieldNames).collect(DocumentQueryOrderByList.toDocumentQueryOrderByList());
    // 
    // Build the table we will join.
    final SqlAndParams sqlSourceTable;
    {
        final Set<String> addedFieldNames = new HashSet<>();
        final StringBuilder sqlKeyColumnNames;
        {
            sqlKeyColumnNames = new StringBuilder();
            for (final String keyColumnName : keyColumnNamesMap.getKeyColumnNames()) {
                if (!addedFieldNames.add(keyColumnName)) {
                    continue;
                }
                if (sqlKeyColumnNames.length() > 0) {
                    sqlKeyColumnNames.append("\n, ");
                }
                sqlKeyColumnNames.append(getSqlSelectValue(keyColumnName).withColumnNameAlias(keyColumnName).toSqlStringWithColumnNameAlias());
            }
        }
        final SqlAndParams.Builder sqlSourceTableBuilder = SqlAndParams.builder();
        sqlSourceTableBuilder.append("(SELECT ").append(sqlKeyColumnNames);
        for (final DocumentQueryOrderBy orderBy : orderBysEffective.toList()) {
            final String fieldName = orderBy.getFieldName();
            final SqlSelectDisplayValue sqlSelectDisplayValue = getSqlSelectDisplayValue(fieldName);
            if (sqlSelectDisplayValue != null && addedFieldNames.add(sqlSelectDisplayValue.getColumnNameAlias())) {
                sqlSourceTableBuilder.append("\n, ").append(sqlSelectDisplayValue.withJoinOnTableNameOrAlias(getTableName()).toSqlStringWithColumnNameAlias(viewEvalCtx.toEvaluatee()));
            }
            final SqlSelectValue sqlSelectValue = getSqlSelectValue(fieldName);
            if (sqlSelectValue != null && addedFieldNames.add(sqlSelectValue.getColumnNameAlias())) {
                sqlSourceTableBuilder.append("\n, ").append(sqlSelectValue.withJoinOnTableNameOrAlias(getTableName()).toSqlStringWithColumnNameAlias());
            }
        }
        sqlSourceTableBuilder.append("\n FROM ").append(getTableName());
        final SqlAndParams sqlFilters = buildSqlFiltersOrNull(filters, filterConverterCtx, SqlOptions.usingTableName(getTableName()));
        if (sqlFilters != null) {
            sqlSourceTableBuilder.append("\n WHERE ").append(sqlFilters);
        }
        sqlSourceTableBuilder.append(")");
        sqlSourceTable = sqlSourceTableBuilder.build();
    }
    // 
    // Order BY
    final String sqlOrderBys = SqlDocumentOrderByBuilder.newInstance(this::getFieldOrderBy).joinOnTableNameOrAlias(sqlTableAlias).useColumnNameAlias(true).buildSqlOrderBy(orderBysEffective).map(sqlOrderBysExpr -> sqlOrderBysExpr.evaluate(viewEvalCtx.toEvaluatee(), OnVariableNotFound.Fail)).map(sql -> _viewBinding.replaceTableNameWithTableAlias(sql, sqlTableAlias)).orElse(null);
    // 
    final String sqlJoinCondition = keyColumnNamesMap.getSqlJoinCondition(sqlTableAlias, "sel");
    // 
    return SqlAndParams.builder().append("INSERT INTO " + I_T_WEBUI_ViewSelection.Table_Name + " (" + " " + I_T_WEBUI_ViewSelection.COLUMNNAME_UUID + ", " + I_T_WEBUI_ViewSelection.COLUMNNAME_Line + ", " + keyColumnNamesMap.getWebuiSelectionColumnNamesCommaSeparated() + ")").append("\n SELECT ").append("\n  ?", // newUUID
    newViewId.getViewId()).append("\n, ").append("row_number() OVER (").append(sqlOrderBys != null ? "ORDER BY " + sqlOrderBys : "").append(// Line
    ")").append("\n, ").append(// keys
    keyColumnNamesMap.getKeyColumnNamesCommaSeparated()).append("\n FROM ").append(I_T_WEBUI_ViewSelection.Table_Name).append(" sel").append("\n INNER JOIN ").append(sqlSourceTable).append(" ").append(sqlTableAlias).append(" ON (").append(sqlJoinCondition).append(")").append("\n WHERE sel.").append(I_T_WEBUI_ViewSelection.COLUMNNAME_UUID).append("=?", // fromUUID
    fromSelectionId).build();
}
Also used : LogManager(de.metas.logging.LogManager) Arrays(java.util.Arrays) SqlSelectDisplayValue(de.metas.ui.web.window.descriptor.sql.SqlSelectDisplayValue) Access(de.metas.security.permissions.Access) ViewEvaluationCtx(de.metas.ui.web.view.ViewEvaluationCtx) DocumentId(de.metas.ui.web.window.datatypes.DocumentId) SqlOptions(de.metas.ui.web.window.model.sql.SqlOptions) SqlOrderByBindings(de.metas.ui.web.window.model.sql.SqlDocumentOrderByBuilder.SqlOrderByBindings) I_T_WEBUI_ViewSelection(de.metas.ui.web.base.model.I_T_WEBUI_ViewSelection) ArrayList(java.util.ArrayList) Value(lombok.Value) HashSet(java.util.HashSet) IUserRolePermissions(de.metas.security.IUserRolePermissions) IStringExpression(org.adempiere.ad.expression.api.IStringExpression) SqlDocumentFilterConverters(de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverters) DB(org.compiere.util.DB) DocumentFilterList(de.metas.ui.web.document.filter.DocumentFilterList) SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue) I_T_WEBUI_ViewSelectionLine(de.metas.ui.web.base.model.I_T_WEBUI_ViewSelectionLine) DocumentQueryOrderBy(de.metas.ui.web.window.model.DocumentQueryOrderBy) SqlOrderByValue(de.metas.ui.web.window.descriptor.sql.SqlOrderByValue) Nullable(javax.annotation.Nullable) OnVariableNotFound(org.adempiere.ad.expression.api.IExpressionEvaluator.OnVariableNotFound) DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection) Check(de.metas.util.Check) SqlDocumentFilterConverterContext(de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverterContext) Logger(org.slf4j.Logger) DocumentQueryOrderByList(de.metas.ui.web.window.model.DocumentQueryOrderByList) NonNull(lombok.NonNull) Collection(java.util.Collection) SqlDocumentOrderByBuilder(de.metas.ui.web.window.model.sql.SqlDocumentOrderByBuilder) Set(java.util.Set) AccessSqlStringExpression(de.metas.security.impl.AccessSqlStringExpression) ConstantStringExpression(org.adempiere.ad.expression.api.impl.ConstantStringExpression) IStringExpressionWrapper(org.adempiere.ad.expression.api.IStringExpressionWrapper) Collectors(java.util.stream.Collectors) SqlDocumentFilterConverter(de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverter) List(java.util.List) Stream(java.util.stream.Stream) Builder(lombok.Builder) AdempiereException(org.adempiere.exceptions.AdempiereException) SqlParamsCollector(de.metas.ui.web.document.filter.sql.SqlParamsCollector) CompositeStringExpression(org.adempiere.ad.expression.api.impl.CompositeStringExpression) ViewId(de.metas.ui.web.view.ViewId) HashSet(java.util.HashSet) Set(java.util.Set) SqlDocumentOrderByBuilder(de.metas.ui.web.window.model.sql.SqlDocumentOrderByBuilder) Builder(lombok.Builder) DocumentQueryOrderByList(de.metas.ui.web.window.model.DocumentQueryOrderByList) SqlSelectDisplayValue(de.metas.ui.web.window.descriptor.sql.SqlSelectDisplayValue) DocumentQueryOrderBy(de.metas.ui.web.window.model.DocumentQueryOrderBy) SqlSelectValue(de.metas.ui.web.window.descriptor.sql.SqlSelectValue)

Aggregations

SqlSelectValue (de.metas.ui.web.window.descriptor.sql.SqlSelectValue)6 LogManager (de.metas.logging.LogManager)3 DocumentFilterList (de.metas.ui.web.document.filter.DocumentFilterList)3 SqlDocumentFilterConverter (de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverter)3 SqlDocumentFilterConverterContext (de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverterContext)3 SqlParamsCollector (de.metas.ui.web.document.filter.sql.SqlParamsCollector)3 ViewId (de.metas.ui.web.view.ViewId)3 SqlOptions (de.metas.ui.web.window.model.sql.SqlOptions)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 NonNull (lombok.NonNull)3 AdempiereException (org.adempiere.exceptions.AdempiereException)3 DB (org.compiere.util.DB)3 IUserRolePermissions (de.metas.security.IUserRolePermissions)2 AccessSqlStringExpression (de.metas.security.impl.AccessSqlStringExpression)2 Access (de.metas.security.permissions.Access)2 I_T_WEBUI_ViewSelection (de.metas.ui.web.base.model.I_T_WEBUI_ViewSelection)2 I_T_WEBUI_ViewSelectionLine (de.metas.ui.web.base.model.I_T_WEBUI_ViewSelectionLine)2 SqlDocumentFilterConverters (de.metas.ui.web.document.filter.sql.SqlDocumentFilterConverters)2 ViewEvaluationCtx (de.metas.ui.web.view.ViewEvaluationCtx)2