ElementCollection « Key « JPA Q&A





1. Objects in JPA ElementCollection as keys    stackoverflow.com

I have a class User that can have many loginNames:

@Entity
public class User {

  @ElementCollection
  private List<String> logins = new ArrayList<String>();

}
I want to ensure that each login is unique in ...