Description
In DefaultResultSetHandler.instantiateCollectionPropertyIfAppropriate, of the propertyValue return is an instanceof an Unmodifiable collection, then a new collection should be called to be passed to the setter method, if it exists, instead of attempting to add objects to the unmodifiable collection.
OR
You should only use the collection returned by the getter in the case where a setter does not exist.
The reason for this is, the getter could return an unmodifiable collection, as in my case, or a collection that is not linked directly to the collection maintained by the owning object.
Ignoring the setter, when it exists, is ignoring the object design and Java Bean standard,breaking encapsulation, imo.
If an object doesn't have a "setter" you could also look for an addPropertyName method. Which would support allowing an object to manage it's own underlying collection.
My work around, currently, is to use a reference to the underlying backing collection to the property instead of the property name. However, I would like to be able to use a custom setter or adder instead of returning a direct reference to the underlying collection.