Hi

I sent a post recently (too detailed obviously, since noone has
commented on it :-) regarding some features we require that hibernate is
currently not implementing. So here goes again, one more descriptive
post per feature.

One of those is explicitly named primary key constraints. The basic
theory is that instead of primary keys being declared in a DDL in a
manner such as:

create table y
   k number(19,0),
   f varchar(2),
primary key(k)

it should be possible to declare as

create table y
   k number(19,0),
   f varchar(2),
constraint pk_y primary key(k)

This is a syntax supported by many databases, at least Oracle, DB2 and
HSQLDB (those I have tested).

For starters, hbm.xml files need a place to store the primary key name.
Primary keys are associated with
id elements in Hibernate (id, composite-id), so it seems
straightforward to associate a "primary-key" attribute
to those elements. 

We then need code changes to bind those attributes and make them
available for DDL generation. This almost
certainly means an addition to the Dialect class as well.

Please let me know if I'm not approaching this from the right angle...

Thanks

-Gudlaugur Egilsson


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to