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

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.

主站蜘蛛池模板: 错那县| 兴仁县| 叙永县| 宽城| 文山县| 临澧县| 浦城县| 民勤县| 广东省| 上杭县| 利川市| 从江县| 临江市| 青川县| 乌鲁木齐市| 江安县| 万安县| 兰西县| 驻马店市| 台东市| 土默特右旗| 遵义县| 天水市| 凉城县| 闻喜县| 三门县| 西峡县| 孟连| 多伦县| 乌兰县| 昭平县| 隆安县| 团风县| 剑川县| 安康市| 虞城县| 图们市| 达日县| 林芝县| 岑溪市| 磴口县|