官术网_书友最值得收藏!

Creating Spring Data REST service

In the previous example, we fronted our BookRepository interface with a REST controller in order to expose the data behind it via a web RESTful API. While this is definitely a quick and easy way to make the data accessible, it does require us to manually create a controller and define the mappings for all the desired operations. To minimize the boilerplate code, Spring provides us with a more convenient way: spring-boot-starter-data-rest. This allows us to simply add an annotation to the repository interface and Spring will do the rest to expose it to the web.

We will continue from where we finished in the previous recipe, and so the entity models and the BookRepository interface should already exist.

主站蜘蛛池模板: 中方县| 海淀区| 鄂伦春自治旗| 通化市| 酉阳| 日喀则市| 龙游县| 吉安市| 鸡东县| 会理县| 吴桥县| 黄石市| 西乌| 东乡县| 高雄县| 浏阳市| 攀枝花市| 宁蒗| 侯马市| 株洲市| 广州市| 文成县| 汉寿县| 平果县| 治县。| 西平县| 义马市| 新邵县| 丰顺县| 新化县| 洛宁县| 德清县| 陵水| 措美县| 泗水县| 宿迁市| 成武县| 浦东新区| 辽源市| 白玉县| 灌南县|