Description:
|
Test case: o.h.test.annotations.target.TargetTest
Support annotated many-to-many Map associations, including @ManyToMany's targetEntity, @MapKeyClass, etc.
H4 creates the following DDL:
{quote} 17:26:03,177 DEBUG SQL:104 - create table Brand (id bigint not null, primary key (id)) 17:26:03,181 DEBUG SQL:104 - create table Brand_LuggageImpl (Brand_id bigint not null, name varchar(255) not null, luggagesBySize_id bigint not null, primary key (Brand_id, name)) 17:26:03,182 DEBUG SQL:104 - create table LuggageImpl (id bigint not null, height double not null, name varchar(255), width double not null, primary key (id)) 17:26:03,182 DEBUG SQL:104 - alter table Brand_LuggageImpl add constraint FK6B940A7E305BB4BE foreign key (luggagesBySize_id) references LuggageImpl 17:26:03,189 DEBUG SQL:104 - alter table Brand_LuggageImpl add constraint FK6B940A7ECF0A685D foreign key (Brand_id) references Brand {quote}
H5 currently does this:
{quote} 17:35:41,860 DEBUG SQL:104 - create table Brand_LuggageImpl (luggagesBySize bigint not null, primary key (luggagesBySize)) 17:35:41,860 DEBUG SQL:104 - create table LuggageImpl (id bigint not null, height double, width double, name varchar(255), primary key (id)) 17:35:41,861 DEBUG SQL:104 - create table Brand (id bigint not null, primary key (id)) 17:35:41,861 DEBUG SQL:104 - alter table Brand_LuggageImpl add constraint FKEC97A5E5ECB9DFD foreign key (luggagesBySize) references Brand 17:35:41,863 DEBUG SQL:104 - alter table Brand_LuggageImpl add constraint FKEC97A5E77D400E foreign key (luggagesBySize) references LuggageImpl {quote}
* SizeImpl is @Embeddable and SizeImpl#name should be bound to the join table * Brand PK needs bound to the join table *
join table PKs should be Brand_id and Size name * Brand FK is incorrect
|