aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/iciql/TableDefinition.java
diff options
context:
space:
mode:
authorSotaro SUZUKI <sotaro.suzuki@architector.jp>2014-10-01 16:17:34 +0900
committerJames Moger <james.moger@gitblit.com>2014-10-06 10:22:39 -0400
commit48da60f625b53dccbc4a34737eba55eb0eda181b (patch)
tree0b048e6247ce0ec196df7015c8fa77bf36e062a0 /src/main/java/com/iciql/TableDefinition.java
parent8ba3b92816e65acc0d1d71ba23259deed616eefe (diff)
downloadiciql-48da60f625b53dccbc4a34737eba55eb0eda181b.tar.gz
iciql-48da60f625b53dccbc4a34737eba55eb0eda181b.zip
add support stackable condition: ex. X and (Y or Z)
see samples in src/test/java/com/iciql/test/StackableConditionsTest.java
Diffstat (limited to 'src/main/java/com/iciql/TableDefinition.java')
-rw-r--r--src/main/java/com/iciql/TableDefinition.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/iciql/TableDefinition.java b/src/main/java/com/iciql/TableDefinition.java
index 6d8cb6e..e0cc169 100644
--- a/src/main/java/com/iciql/TableDefinition.java
+++ b/src/main/java/com/iciql/TableDefinition.java
@@ -1131,11 +1131,16 @@ public class TableDefinition<T> {
}
}
- void initSelectObject(SelectTable<T> table, Object obj, Map<Object, SelectColumn<T>> map) {
+ void initSelectObject(SelectTable<T> table, Object obj, Map<Object, SelectColumn<T>> map, boolean reuse) {
for (FieldDefinition def : fields) {
- Object newValue = def.initWithNewObject(obj);
+ Object value;
+ if (!reuse) {
+ value = def.initWithNewObject(obj);
+ } else {
+ value = def.getValue(obj);
+ }
SelectColumn<T> column = new SelectColumn<T>(table, def);
- map.put(newValue, column);
+ map.put(value, column);
}
}