-
1. Re: Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?
navigateur Jan 26, 2012 7:58 PM (in response to navigateur)Is anyone able to transport a LinkedHashMap from server to client via Errai? Or any subclass of HashMap? Without problems?
-
2. Re: Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?
cbrock Jan 27, 2012 4:28 AM (in response to navigateur)Yes, you need to tell Errai what kind of marshaller to use. If it's your own subclass, you can merely specify it in the @Portable annotation. So if you create a subclass of HashMap, merely annotate that class as such: @Portable(aliasOf = Map.class)
If it's not your own implementation, you can specify the mapping in the ErraiApp.properties. You can specify multiple implementations by whitespace seperating them.
errai.marshalling.mappingAliases=my.impl.SomeHashMap->java.util.Map
-
3. Re: Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?
navigateur Jan 28, 2012 6:38 AM (in response to cbrock)This is only as of Errai 2.0 yes? Will the annotation alone work for a custom subclass of LinkedHashMap as well, and preserve the ordering within it? Or do I also need to have an ErraiApp.properties entry for LinkedHashMap as well as the annotation on my custom subclass of it? Either way, will it preserve the LinkedHashMap ordering as specified?
-
4. Re: Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?
cbrock Jan 31, 2012 8:53 PM (in response to navigateur)1 of 1 people found this helpfulYes, this is a new feature of the marshalling n 2.0
-
5. Re: Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?
navigateur Feb 2, 2012 1:35 PM (in response to cbrock)Will just the annotation be sufficient when subclassing LinkedHashMap?
-
6. Re: Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?
cbrock Feb 2, 2012 2:32 PM (in response to navigateur)1 of 1 people found this helpful@Portable(aliasOf = List.class) --- yes.