Skip to content
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

Migrate from extending EmptyInterceptor to implementing Interceptor/StatementInspector #39

Merged
merged 13 commits into from
Oct 8, 2024

Conversation

Laurens-W
Copy link
Contributor

@Laurens-W Laurens-W commented Sep 27, 2024

What's changed?

Added recipe to go from extends EmptyInterceptor to implements Interceptor and potentially StatementInspector too.
Create declarative hibernate 6_0 recipe and move things from 6_1 that could/should be done for 6_0 as well.

Anyone you would like to review specifically?

@timtebeek

Any additional context

The Interceptor interface received defaults implementations hence why they didn't need a "NOOP" implementation anymore
https://docs.jboss.org/hibernate/orm/6.0/javadocs/org/hibernate/resource/jdbc/spi/StatementInspector.html
https://stackoverflow.com/questions/75172581/error-org-hibernate-emptyinterceptor-is-deprecated-in-sql-statement-intercepto

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…yInterceptor to implements Interceptor/StatementInspector
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Laurens-W Laurens-W self-assigned this Sep 27, 2024
@Laurens-W Laurens-W added the enhancement New feature or request label Sep 27, 2024
@Laurens-W Laurens-W marked this pull request as ready for review September 27, 2024 09:01
Laurens-W and others added 3 commits September 30, 2024 15:54
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Instead of autoformat, apply correct padding
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to see this resolved ; I've pushed up a small polishing commit, but otherwise good to merge.

Comment on lines +28 to +29
import org.openrewrite.java.tree.*;

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import org.openrewrite.java.tree.*;
import org.openrewrite.java.tree.J;
import org.openrewrite.java.tree.JavaType;
import org.openrewrite.java.tree.Space;
import org.openrewrite.java.tree.TypeTree;
import org.openrewrite.java.tree.TypeUtils;

@timtebeek timtebeek merged commit 43662be into main Oct 8, 2024
2 checks passed
@timtebeek timtebeek deleted the empty-interceptor branch October 8, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants