Sebastian Götz (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6203fe7...
) *commented* on HHH-16192 (
https://hibernate.atlassian.net/browse/HHH-16192?atlOrigin=eyJpIjoiMGMyNT...
)
Re: Hibernate Envers triggers wrong column type during validation (
https://hibernate.atlassian.net/browse/HHH-16192?atlOrigin=eyJpIjoiMGMyNT...
)
I have the same issue here.
We are trying to update to the most recent Hibernate 6.2.1 and are failing at the exact
same problem. We have a simple entity with a byte[] field annotated as lob. While ORM maps
this to a *varbinary(max)* on SQL-Server ENVERS contributes its audit table with a
*varbinary(255)*. I am debugging on this but it’s quite hard to understand the different
stages of meta model resolving along with the contributor contract. Moreover envers seems
to have its own definition of a column (org.hibernate.envers.boot.model.Column). I tracked
it down to
org.hibernate.boot.model.source.internal.hbm.ModelBinder.resolveLob(SingularAttributeSourceBasic,
SimpleValue) where the envers audit table has the typeName property set to
"binary" resolving to the sqlType -3 (varbinary) but the length is set to 255.
The entity model breaks down to this:
@Entity
@Table(name = "ByteData" )
@Audited
public class ByteData
{
@Id
@Access(AccessType.PROPERTY)
@Column(name = PROPERTY_ID, length = 36, nullable = false )
private String id = IdGenerator.generateId();
@Version
@Column(name = PROPERTY_VERSION)
private Integer version = null ;
@Column(name = "data" )
@Lob
private byte [] data;
...
}
(
https://hibernate.atlassian.net/browse/HHH-16192#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16192#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#100224- sha1:4684446 )