Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » tuple » [javadoc | source]
org.hibernate.tuple
public interface: Tuplizer [javadoc | source]

All Known Implementing Classes:
    DynamicMapTuplizer, AbstractEntityTuplizer, Dom4jEntityTuplizer, Dom4jComponentTuplizer, PojoComponentTuplizer, AbstractComponentTuplizer, EntityTuplizer, DynamicMapEntityTuplizer, DynamicMapComponentTuplizer, ComponentTuplizer, DynamicMapComponentTuplizer, PojoComponentTuplizer, PojoEntityTuplizer, Dom4jTuplizer, Dom4jEntityTuplizer, DynamicMapEntityTuplizer, ComponentTuplizer, PojoEntityTuplizer, Dom4jComponentTuplizer, EntityTuplizer, AbstractTuplizer, AbstractEntityTuplizer, PojoTuplizer, AbstractComponentTuplizer

A tuplizer defines the contract for things which know how to manage a particular representation of a piece of data, given that representation's org.hibernate.EntityMode (the entity-mode essentially defining which representation).

If that given piece of data is thought of as a data structure, then a tuplizer is the thing which knows how to

For example, a given piece of data might be represented as a POJO class. Here, it's representation and entity-mode is POJO. Well a tuplizer for POJO entity-modes would know how to

That same piece of data might also be represented as a DOM structure, using the tuplizer associated with the DOM4J entity-mode, which would generate instances of org.dom4j.Element as the data structure and know how to access the values as either nested org.dom4j.Element s or as org.dom4j.Attribute s.
Method from org.hibernate.tuple.Tuplizer Summary:
getMappedClass,   getPropertyValue,   getPropertyValues,   instantiate,   isInstance,   setPropertyValues
Method from org.hibernate.tuple.Tuplizer Detail:
 public Class getMappedClass()
    Return the pojo class managed by this tuplizer.

    Need to determine how to best handle this for the Tuplizers for EntityModes other than POJO.

    todo : be really nice to not have this here since it is essentially pojo specific...
 public Object getPropertyValue(Object entity,
    int i) throws HibernateException
    Extract the value of a particular property from the given entity.
 public Object[] getPropertyValues(Object entity) throws HibernateException
    Extract the current values contained on the given entity.
 public Object instantiate() throws HibernateException
    Generate a new, empty entity.
 public boolean isInstance(Object object)
    Is the given object considered an instance of the the entity (acconting for entity-mode) managed by this tuplizer.
 public  void setPropertyValues(Object entity,
    Object[] values) throws HibernateException
    Inject the given values into the given entity.