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

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.

主站蜘蛛池模板: 滁州市| 宁国市| 牟定县| 正安县| 井研县| 将乐县| 湘乡市| 区。| 扬中市| 普兰县| 浦城县| 千阳县| 临沂市| 彰武县| 西吉县| 霍山县| 甘泉县| 南汇区| 宾阳县| 太白县| 合阳县| 新民市| 金秀| 稷山县| 随州市| 林芝县| 民丰县| 财经| 柳林县| 葫芦岛市| 富宁县| 喜德县| 江阴市| 斗六市| 星座| 施甸县| 贞丰县| 大石桥市| 精河县| 鄯善县| 当涂县|