Entity members should they be primitive data types or java data types?

前端 未结 3 842
死守一世寂寞
死守一世寂寞 2021-02-05 03:12

Is there a difference in declaring the enabled variable as Boolean or boolean? Which is preferable from a memory footprint perspective.

@Entity
class User {

            


        
3条回答
  •  死守一世寂寞
    2021-02-05 03:54

    They'll both map to the same column type.

    From a memory perspective, a primitive would probably be a little lighter, but the difference is almost certainly going to be negligible.

    I think a primitive would make it non-nullable, but you could also do that with an annotation.

提交回复
热议问题