Rickard (I guess),
I am getting this Exception;
java.lang.IllegalArgumentException: Cannot use @UseDefaults with type
interface org.qi4j.test.entity.AbstractEntityStoreTest$Tjabba
at
org.qi4j.spi.property.DefaultValues.getDefaultValue(DefaultValues.java:82)
at
org.qi4j.runtime.types.ValueCompositeType.fromJSON(ValueCompositeType.java:205)
at
org.qi4j.entitystore.gae.GaeEntityState.getProperty(GaeEntityState.java:179)
at
org.qi4j.runtime.entity.EntityPropertyInstance.get(EntityPropertyInstance.java:66)
at
org.qi4j.test.entity.AbstractEntityStoreTest.whenNewEntityThenCanFindEntityAndCorrectValues(AbstractEntityStoreTest.java:131)
and looking at the ValueCompositeType.fromJSON(), I am wondering why
the "try defaulting it" is a clever strategy?
Any way, the JSON value I send into "fromJSON" seems legit to me.
type: org.qi4j.test.entity.AbstractEntityStoreTest$TestValue
value:
{"valueProperty":{"stringValue":"Bar","anotherValue":{"bling":"BlinkLjus","_type":"org.qi4j.test.entity.AbstractEntityStoreTest$TjabbaValue"}},"serializableProperty":"rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAAAABdAADZm9vdAADYmFyeA==","tjabbaProperty":{"bling":"Brakfis","_type":"org.qi4j.test.entity.AbstractEntityStoreTest$TjabbaValue"},"stringProperty":"","listProperty":["Foo"],"enumProperty":"VALUE1","mapProperty":"rO0ABXNyABdqYXZhLnV0aWwuTGlua2VkSGFzaE1hcDTATlwQbMD7AgABWgALYWNjZXNzT3JkZXJ4cgARamF2YS51dGlsLkhhc2hNYXAFB9rBwxZg0QMAAkYACmxvYWRGYWN0b3JJAAl0aHJlc2hvbGR4cD9AAAAAAAAMdwgAAAAQAAAAAHgA","intProperty":0}
But I assume that there is something bad in there...
The above is stored in the datastore via;
ValueType valueType = type.type();
String data = valueType.toJSON( value ).toString();
and deserialized with
JSONObject json = new JSONObject( data );
value = type.type().fromJSON( json, module );
Any clue what could be going wrong?
Btw, I am adding "IllegalArgumentException" to the "didn't work"
section in the fromJSON() method of ValueCompositeType...
Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev