Hi to all,
I'm using hibernate3-maven-plugin 2.1 to generate my ddl. Actually the only thing that does not work properly is a join table of a many-to-many relationship. My code is
Code:
@Entity
@Table(name="t_match")
public class Match {
...
@ManyToMany(targetEntity=SeasonTeamPlayer.class, cascade=CascadeType.ALL)
@JoinTable(name="j_seasonteamplayer_match",
joinColumns={@JoinColumn(name="match_id")},
inverseJoinColumns={@JoinColumn(name="seasonteamplayer_id")})
@ForeignKey(name="fk_a", inverseName="fk_b")
public List<SeasonTeamPlayer> getPlayers() {
return players;
}
...
}
@Entity
@Indexed
@Table(name="t_seasonteamplayer")
public class SeasonTeamPlayer {
...
@ManyToMany(cascade=CascadeType.ALL, mappedBy="players", targetEntity=Match.class)
public List<Match> getMatches() {
return matches;
}
...
}
All other sql data are correctly generated, but this join table not. I looked reference docs and googled a lot without success. Probably I was missing something but I cannot be able to find what.
Any hint?
TIA,
Daniele