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

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.

主站蜘蛛池模板: 西盟| 长宁区| 丘北县| 高邑县| 探索| 弥勒县| 张家口市| 和政县| 渭南市| 拉萨市| 元谋县| 丹东市| 璧山县| 芜湖市| 盘山县| 榆中县| 扶余县| 蒙阴县| 惠安县| 仁布县| 河曲县| 旌德县| 千阳县| 塘沽区| 阿拉善右旗| 惠水县| 桓仁| 天台县| 申扎县| 石渠县| 黔西县| 清镇市| 来宾市| 鸡西市| 剑河县| 田阳县| 治县。| 莱芜市| 鄂尔多斯市| 徐水县| 余庆县|