Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-363
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-363
Summary: Constraint.java does not support CascadeConstraintsString
Type: Bug
Status: Unassigned
Priority: Major
Project: Hibernate2
Components:
core
Versions:
2.1 beta 3
Assignee:
Reporter: ron lussier
Created: Thu, 25 Sep 2003 1:38 PM
Updated: Thu, 25 Sep 2003 1:38 PM
Environment: Mac OS X, Frontbase
Description:
In order to properly support SQL92, a change is required to allow the 'alter table ... drop constraint' statement to take a drop behavior. This change affects net.sf.hibernate.mapping.Constraint.java, line 43. I would like the line to read:
return "alter table " + getTable().getQualifiedName(dialect) +
" drop constraint " + getName() +
dialect.getCascadeConstraintsString();
Frontbase (the dialect I contributed) requires either 'CASCADE' or 'RESTRICT' in a drop constraint clause. (Frontbase is VERY SQL/92 standard, sometimes annoyingly.) Isn't this what the dialect.getCascadeConstraintsString() property is for? (The documentation for the property reads 'Completely optional cascading drop clause'.)
According to the documentation for SQL/92 (from http://www.contrib.andrew.cmu.edu/~shadow/sql/sql2bnf.aug92.txt), the syntax should be:
<alter table statement> ::=
ALTER TABLE <table name> <alter table action>
<alter table action> ::=
<add column definition>
| <alter column definition>
| <drop column definition>
| <add table constraint definition>
| <drop table constraint definition>
<drop table constraint definition> ::=
DROP CONSTRAINT <constraint name> <drop behavior>
<drop behavior> ::= CASCADE | RESTRICT
The requirement of CASCADE or RESTRICT is also affirmed in "A Guide to the SQL Standard", Fourth Edition, on page 106, where the syntax is given as:
base-table-alteration
::= ALTER TABLE base-table base-table-alteration-action
base-table-alteration-action
::= column-alteration-action
| base-table-constraint-alteration-action
base-table-constraint-alteration-action
::= ADD base-table-constraint-definition
| DROP CONSTRAINT constraint { RESTRICT | CASCADE }
On page 38 of the same volume, under 'Notation', the book states "Braces '{' and '}' are used to indicate that the material enclosed in those braces consists of a set of two or more items (separated by vertical bars) from which exactly one is to be chosen.
If you would prefer, I would be fine with creating a new, optional property of Dialect.java for this purpose, but I think that Hibernate needs something.
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|