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

Add persistent entity headers to single entity searches [DATAREST-835] #1207

Closed
spring-projects-issues opened this issue Jun 2, 2016 · 5 comments
Assignees
Labels
type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jun 2, 2016

Matthew Borger opened DATAREST-835 and commented

When search queries from Spring Data repositories result in a single result, the usual headers such as ETag and Last-Modified should be provided.

This is useful when you have crafted a specific search method that will always return exactly one entity and you're using ETags to handle optimistic locking. Currently you have to search for the object and make an additional GET request on its self URI so you can access its ETag


Affects: 2.5.1 (Hopper SR1)

Reference URL: #218

Referenced from: commits 50c2197, aa7eec4

Backported to: 2.6 RC1 (Ingalls)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 3, 2016

Oliver Trosien commented

Is that repository method what you are thinking about?

interface EntityRepository extends EntityRepository<Entity> {
  Entity findBySomeKey(String key);
}

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 1, 2016

Matthew Borger commented

@Oliver Trosien Yes those are the methods I am talking about. In particular anything with a findOne prefix.

I added a link to a pull request, #218, for a modification that my company is using internally to add this functionality. Any feedback would be appreciated

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 1, 2016

Oliver Drotbohm commented

Thanks for the PR Matthew. I've already created a fix locally that includes a bit of a rearrangement of some internal code to improve the situation in general. I am about to close your PR for that reason, but expect that ticket to be fixed soon. I'd like to just apply a bit more polish and am currently traveling conferences

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 1, 2016

Matthew Borger commented

Sounds great. I'm look forward to seeing it

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 9, 2016

Oliver Drotbohm commented

Should be in place, care to give the snapshots a spin?

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

No branches or pull requests

2 participants