Search in sources :

Example 1 with OutputProductComponentId

use of com.qcadoo.mes.technologiesGenerator.domain.OutputProductComponentId in project mes by qcadoo.

the class TechnologyProductComponentsDataProvider method findOutputs.

public List<Entity> findOutputs(final TechnologyId technologyId, final Optional<OutputProductComponentId> excludedComponentId, boolean generationMode) {
    SearchCriteriaBuilder scb = null;
    if (generationMode) {
        scb = createGenerationModeBaseCriteria(TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT, OperationProductOutComponentFields.OPERATION_COMPONENT, OperationProductOutComponentFields.PRODUCT, technologyId);
    } else {
        scb = createBaseCriteria(TechnologiesConstants.MODEL_OPERATION_PRODUCT_OUT_COMPONENT, OperationProductOutComponentFields.OPERATION_COMPONENT, OperationProductOutComponentFields.PRODUCT, technologyId);
    }
    excludedComponentId.map(OutputProductComponentId::get).map(SearchRestrictions::idNe).ifPresent(scb::add);
    return scb.list().getEntities();
}
Also used : SearchCriteriaBuilder(com.qcadoo.model.api.search.SearchCriteriaBuilder) OutputProductComponentId(com.qcadoo.mes.technologiesGenerator.domain.OutputProductComponentId)

Aggregations

OutputProductComponentId (com.qcadoo.mes.technologiesGenerator.domain.OutputProductComponentId)1 SearchCriteriaBuilder (com.qcadoo.model.api.search.SearchCriteriaBuilder)1