Cleaned the query construction process a bit

The convertion from FunctionDTO to Function is now done by the
FunctionProvider and not the DeprecatedToFunctionConverte, because the
transitive functions can now be handled by the FunctionRegistry and
FunctionProvider.
This commit is contained in:
Lennart Hensler committed 2014-06-07 14:32:14 +02:00
1 parent 47feb629e6
commit dc94d436bc
7 files changed
+43 -41

No files matched your search

@@ -0,0 +1,21 @@
package com.sap.sse.datamining.shared;
import java.util.List;
import java.util.Map;
import com.sap.sse.datamining.shared.components.AggregatorType;
import com.sap.sse.datamining.shared.dto.FunctionDTO;
public interface QueryDefinition {
public String getLocaleInfoName();
public Map<FunctionDTO, Iterable<?>> getFilterSelection();
public List<FunctionDTO> getDimensionsToGroupBy();
public FunctionDTO getExtractionFunction();
public AggregatorType getAggregatorType();
}
@@ -1,5 +1,11 @@
package com.sap.sse.datamining.shared.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation to mark the concrete data retrievers for a specific domain.<br />
* This is necessary to link the base data types with the data retrievers, to be able
@@ -18,6 +24,9 @@ package com.sap.sse.datamining.shared.annotations;
*
* @author Lennart Hensler (D054527)
*/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface DataRetriever {
public static final String DEFAULT_GROUP = "Default";
@@ -0,0 +1,61 @@
package com.sap.sse.datamining.shared.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.sap.sse.datamining.shared.QueryDefinition;
import com.sap.sse.datamining.shared.components.AggregatorType;
import com.sap.sse.datamining.shared.dto.FunctionDTO;
public class QueryDefinitionImpl implements QueryDefinition {
private final String localeInfoName;
private final Map<FunctionDTO, Iterable<?>> filterSelection;
private final List<FunctionDTO> dimensionsToGroupBy;
private final FunctionDTO extractionFunction;
private final AggregatorType aggregatorType;
public QueryDefinitionImpl(String localeInfoName, FunctionDTO extractionFunction, AggregatorType aggregatorType) {
this.localeInfoName = localeInfoName;
this.filterSelection = new HashMap<FunctionDTO, Iterable<?>>();
this.dimensionsToGroupBy = new ArrayList<FunctionDTO>();
this.extractionFunction = extractionFunction;
this.aggregatorType = aggregatorType;
}
public void setFilterSelectionFor(FunctionDTO dimension, Iterable<?> selection) {
filterSelection.put(dimension, selection);
}
public void appendDimensionToGroupBy(FunctionDTO dimensionToGroupBy) {
dimensionsToGroupBy.add(dimensionToGroupBy);
}
@Override
public String getLocaleInfoName() {
return localeInfoName;
}
@Override
public Map<FunctionDTO, Iterable<?>> getFilterSelection() {
return filterSelection;
}
@Override
public List<FunctionDTO> getDimensionsToGroupBy() {
return dimensionsToGroupBy;
}
@Override
public FunctionDTO getExtractionFunction() {
return extractionFunction;
}
@Override
public AggregatorType getAggregatorType() {
return aggregatorType;
}
}