[JIRA] (HHH-17071) Basic Collection of 'Converted' Embeddables stopped working with 6.2
by Juan Pablo Rojas (JIRA)
Juan Pablo Rojas ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b1028b... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMTdlY2YzZDFh... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-17071?atlOrigin=eyJpIjoiMTdlY2... ) HHH-17071 ( https://hibernate.atlassian.net/browse/HHH-17071?atlOrigin=eyJpIjoiMTdlY2... ) Basic Collection of 'Converted' Embeddables stopped working with 6.2 ( https://hibernate.atlassian.net/browse/HHH-17071?atlOrigin=eyJpIjoiMTdlY2... )
Issue Type: Bug Affects Versions: 6.2.6 Assignee: Unassigned Components: hibernate-core Created: 11/Aug/2023 08:09 AM Environment: Spring Boot 3.1.2
Spring Data 2023.0.2 Priority: Major Reporter: Juan Pablo Rojas ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b1028b... )
Dear all,
Just wanted to mention that after described upgrade (SB 3.0.5 → SB 3.1.2), the next mapping stopped working (application couldnt start either).
@Basic( optional = false )
@Column( name="LANGUAGES", length = 256 )
@Convert( converter = ISO639LanguageSetConverter.class )
private Set<ISO639Language> languages = new HashSet<>();
ISO639Language is a simple embeddable that stores a locale like literal and ‘validates’ it upon creation. Nothing too fancy.
@Embeddable
public class ISO639Language {
protected ISO639Language(){}
public ISO639Language( String value){
this.setValue(value);
}
@Basic
@Column( name = "LANGUAGE" , nullable = false , unique = false )
@Pattern( regexp = "^[^-]{2,3}(-[^-]{2,3})?(-[^-]{2,3})?$" )
private String value;
public String getValue() {
return value;
}
public void setValue( String value) {
this.value = value.trim().replace( '_' , '-' );
}
}
I guess it has to do with the introduction of mapping composite/struct types https://hibernate.atlassian.net/browse/HHH-15327 and, checking at source code, with https://hibernate.atlassian.net/browse/HHH-15830.
The only workaround that i can think of to make it work again is to use plain strings instead of the embeddable, but i guess that PropertyBinder may use the Convert annotation to realize that this is actually a basic type binding.
Thank you for your help!
BR
Juan Pablo
( https://hibernate.atlassian.net/browse/HHH-17071#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-17071#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=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100234- sha1:39b0f46 )