Implemented a rough query definition converter

This commit is contained in:
Lennart Hensler committed 2014-05-03 18:33:19 +02:00
1 parent afd2cca590
commit aac9fa2274
1 file changed
+43
@@ -0,0 +1,43 @@
package com.sap.sailing.datamining.shared;
import java.util.Map.Entry;
import com.sap.sailing.datamining.shared.impl.QueryDefinitionImpl;
import com.sap.sse.datamining.shared.dto.FunctionDTO;
public class QueryDefinitionConverter {
public static QueryDefinition convertDeprecatedQueryDefinition(QueryDefinitionDeprecated queryDefinitionDeprecated) {
//TODO implement the statistic type to function conversion
QueryDefinitionImpl queryDefinition = new QueryDefinitionImpl(queryDefinitionDeprecated.getLocaleInfoName(),
convertToFunctionDTO(queryDefinitionDeprecated.getStatisticType()), queryDefinitionDeprecated.getAggregatorType());
for (Entry<DimensionIdentifier, Iterable<?>> filterSelectionEntry : queryDefinitionDeprecated.getSelection().entrySet()) {
//TODO implement the dimension identifier to function conversion
queryDefinition.setFilterSelectionFor(convertToFunctionDTO(filterSelectionEntry.getKey()),
filterSelectionEntry.getValue());
}
for (DimensionIdentifier dimensionIdentifier : queryDefinitionDeprecated.getDimensionsToGroupBy()) {
queryDefinition.appenDimensionToGroupBy(convertToFunctionDTO(dimensionIdentifier));
}
return queryDefinition;
}
private static FunctionDTO convertToFunctionDTO(StatisticType statisticType) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Not yet implemented");
// return null;
}
private static FunctionDTO convertToFunctionDTO(DimensionIdentifier dimensionIdentifier) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Not yet implemented");
// return null;
}
private QueryDefinitionConverter() {
}
}