From: Michael D. <mik...@us...> - 2004-11-04 04:46:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31543/NHibernate/Impl Modified Files: QueryImpl.cs Log Message: NH-143: QueryImpl can now guess type correctly when passing an enum into SetParamater(..., value) Index: QueryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/QueryImpl.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** QueryImpl.cs 31 Oct 2004 04:31:00 -0000 1.15 --- QueryImpl.cs 4 Nov 2004 04:46:13 -0000 1.16 *************** *** 259,274 **** } ! private IType GuessType(System.Type clazz) { ! string typename = clazz.Name; ! IType type = TypeFactory.HueristicType(typename); bool serializable = type!=null && type is SerializableType; ! if ( type==null || serializable ) { ! try { session.Factory.GetPersister(clazz); ! } catch (MappingException) { ! if (serializable) { return type; } ! else { throw new HibernateException("Could not determine a type for class: " + typename); } --- 259,281 ---- } ! private IType GuessType(System.Type clazz) ! { ! string typename = clazz.AssemblyQualifiedName; ! IType type = TypeFactory.HueristicType( typename ); bool serializable = type!=null && type is SerializableType; ! if ( type==null || serializable ) ! { ! try ! { session.Factory.GetPersister(clazz); ! } ! catch (MappingException) ! { ! if (serializable) ! { return type; } ! else ! { throw new HibernateException("Could not determine a type for class: " + typename); } *************** *** 276,280 **** return NHibernate.Entity(clazz); } ! else { return type; } --- 283,288 ---- return NHibernate.Entity(clazz); } ! else ! { return type; } |