I have a two-column primary key in a database that I need to model with a spring mvc application using hibernate 4.2 and jpa. From what I read online, it seems that my composite key class `ConceptPK` must include a hashcode method. The problem is that one of the two elements of the primary key is a BigInteger data type, but the default return type of the hashcode() method is int. This is causing eclipse to give an error message below indicating that the program will not compile because I have the wrong return type for the hashcode method. 

**Do I need a `hashcode` method? And what do I have to do to the code below to get it to compile with a properly functioning composite key `ConceptPK`?** 

```
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

@Embeddable
class ConceptPK implements Serializable {

@Column(name="id", nullable=false)
protected BigInteger id;

@Column(name="effectiveTime", nullable=false)
@Type(type="org.jadira.usertype.dateandtime.joda.PersistentDateTime")
private DateTime effectiveTime;

public ConceptPK() {}
public ConceptPK(BigInteger bint, DateTime dt) {
    this.id = bint;
    this.effectiveTime = dt;
}

/** getters and setters **/
public DateTime getEffectiveTime(){return effectiveTime;}
public void setEffectiveTime(DateTime ad){effectiveTime=ad;}

public void setId(BigInteger id) {this.id = id;}
public BigInteger getId() {return id;}

public boolean equals(Object o) { 
    return ((o instanceof ConceptPK) && 
            effectiveTime.equals(((ConceptPK)o).getEffectiveTime()) &&
            id == ((ConceptPK) o).getId());
}

public int hashCode() { 
    BigInteger sum = BigInteger.valueOf(
            effectiveTime.hashCode()
            );
    sum.add(id); 
    return sum;//this line has error message indicating wrong return data type
}
}  

```

Here is the code for the class that uses ConceptPK as its primary key: 

```
@Entity
@Table(name = "tablename")
public class Concept implements Serializable{

    @EmbeddedId
    @AttributeOverrides({
        @AttributeOverride(name="id", column=@Column(name="id")),
        @AttributeOverride(name="effectiveTime", column=@Column(name="effectiveTime"))
    })
    private ConceptPK conceptPK;

    //lots of other stuff
}

```