Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20868/nhibernate/src/NHibernate/Cfg
Modified Files:
Binder.cs
Log Message:
NH-180 - More cases when default namespace/assembly can be used
Implemented lazy proxies as per 2.1
Index: Binder.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** Binder.cs 26 Mar 2005 13:24:36 -0000 1.43
--- Binder.cs 28 Mar 2005 10:14:52 -0000 1.44
***************
*** 85,89 ****
//PROXY INTERFACE
XmlAttribute proxyNode = node.Attributes["proxy"];
! if (proxyNode!=null)
{
try
--- 85,91 ----
//PROXY INTERFACE
XmlAttribute proxyNode = node.Attributes["proxy"];
! XmlAttribute lazyNode = node.Attributes["lazy"];
! bool lazyTrue = lazyNode != null && "true".Equals( lazyNode.Value );
! if ( proxyNode != null && ( lazyNode == null || lazyTrue ) )
{
try
***************
*** 96,99 ****
--- 98,105 ----
}
}
+ if ( proxyNode == null && lazyTrue )
+ {
+ model.ProxyInterface = model.MappedClass;
+ }
//DISCRIMINATOR
***************
*** 706,710 ****
try
{
! model.Type = TypeFactory.ManyToOne( ReflectHelper.ClassForName( typeNode.Value ), model.ReferencedPropertyName );
}
catch
--- 712,717 ----
try
{
! string name = FullClassName( typeNode.Value, mappings );
! model.Type = TypeFactory.ManyToOne( ReflectHelper.ClassForName( name ), model.ReferencedPropertyName );
}
catch
***************
*** 766,770 ****
try
{
! model.Type = TypeFactory.OneToOne( ReflectHelper.ClassForName( classNode.Value ), model.ForeignKeyType, model.ReferencedPropertyName ) ;
}
catch (Exception)
--- 773,778 ----
try
{
! string name = FullClassName( classNode.Value, mappings );
! model.Type = TypeFactory.OneToOne( ReflectHelper.ClassForName( name ), model.ForeignKeyType, model.ReferencedPropertyName ) ;
}
catch (Exception)
***************
*** 779,784 ****
try
{
! model.Type = (EntityType) NHibernateUtil.Entity(
! ReflectHelper.ClassForName( node.Attributes["class"].Value) );
}
catch (Exception e)
--- 787,792 ----
try
{
! string name = FullClassName( node.Attributes["class"].Value, mappings );
! model.Type = (EntityType) NHibernateUtil.Entity( ReflectHelper.ClassForName( name ) );
}
catch (Exception e)
***************
*** 849,854 ****
try
{
!
! model.ElementClass = ReflectHelper.ClassForName( subnode.Attributes["class"].Value);
}
catch (Exception e)
--- 857,862 ----
try
{
! string className = FullClassName( subnode.Attributes["class"].Value, mappings );
! model.ElementClass = ReflectHelper.ClassForName( className );
}
catch (Exception e)
***************
*** 1410,1414 ****
try
{
! clazz = ReflectHelper.ClassForName( returns.Attributes["class"].Value );
}
catch (Exception)
--- 1418,1423 ----
try
{
! string name = FullClassName( returns.Attributes["class"].Value, model );
! clazz = ReflectHelper.ClassForName( name );
}
catch (Exception)
|