org.hibernate.tuple
Class TuplizerLookup

java.lang.Object
  extended byorg.hibernate.tuple.TuplizerLookup
All Implemented Interfaces:
Serializable

public class TuplizerLookup
extends Object
implements Serializable

Stores references to the tuplizers available for a "tuplizable thing" (i.e., an entity or component).

Author:
Gavin King
See Also:
Serialized Form

Method Summary
static TuplizerLookup create(Component component)
          Generate a TuplizerLookup based on the given component mapping definition.
static TuplizerLookup create(PersistentClass mappedEntity, EntityMetamodel em)
          Generate a TuplizerLookup based on the given entity mapping and metamodel definitions.
 Tuplizer getTuplizer(EntityMode entityMode)
          Locate the contained tuplizer responsible for the given entity-mode.
 Tuplizer getTuplizerOrNull(EntityMode entityMode)
          Locate the contained tuplizer responsible for the given entity-mode.
 EntityMode guessEntityMode(Object object)
          Given a supposed instance of an entity/component, guess its entity mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static TuplizerLookup create(PersistentClass mappedEntity,
                                    EntityMetamodel em)
Generate a TuplizerLookup based on the given entity mapping and metamodel definitions.

Parameters:
mappedEntity - The entity mapping definition.
em - The entity metamodel definition.
Returns:
A TuplizerLookup containing the appropriate Tuplizers.

create

public static TuplizerLookup create(Component component)
Generate a TuplizerLookup based on the given component mapping definition.

Parameters:
component - The component mapping definition.
Returns:
A TuplizerLookup containing the appropriate Tuplizers.

guessEntityMode

public EntityMode guessEntityMode(Object object)
Given a supposed instance of an entity/component, guess its entity mode.

Parameters:
object - The supposed instance of the entity/component.
Returns:
The guessed entity mode.

getTuplizerOrNull

public Tuplizer getTuplizerOrNull(EntityMode entityMode)
Locate the contained tuplizer responsible for the given entity-mode. If no such tuplizer is defined on this lookup, then return null.

Parameters:
entityMode - The entity-mode for which the client wants a tuplizer.
Returns:
The tuplizer, or null if not found.

getTuplizer

public Tuplizer getTuplizer(EntityMode entityMode)
Locate the contained tuplizer responsible for the given entity-mode. If no such tuplizer is defined on this lookup, then an exception is thrown.

Parameters:
entityMode - The entity-mode for which the client wants a tuplizer.
Returns:
The tuplizer.
Throws:
HibernateException - Unable to locate the requested tuplizer.