/// <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);
        }
예제 #2
0
 /// <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);
 }
예제 #3
0
		protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer)
		{
			tuplizers[entityMode] = tuplizer;
		}
 protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer)
 {
     EnsureFullyDeserialized();
     _tuplizers[entityMode] = tuplizer;
 }
		protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer)
		{
			EnsureFullyDeserialized();
			_tuplizers[entityMode] = tuplizer;
		}
예제 #6
0
 public void Add(EntityMode eMode, ITuplizer tuplizer)
 {
     AddTuplizer(eMode, tuplizer);
 }
예제 #7
0
 protected internal void AddTuplizer(EntityMode entityMode, ITuplizer tuplizer)
 {
     tuplizers[entityMode] = tuplizer;
 }
예제 #8
0
			public void Add(EntityMode eMode, ITuplizer tuplizer)
			{
				AddTuplizer(eMode, tuplizer);
			}