Enable @QueryProjection annotation support for KSP.#997
Enable @QueryProjection annotation support for KSP.#997IceBlizz6 merged 9 commits intoOpenFeign:masterfrom
Conversation
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](junit-team/junit-framework@r5.12.0...r5.12.1) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps `hibernate.version` from 6.6.10.Final to 6.6.11.Final. Updates `org.hibernate.orm:hibernate-core` from 6.6.10.Final to 6.6.11.Final - [Release notes](https://github.com/hibernate/hibernate-orm/releases) - [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.11/changelog.txt) - [Commits](hibernate/hibernate-orm@6.6.10...6.6.11) Updates `org.hibernate.orm:hibernate-envers` from 6.6.10.Final to 6.6.11.Final - [Release notes](https://github.com/hibernate/hibernate-orm/releases) - [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.11/changelog.txt) - [Commits](hibernate/hibernate-orm@6.6.10...6.6.11) Updates `org.hibernate.orm:hibernate-c3p0` from 6.6.10.Final to 6.6.11.Final - [Release notes](https://github.com/hibernate/hibernate-orm/releases) - [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.11/changelog.txt) - [Commits](hibernate/hibernate-orm@6.6.10...6.6.11) --- updated-dependencies: - dependency-name: org.hibernate.orm:hibernate-core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.hibernate.orm:hibernate-envers dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.hibernate.orm:hibernate-c3p0 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
|
Hey, I have just a few comments on this before we merge. In QueryDslProcessor you are using mapNotNull and you are returning null for invalid usages of these annotations. I'm open for discussion on this one if you have thoughts on this, but my initial idea is to change mapNotNull into map and use throw/error instead of returning null. is KSFunctionDeclaration -> {
if (declaration.isConstructor()) {
declaration.parent as? KSClassDeclaration
} else {
null
}
}Is this part only valid for QueryProjection? So annotating constructors instead of the class is now possible as i understand it (?) |
|
Hello @IceBlizz6, Based on your feedback, I have modified the existing source code.
If my modifications are different from your intention or if you think there are any other areas that need adjustment, please feel free to let me know. Thank you. |
|
Thank you, the code changes looks good! On my computer i need to add these lines to make it work. import com.querydsl.example.ksp.QPersonClassConstructorDTO
import com.querydsl.example.ksp.QPersonClassDTOIt doesn't seem like github workflows has been set up to build this example project, so it won't be able to confirm whether this is an actual issue in the code or if this is a configuration issue on my local machine. I just wanted to confirm with you that you are not encountering this issue? |
|
Hello @IceBlizz6, Thank you for your feedback. After checking the issue you pointed out, I realized that it was my mistake. I found that some import statements were missing when copying from the local Gradle querydsl-example environment to querydsl/querydsl-examples/querydsl-example-ksp-codegen. I have added the missing import statements and pushed the changes. Thank you! |
fixes #996
Could you please check this feature at @IceBlizz6 if possible?
Thank you.