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

Entity mapping

One of the fundamental tasks in JPA development is to map your domain model entity classes to your database tables and columns. There are two approaches when you are going to design your entities and database in general:

  • Designing entity classes and generating a database schema from them
  • Designing database tables then implementing entity classes around them

The first approach is only valid and useful when you are starting your application from scratch. Beginning the design with entity classes makes it easier for you, as an application developer, to analyze and design your solution with object-oriented techniques. Note that this may be suitable only for small to medium-scale applications. In large-scale applications, there may be a big database design and implementation team who will take on the database responsibility. In such a case, you have to follow the second approach. Another common case is that the database may exist, as you are going to develop a new vertical application above an existing application, or you are revamping or migrating an existing system to newer technologies.

Anyways, by learning the basic mappings of JPA, you will be able to follow either of these approaches.

主站蜘蛛池模板: 双鸭山市| 辽阳县| 卢湾区| 甘孜县| 双峰县| 繁昌县| 如皋市| 响水县| 大化| 吉木萨尔县| 白玉县| 昔阳县| 白玉县| 高台县| 宾川县| 托克逊县| 土默特右旗| 武隆县| 竹山县| 沂水县| 龙陵县| 四会市| 香港 | 色达县| 顺义区| 克拉玛依市| 乌鲁木齐县| 巫山县| 偏关县| 长兴县| 双流县| 葵青区| 长汀县| 旺苍县| 乡城县| 汉阴县| 盘锦市| 辽宁省| 得荣县| 永寿县| 时尚|