Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simpledb plugin for Amazon AWS DynamoDB: fix for non-saves null value…

…s, releasing version 0.4
  • Loading branch information...
commit 5db0f8e7580525e2bbd481b5bd44dccaf7a64f61 1 parent 513e9fd
@rstepanenko rstepanenko authored
View
2  grails-datastore-gorm-simpledb/build.gradle
@@ -1,4 +1,4 @@
-version = "0.4.BUILD-SNAPSHOT"
+version = "0.4"
configurations {
grails
View
2  grails-datastore-simpledb/build.gradle
@@ -1,4 +1,4 @@
-version = "0.4.BUILD-SNAPSHOT"
+version = "0.4"
dependencies {
compile project(":grails-datastore-core")
View
2  ...src/main/groovy/org/grails/datastore/mapping/simpledb/engine/SimpleDBEntityPersister.java
@@ -174,7 +174,7 @@ protected Object getEntryValue(SimpleDBNativeItem nativeEntry, String property)
@Override
protected void setEntryValue(SimpleDBNativeItem nativeEntry, String key, Object value) {
- if (value != null && !getMappingContext().isPersistentEntity(value)) {
+ if (!getMappingContext().isPersistentEntity(value)) {
String stringValue = SimpleDBConverterUtil.convertToString(value, getMappingContext());
nativeEntry.put(key, stringValue);
View
10 ...ledb/src/main/groovy/org/grails/datastore/mapping/simpledb/engine/SimpleDBNativeItem.java
@@ -14,6 +14,8 @@
*/
package org.grails.datastore.mapping.simpledb.engine;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -33,7 +35,7 @@
*/
public class SimpleDBNativeItem {
- private Map<String, String> data = new ConcurrentHashMap<String, String>(); //todo - not sure about concurrency requirements - can it be simplified to use HashMap?
+ private Map<String, String> data = Collections.synchronizedMap(new HashMap<String, String>());
public SimpleDBNativeItem() {}
@@ -46,11 +48,7 @@ public SimpleDBNativeItem(Item item) {
}
public void put(String key, String value) {
- if (value == null) {
- data.remove(key); //concurrent hash map does not allow null values
- } else {
- data.put(key, value);
- }
+ data.put(key, value);
}
public String get(String key) {
View
3  ...edb/src/main/groovy/org/grails/datastore/mapping/simpledb/util/SimpleDBConverterUtil.java
@@ -16,6 +16,9 @@
*/
public class SimpleDBConverterUtil {
public static String convertToString(Object value, MappingContext mappingContext) {
+ if (value == null) {
+ return null;
+ }
String stringValue = null;
if (value instanceof String) {
stringValue = (String)value;
View
5 grails-documentation-simpledb/src/docs/guide/releaseNotes.gdoc
@@ -1,5 +1,10 @@
Below are the details of the changes across releases:
+h4. Version 0.4
+* Upgraded to latest AWS version
+* Minor AWS internal improvements
+* bugfix: for already existing object with non-null value of the property, setting that property to null was NOT propagating null to AWS, leaving AWS with the previous value
+
h4. Version 0.3
* Implemented hilo numeric id generator to use as alternative to default UUID
* Enum fields are supported
View
2  grails-plugins/simpledb/SimpledbGrailsPlugin.groovy
@@ -17,7 +17,7 @@ class SimpledbGrailsPlugin {
def scm = [ url: "https://github.com/SpringSource/grails-data-mapping" ]
def developers = [
[ name: "Roman Stepanenko", email: "rs.opensource@gmail.com" ] ]
- def version = "0.4.BUILD-SNAPSHOT"
+ def version = "0.4"
def grailsVersion = "1.3.5 > *"
def observe = ['services', 'domainClass']
def loadAfter = ['domainClass', 'hibernate', 'services', 'cloudFoundry']
View
2  grails-plugins/simpledb/grails-app/conf/BuildConfig.groovy
@@ -8,7 +8,7 @@ grails.project.dependency.resolution = {
log "warn"
- String simpledbVersion = "0.4.BUILD-SNAPSHOT"
+ String simpledbVersion = "0.4"
//for local development and testing of the plugin:
// 1) change version in grails-data-mapping/build.gradle to an appropriate snapshot
// 2) grails-data-mapping/gradle install
Please sign in to comment.
Something went wrong with that request. Please try again.