[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5452) Account for dialects which expect check constraints on table definition as opposed to on column definition
Steve Ebersole (JIRA)
noreply at atlassian.com
Mon Aug 9 15:24:40 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38013#action_38013 ]
Steve Ebersole commented on HHH-5452:
-------------------------------------
Specifically for the intentions here I think we can limit this to UNIQUE and CHECK constraints (RI is the other category).
Pretty trivial for UNIQUE constraints. The column variety:
{code}
create table XYZ (
...,
my_column UNIQUE
)
{code}
looks like the following:
{code}
create table XYZ (
...,
CONSTRAINT UNIQUE(my_column)
)
{code}
(note: ansi sql does say this form should name the constraint; need to see how enforced this is).
Little more tricky for CHECK constraints. The column variety:
{code}
create table XYZ (
...,
my_column CHECK(in 'a', 'b')
)
{code}
needs to become:
{code}
create table XYZ (
...,
CONSTRAINT CHECK (my_column in 'a', 'b')
)
{code}
(note the injection of column name into the check condition; pretty sure blind prepend is ok here though).
> Account for dialects which expect check constraints on table definition as opposed to on column definition
> ----------------------------------------------------------------------------------------------------------
>
> Key: HHH-5452
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5452
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Fix For: 3.6.0.Beta3
>
>
> ANSI SQL allows column constraints to be defined either on the table definition or on the column definition. Database dialects support varying degrees of that.
> We need to be able to account for both. Currently if we have constraints associated with the column in the metadata, and the dialect reports that it does not support constraints in the column definition we completely ignore them. Ideally if that is the case, but the dialect does support constraints in the table definition we should apply them there.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list