Can you give me more info on mapping command "unique-key" for autogenerate database?
In books about hibernate i found not material about it..
My problem follows:
this are to table i have to map, but i prefer use hibernate autogenerate table.
CREATE TABLE `attributes` (
`Name` varchar(50) NOT NULL default '',
`Type` smallint(6) NOT NULL default '1',
`Column_` varchar(50) NOT NULL default '',
`Object` varchar(50) NOT NULL default '',
PRIMARY KEY (`Object`,`Name`),
CONSTRAINT `attributes_ibfk_1` FOREIGN KEY (`Object`) REFERENCES `objects` (`Name`) ON UPDATE CASCADE
) TYPE=InnoDB;
CREATE TABLE `fuzzyattributes` (
`Name` varchar(50) NOT NULL default '',
`Min_` float NOT NULL default '0',
`Max_` float NOT NULL default '0',
`variance` float NOT NULL default '0',
`Object` varchar(50) NOT NULL default '',
PRIMARY KEY (`Object`,`Name`),
CONSTRAINT `fuzzyattributes_ibfk_1` FOREIGN KEY (`Object`, `Name`) REFERENCES `attributes` (`Object`, `Name`) ON UPDATE CASCADE
) TYPE=InnoDB;
I create the mapping file adding an id entry for each table, making them primary key. So as you see the old primary key have to became at least unique each other (object & name). How can i map them?
I thought to use unique, but it realize only a one attribute key.
So i thought to "unique-key" and bind the to parameters.. it is the right path? How to realize?
tnk
|