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

Setting up a data repository service

Connecting to a database and then executing good old SQL, though simplistic and straightforward, is not the most convenient way to operate on the data, map it in a set of domain objects, and manipulate the relational content. This is why multiple frameworks emerged to aid you with mapping the data from tables to objects, better known as object-relational mapping (ORM). The most notable example of such a framework is Hibernate.

In the previous example, we covered how to set up a connection to a database and configure the settings for the username and password, and we also discussed which driver to use, and so on. In this recipe, we will enhance our application by adding a few entity objects that define the structure of the data in the database and a CrudRepository interface to access the data.

As our application is a book-tracking catalogue, the obvious domain objects would be Book, Author, Reviewers, and Publisher.

主站蜘蛛池模板: 舟山市| 肥东县| 广德县| 额济纳旗| 台东市| 婺源县| 玛多县| 大丰市| 永福县| 南木林县| 宜丰县| 会东县| 陇川县| 张掖市| 红桥区| 锡林郭勒盟| 红河县| 六枝特区| 伽师县| 手游| 焦作市| 济阳县| 宝应县| 长岭县| 大名县| 杂多县| 沙坪坝区| 嘉黎县| 南宁市| 遂溪县| 霍山县| 临汾市| 石林| 天津市| 华坪县| 靖边县| 罗山县| 右玉县| 高阳县| 西平县| 高邑县|