Yeah, right, so that’s exactly the legit usecase from @Proxy, but if we are going to revive the annotation for this usecase, then I would redesign it so that you could just write:
@Entity @Proxy(MyInterface.class)
class MyEntity implements MyInterface {
...
}
But really, it just all seems a bit silly to me! The easiest solution for you guys is to just remove those final annotations, as required by the JPA spec:
The entity class must not be final. No methods or persistent instance variables of the entity class may be final.
and then there’s no reason for futzing about with specifying the proxy type explicitly. That’s the way Hibernate’s supposed to be used. Why make your own life more difficult? Why tie yourself in knots over nothing? |