Why JPA Entity or Hibernate Persistence Class Should Not be Final?
Yes, a Hibernate Entity class can be declared final, however it is not a good practice.
Hibernate uses the proxy pattern for performance improvement during lazy association, by making an entity final, Hibernate will no longer be able to use a proxy as Java doesn’t allow the final class to be extended.
Important points to about Entity class, Final, and Proxying
Hibernate doesn’t create a proxy for final class, instead, they use the real class, but Hibernate does create a proxy for a non-final class with final methods.
3) As per Hibernate documentation, if you’re going to make a class final you should explicitly disable proxy generation by adding @Proxy(lazy=false), but I haven’t noticed any differences between doing that and just making the class final.