From: Michael D. <mik...@us...> - 2005-01-23 15:41:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15817/Cfg Modified Files: Configuration.cs Added Files: EmptyInterceptor.cs Log Message: Moved EmptyInterceptor out of Configuration and into its own class. Renamed Transaction to AdoTransaction. --- NEW FILE: EmptyInterceptor.cs --- using System; using System.Collections; using NHibernate.Type; namespace NHibernate.Cfg { [Serializable] internal class EmptyInterceptor : IInterceptor { public EmptyInterceptor() { } public void OnDelete( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { } public bool OnFlushDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) { return false; } public bool OnLoad( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { return false; } public bool OnSave( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { return false; } public void OnPostFlush( object entity, object id, object[ ] currentState, string[ ] propertyNames, IType[ ] types ) { } public void PostFlush( ICollection entities ) { } public void PreFlush( ICollection entitites ) { } public object IsUnsaved( object entity ) { return null; } public object Instantiate( System.Type clazz, object id ) { return null; } public int[ ] FindDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) { return null; } } } Index: Configuration.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Configuration.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Configuration.cs 3 Jan 2005 03:44:41 -0000 1.27 --- Configuration.cs 23 Jan 2005 15:41:02 -0000 1.28 *************** *** 32,35 **** --- 32,36 ---- { private static readonly ILog log = LogManager.GetLogger( typeof( Configuration ) ); + private static readonly IInterceptor emptyInterceptor = new EmptyInterceptor(); private Hashtable classes = new Hashtable(); *************** *** 39,43 **** private Hashtable namedQueries = new Hashtable(); private ArrayList secondPasses = new ArrayList(); ! private IInterceptor interceptor = EmptyInterceptor; private IDictionary properties = Environment.Properties; private IDictionary caches = new Hashtable(); --- 40,44 ---- private Hashtable namedQueries = new Hashtable(); private ArrayList secondPasses = new ArrayList(); ! private IInterceptor interceptor = emptyInterceptor; private IDictionary properties = Environment.Properties; private IDictionary caches = new Hashtable(); *************** *** 46,54 **** private XmlSchema cfgSchema; ! /// <summary></summary> public static readonly string MappingSchemaXMLNS = "urn:nhibernate-mapping-2.0"; private static readonly string MappingSchemaResource = "NHibernate.nhibernate-mapping-2.0.xsd"; ! /// <summary></summary> public static readonly string CfgSchemaXMLNS = "urn:nhibernate-configuration-2.0"; private static readonly string CfgSchemaResource = "NHibernate.nhibernate-configuration-2.0.xsd"; --- 47,59 ---- private XmlSchema cfgSchema; ! /// <summary> ! /// The XML Namespace for the nhibernate-mapping ! /// </summary> public static readonly string MappingSchemaXMLNS = "urn:nhibernate-mapping-2.0"; private static readonly string MappingSchemaResource = "NHibernate.nhibernate-mapping-2.0.xsd"; ! /// <summary> ! /// The XML Namespace for the nhibernate-configuration ! /// </summary> public static readonly string CfgSchemaXMLNS = "urn:nhibernate-configuration-2.0"; private static readonly string CfgSchemaResource = "NHibernate.nhibernate-configuration-2.0.xsd"; *************** *** 64,68 **** namedQueries = new Hashtable(); secondPasses = new ArrayList(); ! interceptor = EmptyInterceptor; properties = Environment.Properties; } --- 69,73 ---- namedQueries = new Hashtable(); secondPasses = new ArrayList(); ! interceptor = emptyInterceptor; properties = Environment.Properties; } *************** *** 571,626 **** } - private static readonly IInterceptor EmptyInterceptor = new EmptyInterceptorClass(); - - [Serializable] - private class EmptyInterceptorClass : IInterceptor - { - public void OnDelete( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) - { - } - - public bool OnFlushDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) - { - return false; - } - - public bool OnLoad( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) - { - return false; - } - - public bool OnSave( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) - { - return false; - } - - public void OnPostFlush( object entity, object id, object[ ] currentState, string[ ] propertyNames, IType[ ] types ) - { - } - - public void PostFlush( ICollection entities ) - { - } - - public void PreFlush( ICollection entitites ) - { - } - - public object IsUnsaved( object entity ) - { - return null; - } - - public object Instantiate( System.Type clazz, object id ) - { - return null; - } - - public int[ ] FindDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) - { - return null; - } - } - /// <summary> /// Instantitate a new <c>ISessionFactory</c>, using the properties and mappings in this --- 576,579 ---- |