diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2009-05-28 14:30:33 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2009-05-28 14:30:33 +0000 |
commit | aeab15c5c14b3d9de43bb5f97c368694b6f7625e (patch) | |
tree | 61e3e502ee63c5bdfd6089a97801b1d3c071b7af /src/java/com | |
parent | cd23b435686872ea0abd59568be5bd2bd1994858 (diff) | |
download | jackcess-aeab15c5c14b3d9de43bb5f97c368694b6f7625e.tar.gz jackcess-aeab15c5c14b3d9de43bb5f97c368694b6f7625e.zip |
add some more query read tests
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@394 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/query/Query.java | 3 | ||||
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/query/UnionQuery.java | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/query/Query.java b/src/java/com/healthmarketscience/jackcess/query/Query.java index 08f6f48..acc0954 100644 --- a/src/java/com/healthmarketscience/jackcess/query/Query.java +++ b/src/java/com/healthmarketscience/jackcess/query/Query.java @@ -31,7 +31,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -586,7 +585,7 @@ public abstract class Query public Map<String,Object> toTableRow() { - Map<String,Object> tableRow = new HashMap<String,Object>(); + Map<String,Object> tableRow = new LinkedHashMap<String,Object>(); tableRow.put(COL_ATTRIBUTE, attribute); tableRow.put(COL_EXPRESSION, expression); diff --git a/src/java/com/healthmarketscience/jackcess/query/UnionQuery.java b/src/java/com/healthmarketscience/jackcess/query/UnionQuery.java index 05f0c51..3534a70 100644 --- a/src/java/com/healthmarketscience/jackcess/query/UnionQuery.java +++ b/src/java/com/healthmarketscience/jackcess/query/UnionQuery.java @@ -63,7 +63,7 @@ public class UnionQuery extends Query private String getUnionString(String id) { for(Row row : getTableRows()) { if(id.equals(row.name2)) { - return row.expression; + return cleanUnionString(row.expression); } } throw new IllegalStateException( @@ -86,4 +86,9 @@ public class UnionQuery extends Query } } + private static String cleanUnionString(String str) + { + return str.trim().replaceAll("[\r\n]+", NEWLINE); + } + } |