-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: MySQLDialect.supportsCheck() - is it correct?
PostPosted: Thu Dec 16, 2004 6:43 pm 
Beginner
Beginner

Joined: Fri Aug 27, 2004 1:59 pm
Posts: 33
I cannot get mysql to accept the 'check' constraint on 'create table' as created by hbm2ddl. The mysql docs indicate that it is valid, but ignored by all storage engines.

I had to create my own subclass of MySQLDialect and override supportsCheck() to false to get my table auto drop-create to work.

But surely I must be doing something wrong, as nobody else seems to have this problem.

Any suggestions would be much appreciated.

Hibernate version:
2.1.7c

Name and version of the database you are using:
MySQL 4.1
Connector/J 3.0.16, 3.1.5-gamma-bin

The generated SQL (show_sql=true):
Code:
create table AccountNature (
   id bigint not null auto_increment,
   class varchar(255) not null,
   version integer not null,
   NATURE_TYPE_ID varchar(255) not null unique,
   ACCOUNT_ID bigint not null,
   primary key (id),
   check(all-delete-orphan)
)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 8:06 pm 
Beginner
Beginner

Joined: Fri Aug 27, 2004 1:59 pm
Posts: 33
(I seem to be answering all my own posts. Maybe its therapudic to post; only after which I can see my stupid mistakes.)

Well, the subclass of MySQLDialect was of course not needed. I had a [valid] typo my mapping. I was using 'check' instead of 'cascade' for a set. Only when when my functional test failed to save the inverse was I able to see what was wrong.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.