JPA composite primary key with null value

后端 未结 1 1929
情话喂你
情话喂你 2021-01-11 13:12

I have a table containing customer data in an oracle database. Here is a simplified definition:

CUSTOMER (CUSTOMER_ID NUMBER NOT NULL,
          SOURCE_SYST         


        
相关标签:
1条回答
  • 2021-01-11 13:47

    Primary keys cannot contain null (in JPA or in databases). Use a different value such as "" or " ".

    Is the customer_id unique? if so then just remove the sourceSystem from the Id.

    Otherwise, you could try logging a bug to have support for null ids added.

    0 讨论(0)
提交回复
热议问题