Commit f5b4032a authored by Nico Mack's avatar Nico Mack

Minor bug fixes

parent 5f814bae
......@@ -101,9 +101,9 @@ public class SqlExecutor extends Executor {
// ---------------------------------------------------------------------------
/**
* replaces every occurrence of the previously specified interpolation pattern with the previously
* specified substitute. Group 1 of matching interpolation pattern will be added to the specified
* interpolation vector.
* replaces every occurrence of the previously specified interpolation pattern with the
* previously specified substitute. Group 1 of matching interpolation pattern will be added to
* the specified interpolation vector.
*
* @param query
* specifies the original string to substitute interpolation patterns in.
......@@ -113,9 +113,9 @@ public class SqlExecutor extends Executor {
* specifies whether or not to use regular (?) JDBC placeholders or positional JPA (?x)
* placeholders. Specify <code>
* true</code> for positional placeholders, <code>false</code> for regular placeholders
* @return the specified string having every occurrence of the interpolation pattern replaced by the
* substitute, and specified interpolation vector will be populated with all group 1's of
* matching interpolation patterns.
* @return the specified string having every occurrence of the interpolation pattern replaced by
* the substitute, and specified interpolation vector will be populated with all group
* 1's of matching interpolation patterns.
*/
// ---------------------------------------------------------------------------
......@@ -235,9 +235,9 @@ public class SqlExecutor extends Executor {
// ---------------------------------------------------------------------------
/**
* Converts the data in the specified SQL Result set into a collection of object arrays as they are
* normally returned by hibernate queries. Each object array represents a row of the result set,
* with columns appearing in the order they were fetched.
* Converts the data in the specified SQL Result set into a collection of object arrays as they
* are normally returned by hibernate queries. Each object array represents a row of the result
* set, with columns appearing in the order they were fetched.
*
* @param p_ResultSet
* specifies the SQL result set returned by a JDBC query.
......@@ -386,13 +386,21 @@ public class SqlExecutor extends Executor {
// ---------------------------------------------------------------------------
private Variable<?> retrieveResults(Declaration declaration) {
Variable<?> variable = declaration.getVariable();
if (variable instanceof VectorVariable) {
variable = this.retrieveVectorVariable(declaration);
} else if (variable instanceof MapVariable) {
variable = this.retrieveMapVariable(declaration);
} else if (columnValues.size() == 1) {
variable = this.retrieveScalarVariable(declaration);
Variable<?> variable = null;
if (declaration != null) {
variable = declaration.getVariable();
if (variable instanceof VectorVariable) {
variable = this.retrieveVectorVariable(declaration);
} else if (variable instanceof MapVariable) {
variable = this.retrieveMapVariable(declaration);
} else if (columnValues.size() == 1) {
variable = this.retrieveScalarVariable(declaration);
}
} else {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("No Results to retrieve for Query!");
}
}
return variable;
}
......
......@@ -23,7 +23,7 @@ package lu.list.itis.dkd.tui.utility;
// * Class Definition and Members *
// ***************************************************************************
public class ValueRange<T extends Comparable<T>> implements Comparable<T> {
public class ValueRange<T extends Comparable<T>> implements Comparable<T>, Cloneable {
private T lowerValue;
private T upperValue;
......@@ -38,6 +38,13 @@ public class ValueRange<T extends Comparable<T>> implements Comparable<T> {
this.upperValue = upper;
}
// ---------------------------------------------------------------------------
public ValueRange(ValueRange<T> original) {
this.lowerValue = original.lowerValue;
this.upperValue = original.upperValue;
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * Class Body
......@@ -116,6 +123,13 @@ public class ValueRange<T extends Comparable<T>> implements Comparable<T> {
// ---------------------------------------------------------------------------
@Override
public ValueRange<T> clone() {
return new ValueRange<T>(this);
}
// ---------------------------------------------------------------------------
@Override
public String toString() {
StringBuilder builder = new StringBuilder("[");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment