aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/data/util/sqlcontainer/query
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-08-20 16:07:47 +0300
committerJohn Ahlroos <john@vaadin.com>2012-08-20 16:07:47 +0300
commit0dfdb151913a13e929a65c4dd8b5987c9edd06d5 (patch)
treee5c48a390aa362a5e88df308570adfbef25acca1 /server/src/com/vaadin/data/util/sqlcontainer/query
parentc9689846a8ba1254fb51c164cee6c3c157740eac (diff)
parentd2110e364b0aa87fd25f1f48d865dd455c5d0d7a (diff)
downloadvaadin-framework-0dfdb151913a13e929a65c4dd8b5987c9edd06d5.tar.gz
vaadin-framework-0dfdb151913a13e929a65c4dd8b5987c9edd06d5.zip
Merged 6.8 branch
Diffstat (limited to 'server/src/com/vaadin/data/util/sqlcontainer/query')
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
index c4b640e274..6ebefcd85c 100644
--- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
+++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
@@ -327,10 +327,8 @@ public class DefaultSQLGenerator implements SQLGenerator {
&& cp.getPropertyId().equalsIgnoreCase("rownum")) {
continue;
}
- Object value = cp.getValue() == null ? null : cp.getValue();
- /* Only include properties whose read-only status can be altered */
- if (cp.isReadOnlyChangeAllowed() && !cp.isVersionColumn()) {
- columnToValueMap.put(cp.getPropertyId(), value);
+ if (cp.isPersistent()) {
+ columnToValueMap.put(cp.getPropertyId(), cp.getValue());
}
}
return columnToValueMap;
@@ -345,8 +343,16 @@ public class DefaultSQLGenerator implements SQLGenerator {
&& cp.getPropertyId().equalsIgnoreCase("rownum")) {
continue;
}
- Object value = cp.getValue() == null ? null : cp.getValue();
- if (!cp.isReadOnlyChangeAllowed() || cp.isVersionColumn()) {
+
+ if (cp.isRowIdentifier()) {
+ Object value;
+ if (cp.isPrimaryKey()) {
+ // If the value of a primary key has changed, its old value
+ // should be used to identify the row (#9145)
+ value = cp.getOldValue();
+ } else {
+ value = cp.getValue();
+ }
rowIdentifiers.put(cp.getPropertyId(), value);
}
}