Hibernate Many-To-One Foreign Key Default 0

后端 未结 3 923
悲&欢浪女
悲&欢浪女 2020-12-18 03:11

I have a table where the the parent object has an optional many-to-one relationship. The problem is that the table is setup to default the fkey column to 0.

When s

3条回答
  •  [愿得一人]
    2020-12-18 04:05

    I think you are using primitive type as your primary/foreign key columns in your object. If yes then try using wrapper classes. Because primitive types can't have default values as null.

提交回复
热议问题