Skip to content

HHH-14478 : Allow DialectResolvers to be discovered by ServiceLoader #3792

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

Closed

Conversation

sebersole
Copy link
Member

HHH-14478 : Allow DialectResolvers to be discovered by ServiceLoader

  • Note : the changes to org.hibernate.dialect.resolver.DialectFactoryTest were needed to make them pass. However, the failures were not caused by changes done in this work. They mostly likely "broke" when the initial Dialect clean up work was done. This test was part of the "filtered out" tests in terms of the Gradle build, so they would not show up on CI runs e.g. after those earlier changes

  • Note 2 : at least locally, the test org.hibernate.test.annotations.derivedidentities.bidirectional.OneToOneWithDerivedIdentityTest is failing the build even though it is outside of the filtered include package. No idea why that test gets picked up; nor why it just started now..

-
- Note : the changes to `org.hibernate.dialect.resolver.DialectFactoryTest` were needed to make them pass.  However, the failures were not caused by changes done in this work.  They mostly likely "broke" when the initial Dialect clean up work was done.  This test was part of the "filtered out" tests in terms of the Gradle build, so they would not show up on CI runs e.g. after those earlier changes

- Note 2 : at least locally, the test `org.hibernate.test.annotations.derivedidentities.bidirectional.OneToOneWithDerivedIdentityTest`  is failing the build even though it is outside of the filtered include package.  No idea why that test gets picked up; nor why it just started now..
Copy link
Member

@beikov beikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

public void addResolverAtFirst(DialectResolver... resolvers) {
// in reverse so that the first item in the incoming list is added
// to the first position in `this.resolutions`
for ( int i = resolvers.length - 1; i >= 0; i-- ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but could be done by using this.resolvers.addAll( 0, Arrays.asList( resolvers ) );

@beikov
Copy link
Member

beikov commented Mar 8, 2021

Note 2

I just fixed that. After a rebase this should be fine.

@sebersole
Copy link
Member Author

I just fixed that. After a rebase this should be fine.

curiosity sake... what was the issue?

@sebersole
Copy link
Member Author

Squashed, rebased and applied upstream

@sebersole sebersole closed this Mar 8, 2021
@sebersole sebersole deleted the topic/6-DialectProvider branch March 8, 2021 14:16
@gavinking
Copy link
Member

Excellent!

@beikov
Copy link
Member

beikov commented Mar 8, 2021

@sebersole actually org.hibernate.orm.test.sql.exec.onetoone.OneToOneWithDerivedIdentityTest failed due to the NotImplementedYetExtension running it's checks only after test execution, but the test already failed in the "before-lifecycle" because the EntityManagerFactory/SessionFactory was built eagerly. I switched to lazy building which now causes the failure to happen during the test run and the NotImplementedYetExtension to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants