Primitive or wrapper for hibernate primary keys

后端 未结 3 627
眼角桃花
眼角桃花 2020-11-29 02:15

I\'ve been looking at various hibernate tutorials and samples, for their identity/primary key property, some use a Java primitive type, some uses the wrapper type, that is;<

3条回答
  •  有刺的猬
    2020-11-29 02:54

    You can specify your primary key as a primitive or a wrapper. And since usually the avantages of an Integer aren't needed, it's best to keep it simple with an int.

    More info at oracle.com.

提交回复
热议问题