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

Please add completion/suggestion for creating repo methods #137

Open
Chris2011 opened this issue Mar 23, 2018 · 6 comments
Open

Please add completion/suggestion for creating repo methods #137

Chris2011 opened this issue Mar 23, 2018 · 6 comments

Comments

@Chris2011
Copy link

In this improvements list: https://blog.jetbrains.com/idea/2017/03/spring-data-improvements-in-intellij-idea-2017-1/ if you scroll down a bit to the Smarter Code Completion section, you can see, that they suggest keywords to create repo methods for the mapped SQL, what Spring does in the background. This is very handy, if you didn't create your repo method before, but if you want to create it ad hoc.

Cheers

Chris

@Chris2011
Copy link
Author

@AlexFalappa
Copy link
Owner

@Chris2011 this is a very complex feature so I will likely not have time to implement it.
Hope someone will step up and help.

@Chris2011
Copy link
Author

Chris2011 commented Mar 24, 2018

Yeah, I thought so too. Thx for the info. Hope too, that someone can catch up.

@essien
Copy link

essien commented Feb 23, 2021

I'm just thinking we can get ideas from JPA's @NamedQuery completion to achieve this feat.

@Chris2011
Copy link
Author

It seems that it just check the properties of the object and can chain them together with And or other operators: https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.query-methods.query-property-expressions

@Chris2011
Copy link
Author

I already had a look into the functionality how this works. A colleague of mine helped me understanding it. It seems that it is working as mentioned before somehow. You have a model and inside the repository class it goes through your model based on the generic type that you aligned as T and the IDE goes through your Pojo and adds some basic keywords, your propertyname and operators to it. Here is a little example to test it out.

demochris.zip

Maybe that makes it easier to implement such functionality into the code completion.

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

No branches or pull requests

3 participants