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

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.

主站蜘蛛池模板: 师宗县| 呼伦贝尔市| 正镶白旗| 革吉县| 新兴县| 合作市| 思南县| 上饶县| 抚顺市| 县级市| 平谷区| 平果县| 深水埗区| 龙口市| 南城县| 南昌县| 永和县| 汝城县| 都昌县| 抚松县| 新建县| 清徐县| 阿瓦提县| 郯城县| 武夷山市| 泉州市| 苗栗市| 盘锦市| 连城县| 拜泉县| 铜鼓县| 昌吉市| 凉山| 儋州市| 固镇县| 房产| 通海县| 夏津县| 包头市| 万山特区| 太和县|