4 Comments

  1. William

    1) curl start.spring.io/starter.zip -d dependencies=web,data-jpa,data-rest -o demo.zip

    2) unzip and add h2 to the pom.xml (or your favorite db driver)

    3) define your entity

    4) declare an @RepositoryRestResource:
    @RepositoryRestResource
    interface SomeEntityRepository extends JpaRepository{
    }

    5) Done, Spring implements all of the common CRUD methods for you.

    Reply
  2. jyoti

    No mapping found for HTTP request with URI [/Demo1/rest/addemployees] in DispatcherServlet with name ‘spring’
    i m getting these

    Reply

    • Make sure the request url is in sync with mapping you provide ..

      For the example, the mapping for the sample code provided is :

      @RequestMapping(value=”/addemployee”,…)

      So, the url should have addemployee and not addemployees . No addtional “s” at the end.

      Reply
  3. subhani

    thank u….easy understoos

    Reply

Leave a Reply