开发者

hibernate, inherit all entities from a @MappedSuperClass

开发者 https://www.devze.com 2023-01-26 05:36 出处:网络
i want set some fields, like updateDate, createDate and deleteDate, for each my entities, so i thought to inherit my entities from a @MappedSuperClass that contains this properties.

i want set some fields, like updateDate, createDate and deleteDate, for each my entities, so i thought to inherit my entities from a @MappedSuperClass that contains this properties.

开发者_运维知识库

Is this a good pratice?

In what way you work for this kind of request?

Thanks.


Yes this is what I do. I have a "BasicEntity" abstract class that is the superclass of all my entities and has fields like id, creationDate, uuid and implementations of hashCode and equals etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消