I am trying to do the following:
@javax.persistence.Entity public class Account { @Unique() private String name; @Unique(members={"SalesforceID","sport"}) private String SalesforceID; private String sport; ... }
The first Unique constraint works. On commit, an exception is thrown if an Account already exists with the specified name.
The second does not seem to work. I would expect an exception to be thrown if the combination of SalesforceID and sport is not unique. Am I doing this right?
Thanks,
Carl