Could you please describe some specific scenarios where BMP should be used? For join queries can we use CMP 2.0 ? Does Containers supports mapping in this case?
CMP is not portable across app servers but supports DB portability. BMP supports Application Server portability.
1.Override the equals() method to properly evaluate the equality of two primary keys by comparing values for each part of the composite key.
2.Override the Object.hashCode() method to return a unique number representing the hash code for the primary key instance. Ensure that the hash code is indeed unique when you use your primary key attribute values to compute the hash code.