Marco Belladelli (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=637b480...
) *commented* on HHH-16993 (
https://hibernate.atlassian.net/browse/HHH-16993?atlOrigin=eyJpIjoiOTFiYj...
)
Re: Collection converter on Collection typed attribute not working (
https://hibernate.atlassian.net/browse/HHH-16993?atlOrigin=eyJpIjoiOTFiYj...
)
Hello Moritz Becker (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) , it looks like the error you’re encountering is caused by the attribute converter
declaration you’re using: DogListConverter , in your reproducer, implements
AttributeConverter<List<Dog>, String>. Since the collection you’re trying to
convert is typed as Collection<Dog> , which is *not assignable to* the converter’s
declared{{List<Dog>}} (being a broader type), Hibernate 6 assumes the converter is
to be applied to each of the collection’s elements causing the CCE you’re seeing.
The correct declaration for your collection converter should be DogListConverter
implements AttributeConverter<Collection<Dog>, String> , that will work
correctly.
Let me know if you have any doubts or additional comments.
(
https://hibernate.atlassian.net/browse/HHH-16993#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16993#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100233- sha1:2faa3a6 )