package quba.models; import javax.persistence.Embeddable; import java.io.Serializable; @Embeddable public class QubaStationProfilePK implements Serializable{ public Long stationid; public Integer session; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; QubaStationProfilePK that = (QubaStationProfilePK) o; if (stationid != null ? !stationid.equals(that.stationid) : that.stationid != null) return false; return session != null ? session.equals(that.session) : that.session == null; } @Override public int hashCode() { int result = stationid != null ? stationid.hashCode() : 0; result = 31 * result + (session != null ? session.hashCode() : 0); return result; } @Override public String toString() { return "@" + Integer.toHexString(hashCode()) + " QubaStationProfilePK{" + "stationid=" + stationid + ", session=" + session + '}'; } }