Margot Piva (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *commented* on HHH-16895 (
https://hibernate.atlassian.net/browse/HHH-16895?atlOrigin=eyJpIjoiMmRlYT...
)
Re: @Check constraint not generated when annotated on entity (
https://hibernate.atlassian.net/browse/HHH-16895?atlOrigin=eyJpIjoiMmRlYT...
)
Here is a minimal test-case :
https://github.com/MargotPiva/hibernate-test-case-templates/commit/7e7439...
Beware that issues does not trigger a test failure. Issue is shown by log output.
The difference between both hibernate versions is shown by the logs of DDL schema
generated on junit test startup.
# Entity-level check constraint is generated
mvn -f hibernate-orm-5/ test
# Log generated
create table EntityLevelCheck (
id bigint not null,
myValue varchar(255),
primary key (id),
check (myValue <> null)
)
# Entity-level check constraint is not generated
mvn -f hibernate-orm-6/ test
# Log generated
create table EntityLevelCheck (
id bigint not null,
myValue varchar(255),
primary key (id)
)
The field-level problem in Hibernate 5 is also illustrated by the tests :
# Field-level check constraint is not generated
mvn -f hibernate-orm-5/ test
# Log generated
create table FieldLevelCheck (
id bigint not null,
myValue varchar(255),
primary key (id)
)
# Field-level check constraint is generated
mvn -f hibernate-orm-6/ test
# Log generated
create table FieldLevelCheck (
id bigint not null,
myValue varchar(255) check (myValue <> null),
primary key (id)
)
(
https://hibernate.atlassian.net/browse/HHH-16895#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16895#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#100229- sha1:634ba05 )