我有这样的ManyToMany
映射:
@XmlTransient
@ManyToMany(cascade = {CascadeType.ALL})
@JoinTable(name = "users_clients",
joinColumns = {@JoinColumn(name = "user_id")},
inverseJoinColumns = @JoinColumn(name = "client_id"))
public List<Client> getClients() {
return clients;
}
另一边:
@ManyToMany(mappedBy = "clients")
private List<User> users = new ArrayList<User>();
所以你可以看到我有JoinColumn name = user_id
,client_id
但是休眠将这些列映射为名称 userS_id 和 clientS_id 作为它们的表名。为什么会这样?有什么建议么?