/// <summary> Locate the tuplizer contained within this mapping which is responsible /// for the given entity-mode. If no such tuplizer is defined on this /// mapping, then an exception is thrown. /// /// </summary> /// <param name="entityMode">The entity-mode for which the caller wants a tuplizer. /// </param> /// <returns> The tuplizer. /// </returns> /// <throws> HibernateException Unable to locate the requested tuplizer. </throws> public virtual ITuplizer GetTuplizer(EntityMode entityMode) { ITuplizer tuplizer = GetTuplizerOrNull(entityMode); if (tuplizer == null) { throw new HibernateException("No tuplizer found for entity-mode [" + entityMode + "]"); } return(tuplizer); }
/// <summary> Given a supposed instance of an entity/component, guess its entity mode. </summary> /// <param name="obj">The supposed instance of the entity/component.</param> /// <returns> The guessed entity mode. </returns> public virtual EntityMode?GuessEntityMode(object obj) { foreach (KeyValuePair <EntityMode, ITuplizer> entry in tuplizers) { ITuplizer tuplizer = entry.Value; if (tuplizer.IsInstance(obj)) { return(entry.Key); } } return(null); }
protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer) { tuplizers[entityMode] = tuplizer; }
protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer) { EnsureFullyDeserialized(); _tuplizers[entityMode] = tuplizer; }
public void Add(EntityMode eMode, ITuplizer tuplizer) { AddTuplizer(eMode, tuplizer); }