Hibernate mapping a composite key with null values

后端 未结 6 2082
栀梦
栀梦 2020-12-09 09:27

With Hibernate, can you create a composite ID where one of the columns you are mapping to the ID can have null values?

This is to deal with a legacy table that has a

6条回答
  •  孤城傲影
    2020-12-09 10:01

    You wont get error but Hibernate wont be able to map those rows with NULL value for composite column to your Entity. That means you get entity with NULL values in result.

提交回复
热议问题