I have a table containing customer data in an oracle database. Here is a simplified definition:\[code\]CUSTOMER (CUSTOMER_ID NUMBER, SOURCE_SYSTEM VARCHAR2(30), FULL_NAME VARCHAR2(360), PHONE_NUMBER VARCHAR2(240) )\[/code\]The primary key for this table is \[code\](CUSTOMER_ID, SOURCE_SYSTEM)\[/code\].The table has numerous rows for which \[code\]SOURCE_SYSTEM\[/code\] is null. At the database level, there is no issue, however when I try to access any of these rows via JPA Entity, it causes a number of issues:1: Using \[code\]em.find()\[/code\] to fetch a row with a null \[code\]SOURCE_SYSTEM\[/code\] always results in a null being returned.2: Using \[code\]em.merge()\[/code\] to upsert a row with a null \[code\]SOURCE_SYSTEM\[/code\] succeeds if the record does not exist in the table, but fails on subsequent updates because the merge ALWAYS results in an insert being run.3: Using \[code\]em.createQuery()\[/code\] to explicitly query for a row with a null causes the following exception:\[code\]Exception [EclipseLink-6044] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.QueryExceptionException Description: The primary key read from the row [ArrayRecord(CUSTOMER.CUSTOMER_ID => 1CUSTOMER.FULL_NAME => GUY PERSONCUSTOMER.PHONE_NUMBER => 555-555-1234CUSTOMER.SOURCE_SYSTEM => null)] during the execution of the query was detected to be null. Primary keys must not contain null.Query: ReadAllQuery(referenceClass=Customer sql="SELECT CUSTOMER_ID, FULL_NAME, PHONE_NUMBER, SOURCE_SYSTEM FROM CUSTOMER WHERE ((CUSTOMER_ID = ?) AND (SOURCE_SYSTEM IS NULL))")\[/code\]Unfortunately, "Primary keys must not contain null" seems pretty final. I was unable to find too much information on workarounds for this error, which makes it seem like there is no solution. THE QUESTION: I would like to know if anyone has any Java code-based solution that don't involve making changes to the database. My current workaround is to use \[code\]ROW_ID\[/code\] as the \[code\]@Id\[/code\] of the table, but this means I can no longer use \[code\]em.merge()\[/code\] or \[code\]em.find()\[/code\].Here are my Java classes:Customer.java:\[code\]@Entity@Table(name = "CUSTOMER")public class Customer implements Serializable { private static final long serialVersionUID = 1L; @EmbeddedId private Customer_Id key; @Column(name = "CUSTOMER_ID", nullable = false, insertable = false, updatable = false) private Long customerId; @Column(name = "SOURCE_SYSTEM", length = 30, insertable = false, updatable = false) private String sourceSystem; @Column(name = "FULL_NAME", length = 360) private String fullName; @Column(name = "PHONE_NUMBER", length = 240) private String phoneNumber; //Setters, Getters, etc ...}\[/code\]Customer_Id.java\[code\]@Embeddablepublic class Customer_Id implements Serializable { private static final long serialVersionUID = 1L; @Column(name = "CUSTOMER_ID", nullable = false) private Long customerId; @Column(name = "SOURCE_SYSTEM", length = 30) private String sourceSystem; //Setters, Getters, etc ...}\[/code\]