Monday, 15 June 2015

spring rest data plural url -



spring rest data plural url -

i have domain class called storetype.java exposed below spring repository

public interface storetyperepository extends pagingandsortingrepository<storetype, short> { }

when access using url http://localhost:8080/my-persistence/jpa/storetypes returns 404.

if alter domain class storetype (without camel case), works fine , homecoming 200 ok.

i have few more repositories uses single world domain classes store.java , country.java , these work fine , default these exposed plural of domain class name.

i know spring exposed url plural of domain classes not sure why not exposing it. can override using @repositoryrestresource(path="/storetypes") want know default rest url if domain classes name in camel case.

you seem have answered question problem specifying @repositoryrestresource( path="/storetypes" ) annotation the documentation states.

spring info rest exposes collection resource named after uncapitalized, pluralized version of domain class exported repository handling. both name of resource , path can customized using @repositoryrestresource on repository interface.

in case naming convention seems right using storetyperepository 1 thing confuses me repository definition... i'm not sure why set type parameter pagingandsortingrepository<storetype, short> i'm quite that's wrong sec type parameter should of type long.

rest spring-data-rest

No comments:

Post a Comment