1 package org.hibernate.test.hql; 3 4 import java.io.Serializable ; 5 6 11 public class CrazyCompositeKey implements Serializable { 12 private Long id; 13 private Long otherId; 14 15 public Long getId() { 16 return id; 17 } 18 19 public void setId(Long id) { 20 this.id = id; 21 } 22 23 public Long getOtherId() { 24 return otherId; 25 } 26 27 public void setOtherId(Long otherId) { 28 this.otherId = otherId; 29 } 30 31 public boolean equals(Object that) { 32 CrazyCompositeKey cck = (CrazyCompositeKey) that; 33 return cck.id.longValue() == id.longValue() 34 && cck.otherId.longValue() == otherId.longValue(); 35 } 36 37 public int hashCode() { 38 return id.hashCode() + otherId.hashCode(); 39 } 40 } 41 | Popular Tags |