Niclas Hedhman wrote:

At some point we fell off the mailing list...

I think you have found a bug, but I'm not near a computer so I can't confirm until tomorrow. Rickard?

Is the VoucherEntity referring to MacAddress or MacAddressValue? I'm guessing MacAddress, since you chose to divide them. The problem is that the Property in your Entity then points to a type that Qi4j cannot really know what it is, and therefore it is set to be of SerializableType (since type is designated based on type rather than actual instance). Then you will see exactly the result you get.

The solution is to have your property use MacAddressValue as type, so that Qi4j will know what it is. I will admit that this is a big limitation, especially since it will also mean that you cannot assign the property to any subtype of MacAddressValue; that is the specific type that will be used on deserialization. The only way to get around that is to somehow include type information in the serialized state whenever the actual instance does not conform to the type of the property that declared it.

This is how XStream works for XML-serialization, for comparison: if you have a list and it's an ArrayList then no type is included since that is the default, but otherwise the classname is included. We could do something similar here, but I'm unsure how to do it best.

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to