Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » create-tables doesn't create foreign key constraints
create-tables doesn't create foreign key constraints [message #746153] Sun, 23 October 2011 08:18 Go to next message
Pablo  is currently offline Pablo Friend
Messages: 5
Registered: October 2009
Junior Member
Hi,

I just noticed that eclipselink is not generating the foreign key constraints for any table.

It does create indexes called FK_XXX_YYY (with the name the FK constraint would have)

See screensjot.

Env:
EL 2.3.0,
MySQL 5.something,
Ubuntu 11.04



Re: create-tables doesn't create foreign key constraints [message #748504 is a reply to message #746153] Mon, 24 October 2011 18:24 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

EclipseLink does create foreign keys (and does not create indexes unless specified). Turn logging on finest and look at the DDL generated, you will see the constraints created.

How did you create your tables?


James : Wiki : Book : Blog : Twitter
Re: create-tables doesn't create foreign key constraints [message #749678 is a reply to message #748504] Tue, 25 October 2011 11:14 Go to previous messageGo to next message
Pablo  is currently offline Pablo Friend
Messages: 5
Registered: October 2009
Junior Member
Thanks James,

I found out the MySQL on ubuntu uses MyISAM storage engine by default which silently ignores foreign key constraints...

U the same James that was answering my questions en toplink two years ago? Wink

If so, good to read you!
Re: create-tables doesn't create foreign key constraints [message #749681 is a reply to message #749678] Tue, 25 October 2011 11:15 Go to previous message
Pablo  is currently offline Pablo Friend
Messages: 5
Registered: October 2009
Junior Member
And i could have added that I sorted it out by switching to InnoDB storage engine
Previous Topic:using a sequence connection pool in eclipselink
Next Topic:Problems Executing Stored Procedure in DB2 with EclipseLink v1.2
Goto Forum:
  


Current Time: Thu Apr 18 07:32:11 GMT 2024

Powered by FUDForum. Page generated in 0.01379 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top