JPA Query returning nulls - Composite Key with null column
问题 I have a legacy database (Cobol files actually) that I am accessing using a proprietary JDBC driver with Hibernate/JPA. The Entity has a composite primary key with 2 columns: CODE and SITE . In the legacy data there are records for the same CODE that can have either a specific value for SITE , or there can be a record with NULL in the SITE column which represents 'All Sites'. The theory of this file is, if you cannot find the CODE for your specific SITE then you lookup the record with NULL in