aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/healthmarketscience
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2011-11-12 02:56:39 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2011-11-12 02:56:39 +0000
commitaafaa8f12793373085d10ffb58664f868fa397d4 (patch)
treebbb056086efd69245fe59ec18213636b18e05189 /src/java/com/healthmarketscience
parent84f12a0fbe85d05dc6d2c67ae937633e9fe36609 (diff)
downloadjackcess-aafaa8f12793373085d10ffb58664f868fa397d4.tar.gz
jackcess-aafaa8f12793373085d10ffb58664f868fa397d4.zip
some tweaks, fixes, and tests for unsupported values
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@592 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com/healthmarketscience')
-rw-r--r--src/java/com/healthmarketscience/jackcess/complex/ComplexValueForeignKey.java13
-rw-r--r--src/java/com/healthmarketscience/jackcess/complex/UnsupportedColumnInfo.java14
2 files changed, 21 insertions, 6 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/complex/ComplexValueForeignKey.java b/src/java/com/healthmarketscience/jackcess/complex/ComplexValueForeignKey.java
index d236afe..ba31a3b 100644
--- a/src/java/com/healthmarketscience/jackcess/complex/ComplexValueForeignKey.java
+++ b/src/java/com/healthmarketscience/jackcess/complex/ComplexValueForeignKey.java
@@ -167,6 +167,16 @@ public class ComplexValueForeignKey extends Number
return (List<SingleValue>)getValues();
}
+ @SuppressWarnings("unchecked")
+ public List<UnsupportedValue> getUnsupportedValues()
+ throws IOException
+ {
+ if(getComplexType() != ComplexDataType.UNSUPPORTED) {
+ throw new UnsupportedOperationException();
+ }
+ return (List<UnsupportedValue>)getValues();
+ }
+
public void reset() {
// discard any cached values
_values = null;
@@ -246,7 +256,8 @@ public class ComplexValueForeignKey extends Number
return value;
}
- public UnsupportedValue addUnsupportedValue(Map<String,Object> values)
+ public UnsupportedValue addUnsupportedValue(
+ Map<String,? extends Object> values)
throws IOException
{
reset();
diff --git a/src/java/com/healthmarketscience/jackcess/complex/UnsupportedColumnInfo.java b/src/java/com/healthmarketscience/jackcess/complex/UnsupportedColumnInfo.java
index 7275511..27ee434 100644
--- a/src/java/com/healthmarketscience/jackcess/complex/UnsupportedColumnInfo.java
+++ b/src/java/com/healthmarketscience/jackcess/complex/UnsupportedColumnInfo.java
@@ -59,8 +59,10 @@ public class UnsupportedColumnInfo extends ComplexColumnInfo<UnsupportedValue>
{
int id = (Integer)getPrimaryKeyColumn().getRowValue(rawValue);
- Map<String,Object> values = new LinkedHashMap<String,Object>(rawValue);
- values.remove(getPrimaryKeyColumn().getName());
+ Map<String,Object> values = new LinkedHashMap<String,Object>();
+ for(Column col : getValueColumns()) {
+ col.setRowValue(values, col.getRowValue(rawValue));
+ }
return new UnsupportedValueImpl(id, complexValueFk, values);
}
@@ -77,13 +79,15 @@ public class UnsupportedColumnInfo extends ComplexColumnInfo<UnsupportedValue>
return row;
}
- public static UnsupportedValue newValue(Map<String,Object> values) {
+ public static UnsupportedValue newValue(Map<String,? extends Object> values) {
return newValue(INVALID_COMPLEX_VALUE_ID, values);
}
public static UnsupportedValue newValue(
- ComplexValueForeignKey complexValueFk, Map<String,Object> values) {
- return new UnsupportedValueImpl(INVALID_ID, complexValueFk, values);
+ ComplexValueForeignKey complexValueFk,
+ Map<String,? extends Object> values) {
+ return new UnsupportedValueImpl(INVALID_ID, complexValueFk,
+ new LinkedHashMap<String,Object>(values));
}
private static class UnsupportedValueImpl extends ComplexValueImpl