if(effectiveParams==null) {
effectiveParams = new HashMap<String, Object>();
effectiveParams.put(MODE_PARAMETER, Mode.FIND_ALL.getPrefix());
}
String effectiveMode = effectiveParams.get(MODE_PARAMETER).toString();
Mode usedMode = null;
for(Mode m : Mode.values()) {
if(usedMode==null && m.getPrefix().equals(effectiveMode)) {
usedMode = m;
}
}
if(usedMode==null) {
throw new UnsupportedModeException(effectiveMode);
}
Collection<Object> parameters = new LinkedList<Object>();
switch(usedMode) {
case FIND_RANGE:
parameters.add(toInt(returnParams, FIND_RANGE_FIRST_PARAMETER, 0));
parameters.add(toInt(returnParams, FIND_RANGE_LAST_PARAMETER, 0));
break;
case COUNT:
case FIND_ALL:
case FIND_ONE:
default:
}
return usedMode.execute(statement, parameters.toArray(), System.currentTimeMillis()+"");
}