From: Michael D. <mik...@us...> - 2004-12-09 17:52:24
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18504/Persister Modified Files: AbstractEntityPersister.cs Log Message: Migrated most Proxy items from proxy branch to this one. Have not moved the actual proxy code. Will do that when the serialization bug in DynamicProxy is fixed. Index: AbstractEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/AbstractEntityPersister.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractEntityPersister.cs 4 Dec 2004 22:41:22 -0000 1.28 --- AbstractEntityPersister.cs 9 Dec 2004 17:52:15 -0000 1.29 *************** *** 654,674 **** hasProxy = pi!=null; ArrayList pis = new ArrayList(); ! pis.Add(typeof(HibernateProxy)); ! //pis.Add( typeof(INHibernateProxy) ); // != null because we use arraylist instead of hashset // mono does not like a null value passed into Equals() if ( pi!=null && !mappedClass.Equals(pi) ) { pis.Add(pi); } concreteProxyClass = pi; ! if (hasProxy) { ! foreach(Subclass sc in model.SubclassCollection) { pi = sc.ProxyInterface; ! if (pi==null) throw new MappingException( "All subclasses must also have proxies: " + mappedClass.Name); ! if ( !sc.PersistentClazz.Equals(pi) ) pis.Add(pi); } } --- 654,687 ---- hasProxy = pi!=null; ArrayList pis = new ArrayList(); ! pis.Add( typeof(INHibernateProxy) ); ! // != null because we use arraylist instead of hashset // mono does not like a null value passed into Equals() if ( pi!=null && !mappedClass.Equals(pi) ) { + // if the <class> name="type" is not the same type as the proxy="type" + // then add the proxy's type to the list. They will + // be different types when the <class> is a class and the proxy is + // an interface, or when a <class> is an interface and the proxy interface + // is diff (why would you do that??). They will be the same type + // when the <class> is an interface and the proxy interface is the same + // interface. pis.Add(pi); } concreteProxyClass = pi; ! if( hasProxy ) { ! foreach( Subclass sc in model.SubclassCollection ) { pi = sc.ProxyInterface; ! if( pi==null ) ! { ! throw new MappingException( "All subclasses must also have proxies: " + mappedClass.Name); ! } ! if( !sc.PersistentClazz.Equals(pi) ) ! { ! pis.Add(pi); ! } } } |