[JIRA] (HHH-16013) Lazy loading fails with "Generation of HibernateProxy instances at runtime is not allowed" when run as native
by jschauder (JIRA)
jschauder ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=61eece9... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNTlhMjQ1OWJm... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16013?atlOrigin=eyJpIjoiNTlhMj... ) HHH-16013 ( https://hibernate.atlassian.net/browse/HHH-16013?atlOrigin=eyJpIjoiNTlhMj... ) Lazy loading fails with "Generation of HibernateProxy instances at runtime is not allowed" when run as native ( https://hibernate.atlassian.net/browse/HHH-16013?atlOrigin=eyJpIjoiNTlhMj... )
Issue Type: Bug Assignee: Unassigned Created: 10/Jan/2023 06:44 AM Priority: Major Reporter: jschauder ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=61eece9... )
Reproducer code: https://github.com/theotherp/reproduce-bytecodeprovider-none ( https://github.com/theotherp/reproduce-bytecodeprovider-none ) (see http://readme.md ( http://readme.md ) )
In a Spring app compiled with Graalvm 22.3.0 loading an entity with a @OneToOne(fetch = FetchType.LAZY) fails with the following stack trace:
2023-01-06T09:56:16.246+01:00 ERROR 152864 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.orm.jpa.JpaSystemException: Generation of HibernateProxy instances at runtime is not allowed when the configure
d BytecodeProvider is 'none'; your model requires a more advanced BytecodeProvider to be enabled.] with root cause
org.hibernate.HibernateException: Generation of HibernateProxy instances at runtime is not allowed when the configured BytecodeProvider is 'none'; your model requires a more advanced BytecodeProvider to be enabled.
at org.hibernate.bytecode.internal.none.DisallowedProxyFactory.getProxy(DisallowedProxyFactory.java:34) ~[na:na]
at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:5001) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.createProxy(DefaultLoadEventListener.java:463) ~[na:na]
at org.hibernate.event.internal.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:453) ~[na:na]
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:357) ~[na:na]
at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:113) ~[na:na]
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:75) ~[na:na]
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:118) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1244) ~[na:na]
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1097) ~[na:na]
at org.hibernate.sql.results.graph.entity.internal.EntityDelayedFetchInitializer.resolveInstance(EntityDelayedFetchInitializer.java:164) ~[na:na]
at org.hibernate.sql.results.internal.StandardRowReader.coordinateInitializers(StandardRowReader.java:147) ~[na:na]
at org.hibernate.sql.results.internal.StandardRowReader.readRow(StandardRowReader.java:97) ~[na:na]
at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:198) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:33) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:443) ~[na:na]
at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:166) ~[na:na]
at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.list(JdbcSelectExecutorStandardImpl.java:91) ~[na:na]
at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:31) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.lambda$new$0(ConcreteSqmSelectQueryPlan.java:113) ~[na:na]
at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(ConcreteSqmSelectQueryPlan.java:335) ~[na:na]
at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(ConcreteSqmSelectQueryPlan.java:276) ~[na:na]
at org.hibernate.query.sqm.internal.QuerySqmImpl.doList(QuerySqmImpl.java:571) ~[na:na]
at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:363) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.hibernate.query.sqm.internal.QuerySqmImpl.list(QuerySqmImpl.java:1073) ~[na:na]
at org.hibernate.query.Query.getResultList(Query.java:94) ~[reproduce-bytecodeprovider-none.exe:6.1.6.Final]
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:405) ~[reproduce-bytecodeprovider-none.exe:3.0.0]
at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568) ~[reproduce-bytecodeprovider-none.exe:na]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:288) ~[na:na]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136) ~[reproduce-bytecodeprovider-none.exe:3.0.0]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120) ~[reproduce-bytecodeprovider-none.exe:3.0.0]
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:516) ~[reproduce-bytecodeprovider-none.exe:3.0.0]
at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285) ~[na:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:628) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:168) ~[na:na]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:77) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[na:na]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:163) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[na:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:218) ~[na:na]
at jdk.proxy4/jdk.proxy4.$Proxy48.findAll(Unknown Source) ~[na:na]
at com.example.reproducebytecodeprovidernone.EntityHandler.loadById(EntityHandler.java:25) ~[reproduce-bytecodeprovider-none.exe:na]
at com.example.reproducebytecodeprovidernone.RestController.load(RestController.java:22) ~[reproduce-bytecodeprovider-none.exe:na]
at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568) ~[reproduce-bytecodeprovider-none.exe:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:152) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1080) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:973) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1010) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:902) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:705) ~[reproduce-bytecodeprovider-none.exe:6.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:884) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814) ~[reproduce-bytecodeprovider-none.exe:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223) ~[na:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[reproduce-bytecodeprovider-none.exe:10.1.4]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[reproduce-bytecodeprovider-none.exe:6.0.3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) ~[na:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[na:na]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[reproduce-bytecodeprovider-none.exe:10.1.4]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119) ~[na:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[reproduce-bytecodeprovider-none.exe:10.1.4]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[na:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[na:na]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400) ~[na:na]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[reproduce-bytecodeprovider-none.exe:10.1.4]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:859) ~[na:na]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1734) ~[na:na]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[reproduce-bytecodeprovider-none.exe:10.1.4]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[na:na]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[na:na]
at java.base@17.0.5/java.lang.Thread.run(Thread.java:833) ~[reproduce-bytecodeprovider-none.exe:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[reproduce-bytecodeprovider-none.exe:na]
at org.graalvm.nativeimage.builder/com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:178) ~[na:na]
Related Spring issue: https://github.com/spring-projects/spring-framework/issues/29779 ( https://github.com/spring-projects/spring-framework/issues/29779 )
Related issue based on Quarkus: HHH-13804 ( https://hibernate.atlassian.net/browse/HHH-13804 ) Closed
( https://hibernate.atlassian.net/browse/HHH-16013#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16013#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#100213- sha1:cca7326 )
1 year, 11 months
[JIRA] (HV-1933) Performance issue for validating list with 20k elements
by Anatoliy Balakirev (JIRA)
Anatoliy Balakirev ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c62d60... ) *created* an issue
Hibernate Validator ( https://hibernate.atlassian.net/browse/HV?atlOrigin=eyJpIjoiYzJmM2FiMWUyZ... ) / Bug ( https://hibernate.atlassian.net/browse/HV-1933?atlOrigin=eyJpIjoiYzJmM2Fi... ) HV-1933 ( https://hibernate.atlassian.net/browse/HV-1933?atlOrigin=eyJpIjoiYzJmM2Fi... ) Performance issue for validating list with 20k elements ( https://hibernate.atlassian.net/browse/HV-1933?atlOrigin=eyJpIjoiYzJmM2Fi... )
Issue Type: Bug Affects Versions: 8.0.0.Final Assignee: Unassigned Components: performance, validators Created: 10/Jan/2023 06:29 AM Priority: Major Reporter: Anatoliy Balakirev ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5c62d60... )
We have a PUT REST endpoint, which accepts an autogenerated object, which is in fact a list of objects. We send a request there, which contains around 23k of elements. Elements in that list have a couple of concrete implementations, each has a couple of required fields and a list with a couple more elements of the same type. When hibernate validator is enabled on that endpoint - it takes somewhere between 30 and 50 seconds to validate everything. When I replace that validation with manually written methods - it takes around 0.5 seconds to validate the same. The sample project to reproduce this is here: https://github.com/anatoliy-balakirev/hibernate_validator_performance_issue ( https://github.com/anatoliy-balakirev/hibernate_validator_performance_issue )
If you are on Linux, just run the following command in the root of the project (make sure your JAVA_HOME points to Java 17):
./mvnw clean test
Or this on Windows:
./mvnw.cmd clean test
And you’ll see these logs:
2023-01-10T15:17:32.316+01:00 INFO 18248 --- [ main] com.example.demo.DemoControllerTest : Sending '/endpoint_with_explicit_validation' request...
2023-01-10T15:17:32.643+01:00 INFO 18248 --- [o-auto-1-exec-1] com.example.demo.DemoFilter : Got into filter
2023-01-10T15:17:33.419+01:00 INFO 18248 --- [o-auto-1-exec-1] com.example.demo.DemoController : Got into the controller with explicit validation, amount of elements in the request: 23489
2023-01-10T15:17:33.503+01:00 INFO 18248 --- [ main] com.example.demo.DemoControllerTest : It took 1187ms to execute the '/endpoint_with_explicit_validation' request
2023-01-10T15:17:33.572+01:00 INFO 18248 --- [ main] com.example.demo.DemoControllerTest : Sending '/endpoint_with_validation' request...
2023-01-10T15:17:33.607+01:00 INFO 18248 --- [o-auto-1-exec-2] com.example.demo.DemoFilter : Got into filter
2023-01-10T15:18:09.510+01:00 INFO 18248 --- [o-auto-1-exec-2] com.example.demo.DemoController : Got into the controller with validation, amount of elements in the request: 23489
2023-01-10T15:18:09.512+01:00 INFO 18248 --- [ main] com.example.demo.DemoControllerTest : It took 35940ms to execute the '/endpoint_with_validation' request
2023-01-10T15:18:09.534+01:00 INFO 18248 --- [ main] com.example.demo.DemoControllerTest : Sending '/endpoint_without_validation' request...
2023-01-10T15:18:09.584+01:00 INFO 18248 --- [o-auto-1-exec-3] com.example.demo.DemoFilter : Got into filter
2023-01-10T15:18:09.637+01:00 INFO 18248 --- [o-auto-1-exec-3] com.example.demo.DemoController : Got into the controller without validation, amount of elements in the request: 23489
2023-01-10T15:18:09.638+01:00 INFO 18248 --- [ main] com.example.demo.DemoControllerTest : It took 104ms to execute the '/endpoint_without_validation' request
Which are basically about running three tests:
* endpoint_with_explicit_validation - validation is done with manually written method
* endpoint_with_validation - validation is done using Hibernate Validator
* endpoint_without_validation - no validation at all
If you want to see what exactly is being validated - uncomment this line: https://github.com/anatoliy-balakirev/hibernate_validator_performance_iss... ( https://github.com/anatoliy-balakirev/hibernate_validator_performance_iss... )
I’m using the latest Spring Boot version (3.0.1), Java 17.0.5 (Amazon Corretto) and Maven 3.8.6
P.S. I’m not sure if this should be a Bug or rather an Improvement, so left the default one there.
( https://hibernate.atlassian.net/browse/HV-1933#add-comment?atlOrigin=eyJp... ) Add Comment ( https://hibernate.atlassian.net/browse/HV-1933#add-comment?atlOrigin=eyJp... )
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#100213- sha1:cca7326 )
1 year, 11 months
[JIRA] (HHH-15996) Create an abstraction over Annotation for annotation processing
by Steve Ebersole (JIRA)
Steve Ebersole ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMmMzY2JmZWI2... ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-15996?atlOrigin=eyJpIjoiMmMzY2... ) HHH-15996 ( https://hibernate.atlassian.net/browse/HHH-15996?atlOrigin=eyJpIjoiMmMzY2... ) Create an abstraction over Annotation for annotation processing ( https://hibernate.atlassian.net/browse/HHH-15996?atlOrigin=eyJpIjoiMmMzY2... )
Change By: Steve Ebersole ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
At the moment, annotation processing uses HCANN.
HCANN provides an abstraction from , however, does not play well with models where there is not a 1-1 correspondence between managed-type and Class .
Initially, the domain thought was to reuse HCANN’s model abstraction classes (XClass , XProperty, etc) but exposes {{Annotation}} directly build them within ORM itself for these cases. However, those classes are not very good at modeling these concepts at the moment and would require changes to HCANN.
Ultimately Relatedly, we ultimately want to move away migrate from HCANN to use Jandex for reading the annotation details. Jandex uses also exposes abstraction over Class - {{ClassInfo}}, etc. It also exposes an abstraction from {{Annotation}} in the form of {{AnnotationInstance}}. Ultimately this move to Jandex will require lots of changes to that code.
{{org.hibernate.boot.model.source}} was developed as an abstraction over the source Given all of mapping information - annotations that , {{orm.xml}}, {{hbm.xml}} with the initial intent of unifying the processing of mapping sources.
This better solution there is already how {{hbm to create an abstraction in ORM itself. xml}} is processed. This work would apply that abstraction can be used to annotations and {{orm.xml}} processing as well.
The approach has benefits in addition to not only abstract the processing unification, such as -
# Avoiding use Class information but also the source of library APIs in processing that Class information (HCANN v. Ultimately we want to move to Jandex over HCANN for annotation consumption - see ). That work will be done under [https://hibernate.atlassian.net/browse/HHH- 9489 15698 |https://hibernate.atlassian.net/browse/HHH- 9489 15698 |smart-link]. Using this abstraction will make that migration much simpler.
# Allows support for both dynamic models (MAP mode) and {{entity-name}} models. This is important for deprecation of {{hbm.xml}} in favor of annotations / {{orm.xml}} - see [https://hibernate.atlassian.net/browse/HHH- 15698 15997 |https://hibernate.atlassian.net/browse/HHH- 15698 15997 |smart-link].
Given that we will be abstracting the managed-types, we also have an opportunity to decide about how to deal with annotations. Specifically, whether we want to continue using {{Annotation}} from HCANN or use an abstraction. This issue is about creating that abstraction.
( https://hibernate.atlassian.net/browse/HHH-15996#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-15996#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#100213- sha1:cca7326 )
1 year, 11 months