| I will be pushing a test soon that illustrates this working reasonably in my opinion. I explained the situation above. When an AttributeConverter is part of the equation we simply do not have enough information to always do the performant thing because we have to choose the correct thing first and foremost. The test shows 2 approaches (available today) to provide that missing information:
- If you control the class that defines the attribute type, you can simply annotate it with @Immutable
- If you don't (or don't want to use the annotation) you can register a custom JavaTypeDescriptor as mentioned earlier.
|