Working on some legacy hibernate code.
How do I do the following with hbm.xml(hibernate mapping file) instead of with annotations?
@Table(name="users", uniqueConstraints = {
@UniqueConstraint(columnNames={"username", "client"}),
@UniqueConstraint(columnNames={"email", "client"})
})
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private int id;
private String username;
private String email;
private Client client;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…