-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-19010 get rid of inheritance of SessionFactoryImplementor from query creation context stuff #9565
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
…ery creation context stuff Let's make the NodeBuilder the thing that is the SqmCreationContext, and introduce a new thing that performs a similar role for SqlAstCreationContext. The reason here is twofold: - it is part of my long struggle to decouple query parsing/typing from the SessionFactory, in order to make HibernateProcessor less of a hack and I guess more robust - SessionFactoryImplementor was already starting to be polluted with weird little operations that didn't belong there. That will only get worse with time.
| false, | ||
| true, | ||
| factory | ||
| converter.getCreationContext().getSessionFactory() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
| .buildSelectTranslator( converter.getCreationContext().getSessionFactory(), new SelectStatement( fakeQuery ) ); | ||
| final SqlAstTranslator<JdbcOperationQuerySelect> translator = | ||
| creationContext.getDialect().getSqlAstTranslatorFactory() | ||
| .buildSelectTranslator( creationContext.getSessionFactory(), new SelectStatement( fakeQuery ) ); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
| final JdbcEnvironment jdbcEnvironment = factory.getJdbcServices().getJdbcEnvironment(); | ||
| //noinspection deprecation | ||
| return jdbcEnvironment.getQualifiedObjectNameFormatter(); | ||
| return getJdbcEnvironment().getQualifiedObjectNameFormatter(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
JdbcEnvironment.getQualifiedObjectNameFormatter
| canUseInnerJoins, | ||
| getFunctionRenderer().rendersIdentifierVariable( arguments, walker.getCreationContext().getSessionFactory() ), | ||
| getFunctionRenderer() | ||
| .rendersIdentifierVariable( arguments, walker.getCreationContext().getSessionFactory() ), |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
| */ | ||
| default void validate(List<? extends SqmTypedNode<?>> arguments, String functionName, TypeConfiguration typeConfiguration) {} | ||
| default void validate(List<? extends SqmTypedNode<?>> arguments, String functionName, BindingContext bindingContext) { | ||
| validate( arguments, functionName, bindingContext.getTypeConfiguration() ); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
ArgumentsValidator.validate
| final SessionFactoryImplementor sessionFactory = creationContext.getSessionFactory(); | ||
| final QueryEngine queryEngine = sessionFactory.getQueryEngine(); | ||
| return queryEngine.getSqmFunctionRegistry().findFunctionDescriptor( "coalesce" ) | ||
| final QueryEngine queryEngine = creationContext.getSessionFactory().getQueryEngine(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
hibernate-core/src/main/java/org/hibernate/sql/ast/spi/SqlAstCreationContext.java
Fixed
Show fixed
Hide fixed
hibernate-core/src/main/java/org/hibernate/sql/ast/spi/SqlAstCreationContext.java
Fixed
Show fixed
Hide fixed
| } | ||
|
|
||
| default WrapperOptions getWrapperOptions() { | ||
| return getSessionFactory().getWrapperOptions(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
| LoadQueryInfluencers getLoadQueryInfluencers(); | ||
|
|
||
| default SqmCreationContext getSqmCreationContext() { | ||
| return getCreationContext().getSessionFactory().getQueryEngine().getCriteriaBuilder(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
| * Obtain the {@link SqmFunctionRegistry}. | ||
| */ | ||
| default SqmFunctionRegistry getSqmFunctionRegistry() { | ||
| return getSessionFactory().getQueryEngine().getSqmFunctionRegistry(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
| * Obtain the {@link Dialect}. | ||
| */ | ||
| default Dialect getDialect() { | ||
| return getSessionFactory().getQueryEngine().getDialect(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
SqlAstCreationContext.getSessionFactory
to show how it's used
Let's make the
NodeBuilderthe thing that is theSqmCreationContext, and introduce a new thing that performs a similar role forSqlAstCreationContext. The reason here is twofold:SessionFactory, in order to makeHibernateProcessorless of a hack and I guess more robustSessionFactoryImplementorwas already starting to be polluted with weird little operations that didn't belong there. That will only get worse with time.[Please describe here what your change is about]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-19010