Sylvain Lecoy (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMTdjYThkNmM3...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16232?atlOrigin=eyJpIjoiMTdjYT...
) HHH-16232 (
https://hibernate.atlassian.net/browse/HHH-16232?atlOrigin=eyJpIjoiMTdjYT...
) CompositeUserType change in 6.0 make impossible to migrate multi-column mapping (
https://hibernate.atlassian.net/browse/HHH-16232?atlOrigin=eyJpIjoiMTdjYT...
)
Issue Type: Bug Affects Versions: 6.0.0 Assignee: Unassigned Components: hibernate-core,
metamodel Created: 26/Feb/2023 03:09 AM Priority: Major Reporter: Sylvain Lecoy (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
I am working with a domain model class which is composed of an embedded object which
implements the DomainEvent interface. DomainEvent can be any concrete class and is
serialized by Jackson. To solve this in hibernate 5 I have used a CompositeUserType over
two columns: event_body, and type_name.
public class StoredEvent {
private DomainEvent event;
private long eventId;
private Instant occurredOn;
private String typeName;
}
In Hibernate 5 the hbm.xml mapping was very simple and straightforward:
<?xml version= "1.0" ?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
<hibernate-mapping default-access= "field" default-cascade= "all"
>
<class name= "event.StoredEvent" table= "stored_event" lazy=
"true" >
<id name= "eventId" type= "long" column=
"event_id" unsaved-value= "-1" >
<generator class= "identity" />
</id>
<property name= "event" type=
"port.adapter.persistence.hibernate.DomainEventUserType" >
<column name= "event_body" />
<column name= "type_name" />
</property>
<property name= "typeName" column= "type_name" insert=
"false" update= "false" />
<property name= "occurredOn" column= "occurred_on" />
</class>
</hibernate-mapping>
(
https://hibernate.atlassian.net/browse/HHH-16232#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16232#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#100217- sha1:077879e )