Skip to content

Allow View customization through @View annotations [DATACOUCH-16] #327

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

Closed
spring-projects-issues opened this issue Jun 27, 2013 · 4 comments
Assignees
Labels
in: core Issues in core support type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link

Michael Nitschinger opened DATACOUCH-16 and commented


Referenced from: commits 887c014, 48385c9

@spring-projects-issues
Copy link
Author

Michael Nitschinger commented

Here is an explanation how I think this should work.

Currently, in the repository implementation we make use of the "all" view to identify all docs and also count them (so with an optional reduce). The first step is to make this customizable, for both the view and design doc name.

So in general we should have a @View annotation which has two properties "design" and "view".

Then, one should be able to

  1. override and annotate the findAll and count methods like this

@Override
@View(design = "foo", view = "bar)
Iterable<T> findAll()

  1. Once this is done, I'd like to expand that concept on "dynamic finders" but this is a separate ticket. In the first step we could have something like:

@View(design = "users", view =" by_username")
findByUsername

and when we get n1ql support this can be completely dynamic like in JPA

@spring-projects-issues
Copy link
Author

David Harrigan commented

Hi,

I've had a go at doing #1. Seems to work okay. I'm going to tidy up the code a bit then do a PR. Feedback welcome! :-)

-=david=-

@spring-projects-issues
Copy link
Author

David Harrigan commented

Hi,

Pull Request #12 created.

Feedback welcome!

-=david=-

@spring-projects-issues
Copy link
Author

David Harrigan commented

Hi,

New Pull Request based on feedback from Oliver and Michael:

#14

-=david=-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants