Hibernate version: 3.2.2ga
Full stack trace of any exception that occurs: org.hibernate.cfg.JDBCBinderException: Duplicate names found for primarykey. Existing name: GroupID JDBC name: SpotID on table org.hibernate.mapping.Table(test.TESTING.SpotGroup)
Name and version of the database you are using: SQLAnywhere 9.0.2.3342
We have a very simple bidirectional many-to-many relationship defined as follows:
Code:
create table Spot (SpotID integer not null default autoincrement primary key);
create table SpotGroup (SpotID integer not null, GroupID integer not null, primary key (SpotID, GroupID));
create table Group (GroupID integer not null default autoincrement primary key);
alter table SpotGroup
add foreign key FK_SPOTGROUP_REFERENCE_SPOT (SpotID)
references Spot (SpotID)
on update restrict
on delete restrict;
alter table SpotGroup
add foreign key FK_SPOTGROUP_REFERENCE_GROUP (GroupID)
references Group (GroupID)
on update restrict
on delete restrict;
When we run hbm2hbmxml, we get the JDBCBinderException above. Is this a configuration issue on our side or a restriction of the reverse engineering toolset?