이 콘텐츠는 선택한 언어로 제공되지 않습니다.
4.5. Tuplizers
org.hibernate.tuple.Tuplizer
, and its sub-interfaces, are responsible for managing a particular representation of a piece of data given that representation's org.hibernate.EntityMode
. If a given piece of data is thought of as a data structure, then a tuplizer is the thing that knows how to create such a data structure and how to extract values from and inject values into such a data structure. For example, for the POJO entity mode, the corresponding tuplizer knows how create the POJO through its constructor. It also knows how to access the POJO properties using the defined property accessors.
There are two high-level types of Tuplizers, represented by the
org.hibernate.tuple.entity.EntityTuplizer
and org.hibernate.tuple.component.ComponentTuplizer
interfaces. EntityTuplizer
s are responsible for managing the above mentioned contracts in regards to entities, while ComponentTuplizer
s do the same for components.
Users can also plug in their own tuplizers. Perhaps you require that a
java.util.Map
implementation other than java.util.HashMap
be used while in the dynamic-map entity-mode. Or perhaps you need to define a different proxy generation strategy than the one used by default. Both would be achieved by defining a custom tuplizer implementation. Tuplizer definitions are attached to the entity or component mapping they are meant to manage. Going back to the example of our customer entity: