Hecklers in Development
Code, coffee, & camaraderie. Collection, unordered. ;)

Spring Data REST takes an opinionated approach to exposing Spring Data repositories via REST endpoints, covering the 80-90% use case with a minimum of code and fuss. But did you know that it provides a no-lifting-required mechanism for exposing query methods you define on those repositories as well?

 

Let’s say you create a method like this:

 

 

Referencing that bit of functionality directly is simple, just append /search/<methodName> to the collection endpoint:

 

 

 

For more information, click here to view the Spring Data REST docs. Keep coding/keep sharing!

 

Cheers,
Mark

 

P.S. – Find this useful? Click here to follow me on Twitter and be notified of future posts! And don’t forget to share this Quick Tip via the button(s) below. Thanks!

Share

Tags: , , , , ,

Powered by Wordpress
Theme © 2005 - 2009 FrederikM.de, heavily modified by Mark Heckler
BlueMod is a modification of the blueblog_DE Theme by Oliver Wunder