When I try to auto-generate my entity classes, hibernate tools generates the many to many class and doesn't make the generation many to many. These are my tables:
CREATE TABLE `role`(
`id` int(13) not null auto_increment,
name varchar(255),
primary key(id)
);
CREATE TABLE `user`(
`id` int(13) not null auto_increment,
`username` varchar(255),
`password` CHAR(60) CHARACTER SET latin1 COLLATE latin1_bin,
`passwordconfirm` BIT(1) DEFAULT b'0',
primary key(id)
);
CREATE TABLE `role_user`(
`role_id` int(13) not null,
`user_id` int(13) not null,
CONSTRAINT `FK_User_Role` FOREIGN KEY (`role_id`) REFERENCES `role`(`id`),
CONSTRAINT `FK_Role_User` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`)
);
And these are my clases:
And in the classes, they have their relations mapped one to many. I have set the "auto detect many to many relations" option active, so, I don't know what's the problem with this.
Any help? Thanks in advance!