Niclas Hedhman wrote:
Another way to handle value serialization/deserialization in a way that the
EntityStore would be happy with is to use Strings as value type. So:
EntityState.setProperty(name, String);
where String is either toString() (for String, Integer, etc.) and in case of
ValueComposite it is an XML-representation. This would be slightly slower
but it does ensure that the data is long-lived, i.e. that we can always
extract it and do migration. And there's no type needed in the EntityStore.
etc. All kinds of goodness!
That would be an interesting approach. And would make the ES even
simpler than before.
Yes. The main drawback I can see is that EntityStores that want to store
data in the "native" format (i.e. Longs as Longs) would have to "convert
back" to the real type before storing. To do this they would have to
consult the EntityTypeRegistry to find out the type of the property. The
value would then go Long->String->Long, which is not superefficient.
This is certainly doable though, and the benefits of it might be more
important.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev