Hi
I have a problem with hbm2ddl.
For the mapping
Code:
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@OnDelete(action = OnDeleteAction.CASCADE)
public Planet getPlanetFrom() {
return this.planetFrom;
}
the corresponding ddl is what i expect, ie
Code:
alter table public.Fleet_log
add constraint FKEF7398B38FDF8617
foreign key (planetFrom_id)
references public.Planet
on delete cascade;
But on the mapping
Code:
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@OnDelete(action = OnDeleteAction.CASCADE)
public Player getPlayerFrom() {
return this.playerFrom;
}
the generated ddl is
Code:
alter table public.Fleet_log
add constraint FKEF7398B33F4531F7
foreign key (playerFrom_id)
references public.Player;
The "on delete cascade" is not generated in this case, although the same mapping.
So, what is the (hidden) criteria for hbm2ddl for "on delete cascade" generation?
Thanks in advance