-
Notifications
You must be signed in to change notification settings - Fork 0
Enable SQL Annotation Conversion Action from DAO Methods and Control SQL File Opening #451
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
Enable SQL Annotation Conversion Action from DAO Methods and Control SQL File Opening #451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables bi-directional SQL annotation conversion by allowing the conversion action to be triggered from DAO methods in Java/Kotlin files in addition to SQL files, and prevents automatic opening of generated SQL files to improve workflow efficiency.
- Extends SQL file to annotation conversion to work from Java/Kotlin DAO methods
- Adds Java language support for the ConvertSqlFileToAnnotationAction intention
- Modifies SQL file generation to prevent automatic opening of created files
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin.xml | Registers ConvertSqlFileToAnnotationAction for Java language |
| ConvertSqlFileToAnnotationAction.kt | Adds support for triggering conversion from Java/Kotlin DAO methods |
| ConvertSqlAnnotationToFileAction.kt | Refactors to use shared helper methods and improves condition checking |
| SqlAnnotationConverter.kt | Moves supported types to companion object and adds file opening control |
| PsiDaoMethod.kt | Adds optional parameter to control file opening after SQL generation |
| ConvertSqlActionTest.kt | New base test class with shared test utilities |
| ConvertSqlFileToAnnotationActionTest.kt | Refactored to use base class and improved test assertions |
| ConvertSqlAnnotationToFileActionTest.kt | Refactored to use base class and updated file opening expectations |
| DaoClass.kt | Uses DomaClassName enum for consistency |
| DomaClassName.kt | Adds DAO class name constant |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/kotlin/org/domaframework/doma/intellij/action/dao/ConvertSqlFileToAnnotationAction.kt
Show resolved
Hide resolved
|
|
||
| val daoClass = findDaoClass("$sqlConversionPackage.$daoName") | ||
| myFixture.configureFromExistingVirtualFile(daoClass.containingFile.virtualFile) | ||
| println("convertActionName: $convertActionName") |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statement should be removed from production test code. Use proper logging or remove this line entirely.
| println("convertActionName: $convertActionName") |
This pull request implements the following changes:
These changes allow bi-directional conversion between SQL files and annotations directly from DAO methods, improving usability and workflow efficiency.