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

feat: Spring Data API for Grid #7011

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

feat: Spring Data API for Grid #7011

wants to merge 8 commits into from

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Jan 8, 2025

Provides a Spring Data specific setItems variant based on Pageable.

The method is called setItemsSpring because the signature is the same as existing setItems methods.

Used as e.g.

grid.setItemsPageable(pageable -> productService.list(pageable))

@vaadin-bot
Copy link
Collaborator

vaadin-bot commented Jan 8, 2025

TC Format Checker Report - 11:48 - 08 - Jan

BLOCKER There are 1 files with format errors

  • To see a complete report of formatting issues, download the differences file

  • To fix the build, please run mvn spotless:apply in your branch and commit the changes.

  • Optionally you might add the following line in your .git/hooks/pre-commit file:

    mvn spotless:apply
    

Here is the list of files with format issues in your PR:

vaadin-grid-flow-parent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/Grid.java

@mstahv
Copy link
Member

mstahv commented Jan 8, 2025

Very good, almost like I would have done it 😁

"Spring" alone in the naming doesn't sound quite right though. I'd at least expand that to SpringData as that is where the Pageable is located in.

Couple of other drafts I tried yesterday in my IDE, but I feel like the best option is missing from the list:

    setItemsPaged
    setItemsPageable
    pageItems

I'd pick this last one if other lazy methods wouldn't already drive people toward setItems, maybe still a good option 🤷‍♂️

@Artur-
Copy link
Member Author

Artur- commented Jan 8, 2025

setItemsPageable is a very technical name but maybe still better then using Spring

@Artur-
Copy link
Member Author

Artur- commented Jan 8, 2025

It intentionally starts with setItems so that it can be auto completed along with all the other variants

Artur- added 3 commits January 8, 2025 11:28
Provides a Spring Data specific setItems variant based on Pageable.

The method is called setItemsSpring because the signature is the same as existing setItems methods.

Used as e.g.

```

grid.setItemsSpring(pageable -> productService.list(pageable))

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

Successfully merging this pull request may close these issues.

3 participants