简体   繁体   中英

Expose JpaSpecificationExecutor method as REST resource

Say I have this interface:

@RepositoryRestResource
public interface MyRepo extends JpaRepository, JpaSpecificationExecutor {
}

Is it possible to expose a method from a JpaSpecificationExecutor within interface annotated with @RepositoryRestResource as REST resource?

If so, how I get my custom Specification implementation from the request?

I don't want to use any request mapping, just expose endpoints via @RepositoryRestResource

@RepositoryRestResource doesn't expose any method of JpaSpecificationExecutor . If you want such behaviour you have to implement a controller and service to create Specification and execute it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM