开发者

Why JPA entity class and its methods must not be declared final?

I think that it makes sense for the entity variables to not be final as they are synchronized with the DB, but why for clas开发者_如何学编程s and methods ??


Because persistence providers make proxies of objects using some library like CGLIB or javassist. These proxies are creating runtime subclasses of the entities. That's why they should not be final.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜