How to use “size” as a field name in a hibernate/jpa entity?

后端 未结 2 858
暗喜
暗喜 2021-01-23 00:17

I have two JPA entities : VirtualLot and VirtualFiles. VirtualFiles extends VirtualInode. There is a ManyToMany relation betw

2条回答
  •  借酒劲吻你
    2021-01-23 00:51

    size is a reserved keyword like default or for in Java. Therefore either change your name for your variable in perhabs nodeSize or use the @Column(name = "nodeSize") Annotation with the name attribute to give a basic column a special name.

提交回复
热议问题