[JIRA] (HHH-15772) deprecate @Target, @Proxy, @Polymorphism
by Gavin King (JIRA)
Gavin King ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-15772 ( https://hibernate.atlassian.net/browse/HHH-15772?atlOrigin=eyJpIjoiOTg5MW... )
Re: deprecate @Target, @Proxy, @Polymorphism ( https://hibernate.atlassian.net/browse/HHH-15772?atlOrigin=eyJpIjoiOTg5MW... )
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?
( https://hibernate.atlassian.net/browse/HHH-15772#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-15772#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100234- sha1:ac1edd4 )
1 year, 4 months
[JIRA] (HHH-15772) deprecate @Target, @Proxy, @Polymorphism
by Lars Hvile (JIRA)
Lars Hvile ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-15772 ( https://hibernate.atlassian.net/browse/HHH-15772?atlOrigin=eyJpIjoiYTU0ZG... )
Re: deprecate @Target, @Proxy, @Polymorphism ( https://hibernate.atlassian.net/browse/HHH-15772?atlOrigin=eyJpIjoiYTU0ZG... )
>
>
>
> The @Proxy annotation could, in principle, be useful, but I’m struggling to
> see how it’s supposed to be used in its current form. It feels like it
> would be more useful if it specified a list of proxied types, or perhaps
> if it were inverted so that you could exclude a type from the proxied
> types. Even then, I just struggle to see that anyone has a real need for
> this today. I think we can deprecate it for now, and if someone complains
> then we will get a chance to explore what their real use case is and how
> it’s best solved.
>
>
We’re using the annotation in an entity inheritance hierarchy to able to have final methods in the abstract class. Without the annotation we’re (still) getting an annoying warning at startup.
org.hibernate.HibernateException: Getter methods of lazy classes cannot be final
( https://hibernate.atlassian.net/browse/HHH-15772#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-15772#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100234- sha1:aec3a25 )
1 year, 4 months