Clarifying terminology - What does “hydrating” a JPA or Hibernate entity mean when fetching the entity from the DB

后端 未结 6 1094
太阳男子
太阳男子 2020-12-04 20:54

In the context of ORM / Lazy loading of entities, my understanding of the term \"Hydration\" is as follows:

\"Hydrating\" describes the process of populating some or

6条回答
  •  既然无缘
    2020-12-04 21:35

    the term hydration is extensively used in the guts of the hibernate library to refer to the process of setting the fields of a recently loaded object, and is indeed related to the object graph populaton.
    but it's different than the concept of lazy loading, that is, giving the user a half-filled object and letting the rest be loaded on demand.
    the hydration is always performed, lazily or eagerly and it's hibernate stuff.
    lazy loading is just for convenience

    replace hibernate with the name of your orm of choice

提交回复
热议问题