And won't this work to put an array with 2 elements as a member of the set? I.e:.
Set<int[]> s = new HashSet<int[]>(); s.add(new int[] {1,2}); s.add(new int[] {3,4});
or create a CandidateKey class that has two fields and custom methods equals() and hashCode() ?
Thatβs all said, are you sure you want to process object-relational mapping (mapping from database to objects) yourself, and not use a library like Hibernate or EclipseLink?
Bozho source share