-
Notifications
You must be signed in to change notification settings - Fork 42
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
Comments
Here i the gif of the section: https://d3nmt5vlzunoa1.cloudfront.net/idea/files/2017/03/05FindByZipNestedParam.gif |
@Chris2011 this is a very complex feature so I will likely not have time to implement it. |
Yeah, I thought so too. Thx for the info. Hope too, that someone can catch up. |
I'm just thinking we can get ideas from JPA's @NamedQuery completion to achieve this feat. |
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 |
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. Maybe that makes it easier to implement such functionality into the code completion. |
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
The text was updated successfully, but these errors were encountered: