-
Notifications
You must be signed in to change notification settings - Fork 3k
Create proxies for abstract entity classes too in Hibernate ORM #50426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/cc @gsmet (hibernate-orm) |
This replaces these logs: 2025-08-18 15:25:43,530 WARN [io.qua.hib.orm.run.pro.ProxyDefinitions] (main) Could not generate an enhanced proxy for entity 'io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity' (class='io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.MyAbstractEntity') as it's abstract. Your application might perform better if this class was non-abstract. 2025-08-18 15:25:44,075 WARN [org.hib.met.int.EntityRepresentationStrategyPojoStandard] (JPA Startup Thread) HHH000305: Could not create proxy factory for:io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity: org.hibernate.HibernateException: Could not lookup a pre-generated proxy class definition for entity 'io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity'. Falling back to enforced eager mode for this entity! at io.quarkus.hibernate.orm.runtime.customized.QuarkusProxyFactory.postInstantiate(QuarkusProxyFactory.java:60) [...] With these: 2025-08-18 16:03:26,754 WARN [org.hib.met.int.EntityRepresentationStrategyPojoStandard] (JPA Startup Thread) HHH000305: Could not create proxy factory for:io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity: org.hibernate.HibernateException: Could not lookup a pre-generated proxy class definition for entity 'io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$MyAbstractEntity' (class='io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.MyAbstractEntity'): this class is abstract. Your application might perform better if this class was non-abstract. at io.quarkus.hibernate.orm.runtime.customized.QuarkusProxyFactory.postInstantiate(QuarkusProxyFactory.java:77) [...] Also, this *might* prevent unnecessary warnings in some cases if our implementation of ProxyDefinitions#needsProxyGeneration turns out to have false positives, because in that case Hibernate ORM won't requrest the proxy class on bootstrap, and thus we won't log anything.
This comment has been minimized.
This comment has been minimized.
5d63b8d
to
b836f66
Compare
This comment has been minimized.
This comment has been minimized.
b836f66
to
81752f1
Compare
This comment has been minimized.
This comment has been minimized.
81752f1
to
05e0a71
Compare
Status for workflow
|
Fixes a problem reported by @mzellho (thank you!) here: we abstain from creating entity proxies for abstract classes at build time, but in practice... there is no reason to not create them.
The problem seems to have been introduced by mistake here when adding conditions to prevent the creation of proxies for final classes (which, indeed, simply cannot be proxied). It was made more visible by #49591 which revamped the warnings (and maybe added some?) and removed some fallback behavior that could generate proxies at static init.