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

Query annotation support #14661

Merged
merged 9 commits into from
Sep 9, 2020

Conversation

mbhaskar
Copy link
Member

@mbhaskar mbhaskar commented Aug 31, 2020

This enables end users to add annotated queries to their repositories using @query(value = "") which opens up all the query capabilities of underlying cosmos java sdk to the cosmos spring driver.
Examples
Synchronous:

    @Query(value = "select * from c offset @offset limit @limit" )
    List<Contact> contactsWithOffsetLimit(@Param("offset") int offset, @Param("limit") int limit);

Reactive:

    @Query(value = "select count(c.id) as num_ids, c.department from c group by c.department")
    Flux<ObjectNode> coursesGroupBy();

#12714: Support @Query annotation from spring-data-commons

Closes: #12714

@chenrujun
Copy link

/azp run java - cosmos - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chenrujun
Copy link

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mbhaskar
Copy link
Member Author

mbhaskar commented Sep 7, 2020

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mbhaskar
Copy link
Member Author

mbhaskar commented Sep 7, 2020

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@chenrujun chenrujun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please make integration test pipeline pass.

@chenrujun
Copy link

/azp run java - cosmos - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chenrujun
Copy link

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @mbhaskar - can you please add query annotation sample code to the readme so that we can mark this as feature complete?

@mbhaskar
Copy link
Member Author

mbhaskar commented Sep 9, 2020

LGTM, @mbhaskar - can you please add query annotation sample code to the readme so that we can mark this as feature complete?

I will do that once the PR is in. Thanks

… add annotated queries to their repositories using @query(value = "<query>") which opens up all the query capabilities of underlying cosmos java sdk to the cosmos spring driver.
@mbhaskar mbhaskar force-pushed the mbhaskar/query-annotation-support branch from 4722fbe to 0888f19 Compare September 9, 2020 04:49
@mbhaskar
Copy link
Member Author

mbhaskar commented Sep 9, 2020

/azp run java - cosmos - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mbhaskar
Copy link
Member Author

mbhaskar commented Sep 9, 2020

test pipeline already run. Rebased and pushed to get failing build analyze job to pass. Merging

@mbhaskar mbhaskar merged commit 32f9ae0 into Azure:master Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support @Query annotation from spring-data-commons
3 participants