You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(56) |
Nov
(13) |
Dec
(36) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(7) |
Feb
(55) |
Mar
(33) |
Apr
(71) |
May
(12) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Richard B. <rb...@us...> - 2005-04-11 23:27:46
|
Update of /cvsroot/jcframework/dotnet/Nunit/StandardClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Nunit/StandardClasses Modified Files: NonInheritedTests.vb Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: NonInheritedTests.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Nunit/StandardClasses/NonInheritedTests.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- NonInheritedTests.vb 11 Apr 2005 00:31:49 -0000 1.1 +++ NonInheritedTests.vb 11 Apr 2005 23:27:08 -0000 1.2 @@ -54,7 +54,7 @@ Assert.AreEqual("basic", job.Description) End Sub - <Test(), ExpectedException(GetType(System.Exception))> Public Sub CheckForError() + <Test(), ExpectedException(GetType(AtomsFrameworkException))> Public Sub CheckForError() pbroker.GetObject(job) End Sub @@ -62,9 +62,9 @@ job.Id = "a2" pbroker.GetObject(job) job.Description = "SomeJob" - Assert.IsTrue(pbroker.getInjectedObject(job).IsDirty) + Assert.IsTrue(pbroker.GetInjectedObject(job).IsDirty) pbroker.PersistChanges(job) - Assert.IsFalse(pbroker.getInjectedObject(job).IsDirty) + Assert.IsFalse(pbroker.GetInjectedObject(job).IsDirty) End Sub <Test()> Public Sub DeleteAJob() @@ -103,15 +103,15 @@ pbroker.GetObject(job2) job.Description = "c" job2.Description = "d" - Assert.IsFalse(pbroker.getInjectedObject(job).Persistent) + Assert.IsFalse(pbroker.GetInjectedObject(job).Persistent) pbroker.PersistChanges() - Assert.IsTrue(pbroker.getInjectedObject(job).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(job).Persistent) End Sub <Test()> Public Sub LoadEmployee_a() emp.Name = "a" pbroker.FindObject(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) Assert.AreEqual(emp.Workers.Count, 0) Assert.IsTrue(Not emp.ReportsTo Is Nothing) Assert.AreEqual(emp.ReportsTo.Name, "c") @@ -124,7 +124,7 @@ <Test()> Public Sub LoadEmployee_ac() emp.Name = "ac" pbroker.FindObject(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) Assert.AreEqual(emp.Workers.Count, 3) emp = CType(emp.Workers.Item(1), NPEmployee) Assert.AreEqual(emp.Name, "aa") @@ -134,8 +134,8 @@ <Test()> Public Sub CheckSchemaBasedProperties() emp.Name = "ac" pbroker.FindObject(emp) - Assert.AreEqual(50, pbroker.getInjectedObject(emp).getFieldLengthByName("Name")) - Assert.IsTrue(pbroker.getInjectedObject(emp).getFieldTypeByName("Name") Is GetType([String])) + Assert.AreEqual(50, pbroker.GetInjectedObject(emp).GetFieldLengthByName("Name")) + Assert.IsTrue(pbroker.GetInjectedObject(emp).GetFieldTypeByName("Name") Is GetType([String])) End Sub <Test()> Public Sub PersistentObjectEquality() @@ -152,49 +152,49 @@ <Test()> Public Sub LoadSaveandDeleteEmployee() emp.Name = "new" pbroker.FindObject(emp) - Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) + Assert.IsFalse(pbroker.GetInjectedObject(emp).Persistent) pbroker.PersistChanges(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) Assert.IsTrue(emp.ReportsTo Is Nothing) Debug.WriteLine(pbroker.DumpCacheDetails) emp = New NPEmployee emp.Name = "new" pbroker.FindObject(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) Assert.AreEqual(emp.Name, "new") pbroker.MarkForDeletion(emp) pbroker.PersistChanges(emp) emp = New NPEmployee emp.Name = "new" pbroker.FindObject(emp) - Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) + Assert.IsFalse(pbroker.GetInjectedObject(emp).Persistent) End Sub <Test()> Public Sub ChangeFindFieldValue() emp.Name = "SaveThenChange" pbroker.FindObject(emp) - Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) + Assert.IsFalse(pbroker.GetInjectedObject(emp).Persistent) pbroker.PersistChanges(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) Assert.IsTrue(emp.ReportsTo Is Nothing) emp = New NPEmployee emp.Name = "SaveThenChange" pbroker.FindObject(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) Assert.AreEqual(emp.Name, "SaveThenChange") emp.Name = "Changed" pbroker.PersistChanges(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent) pbroker.MarkForDeletion(emp) pbroker.PersistChanges(emp) emp = New NPEmployee emp.Name = "Changed" pbroker.FindObject(emp) - Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) + Assert.IsFalse(pbroker.GetInjectedObject(emp).Persistent) emp = New NPEmployee emp.Name = "SaveThenChange" pbroker.FindObject(emp) - Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) + Assert.IsFalse(pbroker.GetInjectedObject(emp).Persistent) End Sub <Test()> Public Sub saveHierarchy() @@ -240,12 +240,12 @@ emp = New NPEmployee emp.Name = "AManager" pbroker.FindObject(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent, "AManager was deleted") + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent, "AManager was deleted") Assert.IsNull(emp.ReportsTo, "AManager's ReportsTo wasn't cleared") emp = New NPEmployee emp.Name = "AWorker" pbroker.FindObject(emp) - Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent, "AWorker was deleted") + Assert.IsTrue(pbroker.GetInjectedObject(emp).Persistent, "AWorker was deleted") End Sub <Test()> Public Sub LazyLoadEmployees() |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:46
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939 Modified Files: CInjectedObject.vb CJoin.vb CPersistenceBroker.vb CPersistentObject.vb Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- CPersistenceBroker.vb 11 Apr 2005 00:31:43 -0000 1.108 +++ CPersistenceBroker.vb 11 Apr 2005 23:27:06 -0000 1.109 @@ -2710,28 +2710,30 @@ End If 'Now go through and find out which objects have been removed from the collection 'and attempt to modify and/or delete them. - For Each value In obj.GetRemovedCollectionItems(udamap.FromClassTarget) - If udamap.DeleteAutomatic = True Then - 'Delete the object - qd = New QueuedDelete - qd.ObjectToDelete = value - q.Enqueue(qd) - Else - For Each e As AssociationMapEntry In udamap.Entries - 'Try to set to nothing first. If it fails set the value to NULL alias value - 'Need to do a get first so we know what type to alias - Try - value.SetAttributeValue(e.ToAttrMap.Name, Nothing) - Catch - tmpObj = value.GetValueByAttribute(e.ToAttrMap.Name) - ModAliasNull.NullToAlias(DBNull.Value, tmpObj) - value.SetAttributeValue(e.ToAttrMap.Name, tmpObj) - End Try - Next - 'Now add object to list to be saved - q.Enqueue(value) - End If - Next + If udamap.RetrieveAutomatic = True And udamap.LazyLoad = False Then + For Each value In obj.GetRemovedCollectionItems(udamap.FromClassTarget) + If udamap.DeleteAutomatic = True Then + 'Delete the object + qd = New QueuedDelete + qd.ObjectToDelete = value + q.Enqueue(qd) + Else + For Each e As AssociationMapEntry In udamap.Entries + 'Try to set to nothing first. If it fails set the value to NULL alias value + 'Need to do a get first so we know what type to alias + Try + value.SetAttributeValue(e.ToAttrMap.Name, Nothing) + Catch + tmpObj = value.GetValueByAttribute(e.ToAttrMap.Name) + ModAliasNull.NullToAlias(DBNull.Value, tmpObj) + value.SetAttributeValue(e.ToAttrMap.Name, tmpObj) + End Try + Next + 'Now add object to list to be saved + q.Enqueue(value) + End If + Next + End If ElseIf udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany Then If obj.GetClassMap.Name = udamap.FromClass.Name Then col = obj.GetCollectionByAttribute(udamap.FromClassTarget) @@ -3433,12 +3435,17 @@ Dim p As PropertyInfo Dim tmpObj As Object + p = fromObject.GetObjectType.GetProperty(propertyName, BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) + If p Is Nothing Then + 'Property propertyName couldn't be found + Return Nothing + End If + fromColl = fromObject.GetCollectionByAttribute(propertyName) If fromColl Is Nothing Then Return Nothing End If - p = fromObject.GetObjectType.GetProperty(propertyName, BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) iListType = p.PropertyType.GetInterface("IList", True) iDicType = p.PropertyType.GetInterface("IDictionary", True) If Not iListType Is Nothing OrElse Not iDicType Is Nothing Then Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- CInjectedObject.vb 11 Apr 2005 00:31:43 -0000 1.26 +++ CInjectedObject.vb 11 Apr 2005 23:27:06 -0000 1.27 @@ -667,7 +667,7 @@ While Not cm Is Nothing For Each de As DictionaryEntry In cm.AssociationMaps aMap = de.Value - If aMap.CardinalityType = aMap.Cardinality.OneToMany Then + If aMap.CardinalityType = aMap.Cardinality.OneToMany And aMap.LazyLoad = False And aMap.RetrieveAutomatic = True And aMap.SaveAutomatic = True Then coll = PersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) m_oneToManyCollections.Add(coll, aMap.FromClassTarget) End If Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- CPersistentObject.vb 11 Apr 2005 00:31:44 -0000 1.66 +++ CPersistentObject.vb 11 Apr 2005 23:27:07 -0000 1.67 @@ -1750,7 +1750,8 @@ While Not cm Is Nothing For Each de As DictionaryEntry In cm.AssociationMaps aMap = de.Value - If aMap.CardinalityType = aMap.Cardinality.OneToMany Then + 'Only copy associations with retrieveAutomatic="true". Exclude lazy loaded associations. + If aMap.CardinalityType = aMap.Cardinality.OneToMany And aMap.RetrieveAutomatic = True And aMap.LazyLoad = False And aMap.SaveAutomatic = True Then coll = PersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) m_oneToManyCollections.Add(coll, aMap.FromClassTarget) End If Index: CJoin.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CJoin.vb,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- CJoin.vb 11 Apr 2005 00:31:43 -0000 1.12 +++ CJoin.vb 11 Apr 2005 23:27:06 -0000 1.13 @@ -182,8 +182,7 @@ LeftSide = leftJoin RightSide = rightClassMap TableAlias = aliasName - association = association - IsSuperClass = False + m_association = association End Sub '''----------------------------------------------------------------------------- @@ -269,7 +268,7 @@ Dim s As String Dim tm As TableMap Dim cm As ClassMap - Dim i As Short ' j As Short + Dim i As Short ' j As Short Dim udaEntry As AssociationMapEntry Dim db As IRelationalDatabase Dim leftBracket As String = "(" |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:46
|
Update of /cvsroot/jcframework/dotnet/Nunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Nunit Modified Files: Nunit_AtomsFramework.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: Nunit_AtomsFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Nunit/Nunit_AtomsFramework.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Nunit_AtomsFramework.vbproj 11 Apr 2005 00:31:47 -0000 1.1 +++ Nunit_AtomsFramework.vbproj 11 Apr 2005 23:27:08 -0000 1.2 @@ -86,9 +86,9 @@ HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll" /> <Reference - Name = "Atoms.Framework" - Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" - Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" + Name = "AtomsFramework" + AssemblyName = "AtomsFramework" + HintPath = "..\bin\AtomsFramework.dll" /> </References> <Imports> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:18
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_PostgreSQL Modified Files: AF_PostgreSQL.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_PostgreSQL.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL/AF_PostgreSQL.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_PostgreSQL.vbproj 11 Apr 2005 00:31:47 -0000 1.2 +++ AF_PostgreSQL.vbproj 11 Apr 2005 23:27:10 -0000 1.3 @@ -75,7 +75,7 @@ HintPath = "..\..\..\..\misc\Npgsql\bin\ms\Npgsql.dll" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:18
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_OLEDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_OLEDB Modified Files: AF_OLEDB.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_OLEDB.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/AF_OLEDB.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_OLEDB.vbproj 11 Apr 2005 00:31:47 -0000 1.2 +++ AF_OLEDB.vbproj 11 Apr 2005 23:27:10 -0000 1.3 @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:18
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_ODBC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_ODBC Modified Files: AF_ODBC.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_ODBC.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_ODBC/AF_ODBC.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_ODBC.vbproj 11 Apr 2005 00:31:46 -0000 1.2 +++ AF_ODBC.vbproj 11 Apr 2005 23:27:09 -0000 1.3 @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:18
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MySQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_MySQL Modified Files: AF_MySQL.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_MySQL.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MySQL/AF_MySQL.vbproj,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AF_MySQL.vbproj 11 Apr 2005 00:31:46 -0000 1.3 +++ AF_MySQL.vbproj 11 Apr 2005 23:27:09 -0000 1.4 @@ -75,7 +75,7 @@ HintPath = "..\..\..\..\..\Program Files\MySQL\MySQL Connector Net 1.0.4\bin\.NET 1.1\MySql.Data.dll" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:17
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MSSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_MSSQL Modified Files: AF_MSSQL.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_MSSQL.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSSQL/AF_MSSQL.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_MSSQL.vbproj 11 Apr 2005 00:31:45 -0000 1.2 +++ AF_MSSQL.vbproj 11 Apr 2005 23:27:09 -0000 1.3 @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:17
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MSOracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_MSOracle Modified Files: AF_MSOracle.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_MSOracle.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSOracle/AF_MSOracle.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_MSOracle.vbproj 11 Apr 2005 00:31:45 -0000 1.2 +++ AF_MSOracle.vbproj 11 Apr 2005 23:27:09 -0000 1.3 @@ -75,7 +75,7 @@ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.OracleClient.dll" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:17
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_Informix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_Informix Modified Files: AF_Informix.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_Informix.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Informix/AF_Informix.vbproj,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AF_Informix.vbproj 11 Apr 2005 00:31:45 -0000 1.3 +++ AF_Informix.vbproj 11 Apr 2005 23:27:08 -0000 1.4 @@ -75,7 +75,7 @@ HintPath = "..\..\..\..\..\Program Files\Informix\Client-SDK\bin\IBM.Data.Informix.dll" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:27:17
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_Firebird In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10939/Providers/AF_Firebird Modified Files: AF_Firebird.vbproj Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. More changes related to naming Index: AF_Firebird.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Firebird/AF_Firebird.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_Firebird.vbproj 11 Apr 2005 00:31:44 -0000 1.2 +++ AF_Firebird.vbproj 11 Apr 2005 23:27:08 -0000 1.3 @@ -76,7 +76,7 @@ AssemblyFolderKey = "hklm\dn\firebirdsql.data.firebird" /> <Reference - Name = "Atoms.Framework" + Name = "AtomsFramework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
From: Richard B. <rb...@us...> - 2005-04-11 23:17:40
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5193 Modified Files: Tag: v2_1 CInjectedObject.vb CPersistenceBroker.vb CPersistentObject.vb Log Message: Only copy one-to-many collections if the association is retrieveAutomatic. Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.107 retrieving revision 1.107.2.1 diff -u -d -r1.107 -r1.107.2.1 --- CPersistenceBroker.vb 7 Apr 2005 07:08:16 -0000 1.107 +++ CPersistenceBroker.vb 11 Apr 2005 23:17:26 -0000 1.107.2.1 @@ -2716,6 +2716,7 @@ End If 'Now go through and find out which objects have been removed from the collection 'and attempt to modify and/or delete them. + If udamap.RetrieveAutomatic = True And udamap.LazyLoad = False Then For Each value In obj.GetRemovedCollectionItems(udamap.FromClassTarget) If udamap.DeleteAutomatic = True Then 'Delete the object @@ -2738,6 +2739,7 @@ q.Enqueue(value) End If Next + End If ElseIf udamap.Cardinality = CUDAMap.CardinalityEnum.MANY_TO_MANY Then If obj.GetClassMap.Name = udamap.FromClass.Name Then col = obj.GetCollectionByAttribute(udamap.FromClassTarget) @@ -3409,12 +3411,17 @@ Dim p As PropertyInfo Dim tmpObj As Object + p = fromObject.GetObjectType.GetProperty(propertyName, BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) + If p Is Nothing Then + 'Property propertyName couldn't be found + Return Nothing + End If + fromColl = fromObject.GetCollectionByAttribute(propertyName) If fromColl Is Nothing Then Return Nothing End If - p = fromObject.GetObjectType.GetProperty(propertyName, BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) iListType = p.PropertyType.GetInterface("IList", True) iDicType = p.PropertyType.GetInterface("IDictionary", True) If Not iListType Is Nothing OrElse Not iDicType Is Nothing Then Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -d -r1.25 -r1.25.2.1 --- CInjectedObject.vb 7 Apr 2005 07:08:16 -0000 1.25 +++ CInjectedObject.vb 11 Apr 2005 23:17:19 -0000 1.25.2.1 @@ -665,11 +665,11 @@ While Not cm Is Nothing For Each de As DictionaryEntry In cm.AssociationMaps aMap = de.Value - If aMap.Cardinality = aMap.CardinalityEnum.ONE_TO_MANY Then - coll = CPersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) - m_oneToManyCollections.Add(coll, aMap.FromClassTarget) - End If - Next + If aMap.Cardinality = aMap.CardinalityEnum.ONE_TO_MANY And aMap.LazyLoad = False And aMap.RetrieveAutomatic = True And aMap.SaveAutomatic = True Then + coll = CPersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) + m_oneToManyCollections.Add(coll, aMap.FromClassTarget) + End If + Next cm = cm.SuperClass End While End Sub Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -u -d -r1.65 -r1.65.2.1 --- CPersistentObject.vb 7 Apr 2005 07:08:18 -0000 1.65 +++ CPersistentObject.vb 11 Apr 2005 23:17:28 -0000 1.65.2.1 @@ -602,17 +602,17 @@ dotPos = pName.IndexOf(".") Try - If dotPos = -1 Then + If dotPos = -1 Then obj = CallByName(Me, pName, CallType.Get) - Else - Dim o As Object - Dim objName As String - Dim propertyName As String - objName = pName.Substring(0, dotPos) - propertyName = pName.Substring(dotPos + 1) - o = CallByName(Me, objName, CallType.Get) + Else + Dim o As Object + Dim objName As String + Dim propertyName As String + objName = pName.Substring(0, dotPos) + propertyName = pName.Substring(dotPos + 1) + o = CallByName(Me, objName, CallType.Get) obj = CallByName(o, propertyName, CallType.Get) - End If + End If If obj Is Nothing Then Return Nothing If TypeOf obj Is IPersistableObject Then injobj = obj @@ -919,57 +919,57 @@ Public Overridable Sub Save(ByVal obj As CPersistentObject, ByVal checkAssociationsRecursivly As Boolean) Implements IPersistentObject.save Dim persistentBroker As CPersistenceBroker Dim value As IPersistableObject - Dim queue As queue + Dim queue As Queue Dim qObject As Object Dim savedKeys As New ArrayList Dim ckey As CCacheKey persistentBroker = getPersistenceBrokerInstance() Try - queue = persistentBroker.getObjectsToSave(obj, True, checkAssociationsRecursivly) - 'All objects to be saved must be saved in a single transaction. - If queue.Count > 0 Then - persistentBroker.startTransaction() - Do While queue.Count > 0 - qObject = queue.Dequeue() - Try - If GetType(CAssociationObject).IsInstanceOfType(qObject) Then - persistentBroker.saveAssociationObject(qObject) - ElseIf GetType(CQueuedDelete).IsInstanceOfType(qObject) Then - Try - persistentBroker.deleteObject(CType(qObject, CQueuedDelete).ObjectToDelete) - Catch ex As Exception - Debug.WriteLine("(Queued Delete) Tried to delete an object that has already been removed") - Debug.WriteLine(ex.Message) - End Try - Else - value = qObject - 'Normal object saving - ckey = New CCacheKey(value) - If savedKeys.Contains(ckey) Then - 'object was already saved (could be new object referenced by multiple other new objects) - Debug.WriteLine("The object with key " & ckey.ToString & " was already saved once") + queue = persistentBroker.getObjectsToSave(obj, True, checkAssociationsRecursivly) + 'All objects to be saved must be saved in a single transaction. + If queue.Count > 0 Then + persistentBroker.startTransaction() + Do While queue.Count > 0 + qObject = queue.Dequeue() + Try + If GetType(CAssociationObject).IsInstanceOfType(qObject) Then + persistentBroker.saveAssociationObject(qObject) + ElseIf GetType(CQueuedDelete).IsInstanceOfType(qObject) Then + Try + persistentBroker.deleteObject(CType(qObject, CQueuedDelete).ObjectToDelete) + Catch ex As Exception + Debug.WriteLine("(Queued Delete) Tried to delete an object that has already been removed") + Debug.WriteLine(ex.Message) + End Try Else - persistentBroker.saveObject(value) - 'Recopy one-to-many collections incase object is resaved later - value.CopyOneToManyCollections() - 'Need to recalculate the key here to handle objects using identity (autonumber) keys + value = qObject + 'Normal object saving ckey = New CCacheKey(value) - savedKeys.Add(ckey) + If savedKeys.Contains(ckey) Then + 'object was already saved (could be new object referenced by multiple other new objects) + Debug.WriteLine("The object with key " & ckey.ToString & " was already saved once") + Else + persistentBroker.saveObject(value) + 'Recopy one-to-many collections incase object is resaved later + value.CopyOneToManyCollections() + 'Need to recalculate the key here to handle objects using identity (autonumber) keys + ckey = New CCacheKey(value) + savedKeys.Add(ckey) + End If End If - End If - Catch ex As Exception - 'After an error remove the cached object so that the next retrieve - ' will refresh the cache with the item from the database - persistentBroker.deleteCachedObject(value) - 'Abort the transaction and throw an error - persistentBroker.rollback() - Throw New SaveException(ex.Message, ex) - End Try - value.IsDirty = False - Loop - persistentBroker.commit() - End If + Catch ex As Exception + 'After an error remove the cached object so that the next retrieve + ' will refresh the cache with the item from the database + persistentBroker.deleteCachedObject(value) + 'Abort the transaction and throw an error + persistentBroker.rollback() + Throw New SaveException(ex.Message, ex) + End Try + value.IsDirty = False + Loop + persistentBroker.commit() + End If Catch sx As SaveException Throw sx Catch ex As Exception @@ -1754,13 +1754,14 @@ m_oneToManyCollections = New Collection Dim aMap As CUDAMap While Not cm Is Nothing - For Each de As DictionaryEntry In cm.AssociationMaps - aMap = de.Value - If aMap.Cardinality = aMap.CardinalityEnum.ONE_TO_MANY Then - coll = CPersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) - m_oneToManyCollections.Add(coll, aMap.FromClassTarget) - End If - Next + For Each de As DictionaryEntry In cm.AssociationMaps + aMap = de.Value + 'Only copy associations with retrieveAutomatic="true". Exclude lazy loaded associations. + If aMap.Cardinality = aMap.CardinalityEnum.ONE_TO_MANY And aMap.RetrieveAutomatic = True And aMap.LazyLoad = False And aMap.SaveAutomatic = True Then + coll = CPersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) + m_oneToManyCollections.Add(coll, aMap.FromClassTarget) + End If + Next cm = cm.SuperClass End While End Sub |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:43
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_PostgreSQL Modified Files: AF_PostgreSQL.vbproj AssemblyInfo.vb CPostgreSQLConnection.vb CPostgreSQLDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:23 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:47 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> Index: CPostgreSQLDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL/CPostgreSQLDatabase.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CPostgreSQLDatabase.vb 7 Feb 2005 23:09:32 -0000 1.1 +++ CPostgreSQLDatabase.vb 11 Apr 2005 00:31:47 -0000 1.2 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On Imports Npgsql -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for Postgres SQL Servers. +''' Implementation of RelationalDatabase for Postgres SQL Servers. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with PostgreSQL databases.</remarks> @@ -18,7 +18,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class CPostgreSQLDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase Private m_name As String Private m_user As String @@ -30,7 +30,7 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A CMSSqlConnection containing the newly established connection.</returns> - ''' <remarks>The CMSSqlConnection class implements the _CConnection interface which + ''' <remarks>The CMSSqlConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para> ''' <para>The connection is established using normal SQL server authentication (ie @@ -39,7 +39,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New CPostgreSQLConnection conn.Connection = New NpgsqlConnection conn.ManageTransactions = True @@ -47,9 +47,9 @@ If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If conn.Connection.ConnectionString = _ "Data Source=" & m_serverName & ";" & _ @@ -193,9 +193,9 @@ Dim row As System.Data.DataRow Dim p As NpgsqlParameter Dim initvals() As Object = {1} - Dim x As OIDException + Dim x As ObjectIdException Dim conn As CPostgreSQLConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -215,10 +215,10 @@ conn.commit() Catch err As NpgsqlException conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -242,7 +242,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New NpgsqlDataAdapter Dim cb As NpgsqlCommandBuilder @@ -285,23 +285,24 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String - Return "@p" & CStr(i) + Public Overrides Function GetParameterHolder(ByVal parameterNumber As Integer) As String + Return "@p" & CStr(parameterNumber) End Function - Public Overrides Function limitClauseAtStart() As Boolean + Public Overrides Function LimitClauseAtStart() As Boolean Return True End Function - Public Overrides Function getClauseStringLimit() As String + Public Overrides Function GetClauseStringLimit() As String Return "TOP" End Function - Public Overrides Function getClauseStringTableAlias(ByVal table As String, ByVal owner As String, ByVal pAlias As String) As String + Public Overrides Function GetClauseStringTableAlias(ByVal table As String, ByVal owner As String, ByVal pAlias As String) As String Return Me.m_name & "." & owner & "." & table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As CPostgreSQLConnection Index: CPostgreSQLConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL/CPostgreSQLConnection.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CPostgreSQLConnection.vb 1 Apr 2005 00:04:37 -0000 1.2 +++ CPostgreSQLConnection.vb 11 Apr 2005 00:31:47 -0000 1.3 @@ -1,5 +1,5 @@ Imports Npgsql -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for MSSql data sources ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to MSSQL datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class CPostgreSQLConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As NpgsqlTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -66,7 +66,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -74,7 +74,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -85,7 +85,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -93,7 +93,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -104,7 +104,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -112,7 +112,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -123,14 +123,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -165,13 +165,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -191,7 +191,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <remarks></remarks> @@ -200,10 +200,10 @@ ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New NpgsqlCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As NpgsqlParameter Dim dd As Date @@ -234,7 +234,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <returns></returns> @@ -243,10 +243,10 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(CPostgreSQLConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As NpgsqlParameter Dim dd As Date Dim m_command As New NpgsqlCommand @@ -257,7 +257,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New NpgsqlParameter param.ParameterName = cp.Name @@ -286,15 +286,15 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback - Dim pb As CPersistenceBroker + Public Sub rollback() Implements IConnection.rollback + Dim pb As PersistenceBroker If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -328,14 +328,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -344,7 +344,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -352,7 +352,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -360,7 +360,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -368,7 +368,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -379,7 +379,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTableSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTableSchema">IConnection</see>. ''' </summary> ''' <param name="tName"></param> ''' <returns></returns> @@ -388,7 +388,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As NpgsqlCommand Dim dr As NpgsqlDataReader @@ -406,7 +406,7 @@ Return dt End Function - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -424,11 +424,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property Index: AF_PostgreSQL.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_PostgreSQL/AF_PostgreSQL.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_PostgreSQL.vbproj 7 Feb 2005 23:09:31 -0000 1.1 +++ AF_PostgreSQL.vbproj 11 Apr 2005 00:31:47 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_PostgreSQL" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.PostgreSQL" + StartupObject = "AtomsFramework.Providers.PostgreSQL.(None)" > <Config Name = "Debug" @@ -70,15 +70,15 @@ AssemblyName = "System.Xml" /> <Reference - Name = "AToMSFramework" - Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" - Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" - /> - <Reference Name = "Npgsql" AssemblyName = "Npgsql" HintPath = "..\..\..\..\misc\Npgsql\bin\ms\Npgsql.dll" /> + <Reference + Name = "Atoms.Framework" + Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" + Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" + /> </References> <Imports> <Import Namespace = "Microsoft.VisualBasic" /> |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:42
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_OLEDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_OLEDB Modified Files: AF_OLEDB.vbproj AssemblyInfo.vb COleDBConnection.vb COleDbDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: COleDbDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/COleDbDatabase.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- COleDbDatabase.vb 22 Mar 2005 06:19:15 -0000 1.3 +++ COleDbDatabase.vb 11 Apr 2005 00:31:47 -0000 1.4 @@ -3,7 +3,7 @@ Imports System.Data.OleDb Imports System.Collections.Specialized -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -11,7 +11,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for Microsoft Access and other OLEDB sources +''' Implementation of RelationalDatabase for Microsoft Access and other OLEDB sources ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with Microsoft Access databases and other OLEDB compliant @@ -21,7 +21,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class COleDbDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase '************************************************** 'Class: CMsAccessDatabase @@ -142,23 +142,23 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A COleDBConnection containing the newly established connection.</returns> - ''' <remarks>The COleDBConnection class implements the _CConnection interface which + ''' <remarks>The COleDBConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para></remarks> ''' <history> ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New COleDBConnection Try conn.Connection = New OleDbConnection If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If If m_user Is Nothing OrElse m_user.Length = 0 Then conn.Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + m_name + ";" @@ -190,11 +190,11 @@ Dim aValue As Integer Dim row As System.Data.DataRow Dim p As OleDbParameter - Dim x As OIDException + Dim x As ObjectIdException Dim initvals() As Object = {1} Dim conn As COleDBConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -222,7 +222,7 @@ conn.commit() Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -246,7 +246,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New OleDbDataAdapter Dim cb As OleDbCommandBuilder @@ -289,13 +289,13 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return "?" End Function '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CRelationalDatabase.getClauseStringTableAlias">_CRelationalDatabase</see>. + ''' See <see cref="P:AToMSFramework.IRelationalDatabase.getClauseStringTableAlias">IRelationalDatabase</see>. ''' </summary> ''' <param name="table"></param> ''' <param name="pAlias"></param> @@ -309,7 +309,8 @@ Return table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then m_disposed = True Index: COleDBConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/COleDBConnection.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- COleDBConnection.vb 1 Apr 2005 00:04:36 -0000 1.3 +++ COleDBConnection.vb 11 Apr 2005 00:31:47 -0000 1.4 @@ -1,5 +1,5 @@ Imports System.Data.OleDb -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for OLEDB data sources (specifically Microsoft Access) ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to OLEDB datasources (specifically Microsoft Access).</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 28/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class COleDBConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As OleDbTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -64,13 +64,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 28/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -81,13 +81,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -98,13 +98,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -115,13 +115,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -158,13 +158,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -184,17 +184,17 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New OleDbCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As OleDbParameter Try @@ -227,16 +227,16 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(COleDBConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As OleDbParameter Dim dd As Date Dim m_command As New OleDbCommand @@ -247,7 +247,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New OleDbParameter param.ParameterName = cp.Name @@ -277,14 +277,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback + Public Sub rollback() Implements IConnection.rollback If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -318,13 +318,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -333,13 +333,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -347,13 +347,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -364,13 +364,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTablesSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTablesSchema">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As OleDbCommand Dim dr As OleDbDataReader @@ -390,13 +390,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -414,11 +414,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property @@ -452,7 +452,7 @@ Protected Overrides Sub Finalize() ' Simply call Dispose(False). Dispose(False) - MyBase.finalize() + MyBase.Finalize() End Sub End Class Index: AF_OLEDB.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/AF_OLEDB.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_OLEDB.vbproj 7 Feb 2005 07:37:54 -0000 1.1 +++ AF_OLEDB.vbproj 11 Apr 2005 00:31:47 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_OLEDB" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.OLEDB" + StartupObject = "AtomsFramework.Providers.OLEDB.(None)" > <Config Name = "Debug" @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "AToMSFramework" + Name = "Atoms.Framework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:47 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:41
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_Firebird In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_Firebird Modified Files: AF_Firebird.vbproj AssemblyInfo.vb CFirebirdConnection.vb CFirebirdDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: CFirebirdDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Firebird/CFirebirdDatabase.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CFirebirdDatabase.vb 7 Feb 2005 23:29:48 -0000 1.1 +++ CFirebirdDatabase.vb 11 Apr 2005 00:31:44 -0000 1.2 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On Imports FirebirdSql.Data.Firebird -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for Microsoft SQL Server. +''' Implementation of RelationalDatabase for Microsoft SQL Server. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with Microsoft SQL databases.</remarks> @@ -18,7 +18,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class CMsSqlDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase Private m_name As String Private m_user As String @@ -30,7 +30,7 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A CMSSqlConnection containing the newly established connection.</returns> - ''' <remarks>The CMSSqlConnection class implements the _CConnection interface which + ''' <remarks>The CMSSqlConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para> ''' <para>The connection is established using normal SQL server authentication (ie @@ -39,7 +39,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New CFirebirdConnection conn.Connection = New FbConnection conn.ManageTransactions = True @@ -47,9 +47,9 @@ If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If conn.Connection.ConnectionString = _ "Data Source=" & m_serverName & ";" & _ @@ -193,9 +193,9 @@ Dim row As System.Data.DataRow Dim p As FbParameter Dim initvals() As Object = {1} - Dim x As OIDException + Dim x As ObjectIdException Dim conn As CFirebirdConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -215,10 +215,10 @@ conn.commit() Catch err As FbException conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -242,7 +242,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New FbDataAdapter Dim cb As FbCommandBuilder @@ -285,7 +285,7 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return "@p" & CStr(i) End Function @@ -301,7 +301,8 @@ Return Me.m_name & "." & owner & "." & table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As CFirebirdConnection Index: AF_Firebird.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Firebird/AF_Firebird.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_Firebird.vbproj 7 Feb 2005 23:29:48 -0000 1.1 +++ AF_Firebird.vbproj 11 Apr 2005 00:31:44 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_Firebird" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.Firebird" + StartupObject = "AtomsFramework.Providers.Firebird.(None)" > <Config Name = "Debug" @@ -70,16 +70,16 @@ AssemblyName = "System.Xml" /> <Reference - Name = "AToMSFramework" - Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" - Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" - /> - <Reference Name = "FirebirdSql.Data.Firebird" AssemblyName = "FirebirdSql.Data.Firebird" HintPath = "..\..\..\..\..\Program Files\FirebirdNETProvider1.7\FirebirdSql.Data.Firebird.dll" AssemblyFolderKey = "hklm\dn\firebirdsql.data.firebird" /> + <Reference + Name = "Atoms.Framework" + Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" + Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" + /> </References> <Imports> <Import Namespace = "Microsoft.VisualBasic" /> Index: CFirebirdConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Firebird/CFirebirdConnection.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CFirebirdConnection.vb 1 Apr 2005 00:04:20 -0000 1.2 +++ CFirebirdConnection.vb 11 Apr 2005 00:31:44 -0000 1.3 @@ -1,5 +1,5 @@ Imports FirebirdSql.Data.Firebird -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for MSSql data sources ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to MSSQL datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class CFirebirdConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As FbTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -66,7 +66,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -74,7 +74,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -85,7 +85,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -93,7 +93,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -104,7 +104,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -112,7 +112,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -123,14 +123,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -165,13 +165,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -191,7 +191,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <remarks></remarks> @@ -200,10 +200,10 @@ ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New FbCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As FbParameter Dim dd As Date @@ -234,7 +234,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <returns></returns> @@ -243,10 +243,10 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(CFirebirdConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As FbParameter Dim dd As Date Dim m_command As New FbCommand @@ -257,7 +257,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New FbParameter param.ParameterName = cp.Name @@ -286,15 +286,15 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback - Dim pb As CPersistenceBroker + Public Sub rollback() Implements IConnection.rollback + Dim pb As PersistenceBroker If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -328,14 +328,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -344,7 +344,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -352,7 +352,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -360,7 +360,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -368,7 +368,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -379,7 +379,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTableSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTableSchema">IConnection</see>. ''' </summary> ''' <param name="tName"></param> ''' <returns></returns> @@ -388,7 +388,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As FbCommand Dim dr As FbDataReader @@ -406,7 +406,7 @@ Return dt End Function - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -424,11 +424,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Firebird/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:21 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:44 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:36
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MSSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_MSSQL Modified Files: AF_MSSQL.vbproj AssemblyInfo.vb CMsSqlConnection.vb CMsSqlDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSSQL/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:45 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> Index: AF_MSSQL.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSSQL/AF_MSSQL.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_MSSQL.vbproj 7 Feb 2005 07:37:36 -0000 1.1 +++ AF_MSSQL.vbproj 11 Apr 2005 00:31:45 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_MSSQL" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.MSSQL" + StartupObject = "AtomsFramework.Providers.MSSQL.(None)" > <Config Name = "Debug" @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "AToMSFramework" + Name = "Atoms.Framework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> Index: CMsSqlDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSSQL/CMsSqlDatabase.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CMsSqlDatabase.vb 22 Mar 2005 06:19:14 -0000 1.2 +++ CMsSqlDatabase.vb 11 Apr 2005 00:31:45 -0000 1.3 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On Imports System.Data.SqlClient -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for Microsoft SQL Server. +''' Implementation of RelationalDatabase for Microsoft SQL Server. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with Microsoft SQL databases.</remarks> @@ -18,7 +18,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class CMsSqlDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase Private m_name As String Private m_user As String @@ -30,7 +30,7 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A CMSSqlConnection containing the newly established connection.</returns> - ''' <remarks>The CMSSqlConnection class implements the _CConnection interface which + ''' <remarks>The CMSSqlConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para> ''' <para>The connection is established using normal SQL server authentication (ie @@ -39,7 +39,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New CMSSqlConnection conn.Connection = New SqlConnection conn.ManageTransactions = True @@ -47,9 +47,9 @@ If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If If m_user = "SSPI" Then conn.Connection.ConnectionString = _ @@ -201,9 +201,9 @@ Dim row As System.Data.DataRow Dim p As SqlParameter Dim initvals() As Object = {1} - Dim x As OIDException + Dim x As ObjectIdException Dim conn As CMSSqlConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -223,10 +223,10 @@ conn.commit() Catch err As SqlException conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -250,7 +250,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New SqlDataAdapter Dim cb As SqlCommandBuilder @@ -293,7 +293,7 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return "@p" & CStr(i) End Function @@ -309,7 +309,8 @@ Return Me.m_name & "." & owner & "." & table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As CMSSqlConnection Index: CMsSqlConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSSQL/CMsSqlConnection.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CMsSqlConnection.vb 1 Apr 2005 00:04:35 -0000 1.2 +++ CMsSqlConnection.vb 11 Apr 2005 00:31:45 -0000 1.3 @@ -1,5 +1,5 @@ Imports System.Data.SqlClient -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for MSSql data sources ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to MSSQL datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class CMSSqlConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As SqlTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -66,7 +66,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -74,7 +74,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -85,7 +85,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -93,7 +93,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -104,7 +104,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -112,7 +112,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -123,14 +123,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -165,13 +165,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -191,7 +191,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <remarks></remarks> @@ -200,10 +200,10 @@ ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New SqlCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As SqlParameter Dim dd As Date @@ -243,7 +243,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <returns></returns> @@ -252,10 +252,10 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement - SyncLock GetType(CMsSqlConnection) + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement + SyncLock GetType(CMSSqlConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As SqlParameter Dim dd As Date Dim m_command As New SqlCommand @@ -266,7 +266,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New SqlParameter param.ParameterName = cp.Name @@ -304,15 +304,15 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback - Dim pb As CPersistenceBroker + Public Sub rollback() Implements IConnection.rollback + Dim pb As PersistenceBroker If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -346,14 +346,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -362,7 +362,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -370,7 +370,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -378,7 +378,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -386,7 +386,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -397,7 +397,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTableSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTableSchema">IConnection</see>. ''' </summary> ''' <param name="tName"></param> ''' <returns></returns> @@ -406,7 +406,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As SqlCommand Dim dr As SqlDataReader @@ -424,7 +424,7 @@ Return dt End Function - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -442,11 +442,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:35
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_Informix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_Informix Modified Files: AF_Informix.vbproj AssemblyInfo.vb CInformixConnection.vb CInformixDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Informix/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:21 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:45 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> Index: CInformixDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Informix/CInformixDatabase.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CInformixDatabase.vb 1 Apr 2005 00:04:32 -0000 1.3 +++ CInformixDatabase.vb 11 Apr 2005 00:31:45 -0000 1.4 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On Imports IBM.Data.Informix -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for IBM Informix Servers. +''' Implementation of RelationalDatabase for IBM Informix Servers. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with Informix databases.</remarks> @@ -18,7 +18,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class CInformixDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase Private m_name As String Private m_user As String @@ -32,7 +32,7 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A CInformixConnection containing the newly established connection.</returns> - ''' <remarks>The CInformixConnection class implements the _CConnection interface which + ''' <remarks>The CInformixConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para> ''' <para>The connection is established using normal SQL server authentication (ie @@ -41,7 +41,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New CInformixConnection conn.Connection = New IfxConnection conn.ManageTransactions = True @@ -49,9 +49,9 @@ If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If If m_service = String.Empty Then m_service = "8080" conn.Connection.ConnectionString = _ @@ -192,9 +192,9 @@ Dim row As System.Data.DataRow Dim p As IfxParameter Dim initvals() As Object = {1} - Dim x As OIDException + Dim x As ObjectIdException Dim conn As CInformixConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -214,10 +214,10 @@ conn.commit() Catch err As IfxException conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -241,7 +241,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New IfxDataAdapter Dim cb As IfxCommandBuilder @@ -284,7 +284,7 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return "@p" & CStr(i) End Function @@ -300,7 +300,8 @@ Return Me.m_name & "." & owner & "." & table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As CInformixConnection Index: CInformixConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Informix/CInformixConnection.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CInformixConnection.vb 1 Apr 2005 00:04:31 -0000 1.3 +++ CInformixConnection.vb 11 Apr 2005 00:31:45 -0000 1.4 @@ -1,5 +1,5 @@ Imports IBM.Data.Informix -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for Informix data sources ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to Informix datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -21,13 +21,13 @@ ''' outside transactions to also roll back.</para> ''' <para>Built against client SDK version 2.81.TC3 ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class CInformixConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -42,7 +42,7 @@ Private m_transaction As IfxTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -67,7 +67,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -75,7 +75,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -86,7 +86,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -94,7 +94,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -105,7 +105,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -113,7 +113,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -124,14 +124,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -166,13 +166,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -192,7 +192,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <remarks></remarks> @@ -201,10 +201,10 @@ ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New IfxCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As IfxParameter Dim dd As Date @@ -235,7 +235,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <returns></returns> @@ -244,10 +244,10 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(CInformixConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As IfxParameter Dim dd As Date Dim m_command As New IfxCommand @@ -258,7 +258,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New IfxParameter param.ParameterName = cp.Name @@ -287,15 +287,15 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback - Dim pb As CPersistenceBroker + Public Sub rollback() Implements IConnection.rollback + Dim pb As PersistenceBroker If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -329,14 +329,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -345,7 +345,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -353,7 +353,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -361,7 +361,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -369,7 +369,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -380,7 +380,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTableSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTableSchema">IConnection</see>. ''' </summary> ''' <param name="tName"></param> ''' <returns></returns> @@ -389,7 +389,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As IfxCommand Dim dr As IfxDataReader @@ -407,7 +407,7 @@ Return dt End Function - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -425,11 +425,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property Index: AF_Informix.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_Informix/AF_Informix.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_Informix.vbproj 7 Feb 2005 13:22:06 -0000 1.2 +++ AF_Informix.vbproj 11 Apr 2005 00:31:45 -0000 1.3 @@ -1,112 +1,112 @@ -<VisualStudioProject> - <VisualBasic - ProjectType = "Local" - ProductVersion = "7.10.3077" - SchemaVersion = "2.0" - ProjectGuid = "{09659A30-0220-42BF-9478-267278E89692}" - > - <Build> - <Settings - ApplicationIcon = "" - AssemblyKeyContainerName = "" - AssemblyName = "AF_Informix" - AssemblyOriginatorKeyFile = "" - AssemblyOriginatorKeyMode = "None" - DefaultClientScript = "JScript" - DefaultHTMLPageLayout = "Grid" - DefaultTargetSchema = "IE50" - DelaySign = "false" - OutputType = "Library" - OptionCompare = "Binary" - OptionExplicit = "On" - OptionStrict = "Off" - RootNamespace = "AF_Informix" - StartupObject = "" - > - <Config - Name = "Debug" - BaseAddress = "285212672" - ConfigurationOverrideFile = "" - DefineConstants = "" - DefineDebug = "true" - DefineTrace = "true" - DebugSymbols = "true" - IncrementalBuild = "true" - Optimize = "false" - OutputPath = "bin\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "1" - /> - <Config - Name = "Release" - BaseAddress = "285212672" - ConfigurationOverrideFile = "" - DefineConstants = "" - DefineDebug = "false" - DefineTrace = "true" - DebugSymbols = "false" - IncrementalBuild = "false" - Optimize = "true" - OutputPath = "bin\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "1" - /> - </Settings> - <References> - <Reference - Name = "System" - AssemblyName = "System" - /> - <Reference - Name = "System.Data" - AssemblyName = "System.Data" - /> - <Reference - Name = "System.XML" - AssemblyName = "System.Xml" - /> - <Reference - Name = "AToMSFramework" - Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" - Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" - /> - <Reference - Name = "IBM.Data.Informix" - AssemblyName = "IBM.Data.Informix" - HintPath = "..\..\..\..\..\Program Files\Informix\Client-SDK\bin\IBM.Data.Informix.dll" - /> - </References> - <Imports> - <Import Namespace = "Microsoft.VisualBasic" /> - <Import Namespace = "System" /> - <Import Namespace = "System.Collections" /> - <Import Namespace = "System.Data" /> - <Import Namespace = "System.Diagnostics" /> - </Imports> - </Build> - <Files> - <Include> - <File - RelPath = "AssemblyInfo.vb" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "CInformixConnection.vb" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "CInformixDatabase.vb" - SubType = "Code" - BuildAction = "Compile" - /> - </Include> - </Files> - </VisualBasic> -</VisualStudioProject> - +<VisualStudioProject> + <VisualBasic + ProjectType = "Local" + ProductVersion = "7.10.3077" + SchemaVersion = "2.0" + ProjectGuid = "{09659A30-0220-42BF-9478-267278E89692}" + > + <Build> + <Settings + ApplicationIcon = "" + AssemblyKeyContainerName = "" + AssemblyName = "AF_Informix" + AssemblyOriginatorKeyFile = "" + AssemblyOriginatorKeyMode = "None" + DefaultClientScript = "JScript" + DefaultHTMLPageLayout = "Grid" + DefaultTargetSchema = "IE50" + DelaySign = "false" + OutputType = "Library" + OptionCompare = "Binary" + OptionExplicit = "On" + OptionStrict = "Off" + RootNamespace = "AtomsFramework.Providers.Informix" + StartupObject = "AtomsFramework.Providers.Informix.(None)" + > + <Config + Name = "Debug" + BaseAddress = "285212672" + ConfigurationOverrideFile = "" + DefineConstants = "" + DefineDebug = "true" + DefineTrace = "true" + DebugSymbols = "true" + IncrementalBuild = "true" + Optimize = "false" + OutputPath = "bin\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "1" + /> + <Config + Name = "Release" + BaseAddress = "285212672" + ConfigurationOverrideFile = "" + DefineConstants = "" + DefineDebug = "false" + DefineTrace = "true" + DebugSymbols = "false" + IncrementalBuild = "false" + Optimize = "true" + OutputPath = "bin\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "1" + /> + </Settings> + <References> + <Reference + Name = "System" + AssemblyName = "System" + /> + <Reference + Name = "System.Data" + AssemblyName = "System.Data" + /> + <Reference + Name = "System.XML" + AssemblyName = "System.Xml" + /> + <Reference + Name = "IBM.Data.Informix" + AssemblyName = "IBM.Data.Informix" + HintPath = "..\..\..\..\..\Program Files\Informix\Client-SDK\bin\IBM.Data.Informix.dll" + /> + <Reference + Name = "Atoms.Framework" + Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" + Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" + /> + </References> + <Imports> + <Import Namespace = "Microsoft.VisualBasic" /> + <Import Namespace = "System" /> + <Import Namespace = "System.Collections" /> + <Import Namespace = "System.Data" /> + <Import Namespace = "System.Diagnostics" /> + </Imports> + </Build> + <Files> + <Include> + <File + RelPath = "AssemblyInfo.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "CInformixConnection.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "CInformixDatabase.vb" + SubType = "Code" + BuildAction = "Compile" + /> + </Include> + </Files> + </VisualBasic> +</VisualStudioProject> + |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:35
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MSOracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_MSOracle Modified Files: AF_MSOracle.vbproj AssemblyInfo.vb COracleConnection.vb COracleDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSOracle/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:21 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:45 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> Index: COracleDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSOracle/COracleDatabase.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- COracleDatabase.vb 7 Feb 2005 07:37:36 -0000 1.1 +++ COracleDatabase.vb 11 Apr 2005 00:31:45 -0000 1.2 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On Imports System.Data.OracleClient -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for Oracle Database Servers. +''' Implementation of RelationalDatabase for Oracle Database Servers. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with oracle databases.</remarks> @@ -18,7 +18,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class COracleDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase Private m_user As String Private m_password As String @@ -29,14 +29,14 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A COracleConnection containing the newly established connection.</returns> - ''' <remarks>The COracleConnection class implements the _CConnection interface which + ''' <remarks>The COracleConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para> ''' <history> ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New COracleConnection conn.Connection = New OracleConnection conn.ManageTransactions = True @@ -44,9 +44,9 @@ If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If If m_user = "SSPI" Then conn.Connection.ConnectionString = _ @@ -194,9 +194,9 @@ Dim row As System.Data.DataRow Dim p As OracleParameter Dim initvals() As Object = {1} - Dim x As OIDException + Dim x As ObjectIdException Dim conn As COracleConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -216,10 +216,10 @@ conn.commit() Catch err As OracleException conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -243,7 +243,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New OracleDataAdapter Dim cb As OracleCommandBuilder @@ -286,7 +286,7 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return ":p" & CStr(i) End Function @@ -302,7 +302,8 @@ Return owner & "." & table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As COracleConnection Index: AF_MSOracle.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSOracle/AF_MSOracle.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_MSOracle.vbproj 7 Feb 2005 07:37:36 -0000 1.1 +++ AF_MSOracle.vbproj 11 Apr 2005 00:31:45 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_MSOracle" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.MSOracle" + StartupObject = "AtomsFramework.Providers.MSOracle.(None)" > <Config Name = "Debug" @@ -75,7 +75,7 @@ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.OracleClient.dll" /> <Reference - Name = "AToMSFramework" + Name = "Atoms.Framework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> Index: COracleConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSOracle/COracleConnection.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- COracleConnection.vb 1 Apr 2005 00:04:34 -0000 1.2 +++ COracleConnection.vb 11 Apr 2005 00:31:45 -0000 1.3 @@ -1,5 +1,5 @@ Imports System.Data.OracleClient -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for Oracle data sources ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to Oracle datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- Public Class COracleConnection - Implements _CConnection + Implements IConnection Implements IDisposable Private m_connection As OracleConnection @@ -36,7 +36,7 @@ Private m_transaction As OracleTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -61,7 +61,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -69,7 +69,7 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -80,7 +80,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -88,7 +88,7 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -99,7 +99,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -107,7 +107,7 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -118,14 +118,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -160,13 +160,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -186,7 +186,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <remarks></remarks> @@ -194,10 +194,10 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New OracleCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As OracleParameter Dim dd As Date @@ -228,7 +228,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <returns></returns> @@ -237,10 +237,10 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(COracleConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As OracleParameter Dim dd As Date Dim m_command As New OracleCommand @@ -251,7 +251,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New OracleParameter param.ParameterName = cp.Name @@ -280,15 +280,15 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback - Dim pb As CPersistenceBroker + Public Sub rollback() Implements IConnection.rollback + Dim pb As PersistenceBroker If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -322,14 +322,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -338,7 +338,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -346,7 +346,7 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -354,7 +354,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -362,7 +362,7 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -373,7 +373,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTableSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTableSchema">IConnection</see>. ''' </summary> ''' <param name="tName"></param> ''' <returns></returns> @@ -382,7 +382,7 @@ ''' [rbanks] 23/12/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As OracleCommand Dim dr As OracleDataReader @@ -400,7 +400,7 @@ Return dt End Function - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -418,11 +418,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:35
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MySQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_MySQL Modified Files: AF_MySQL.vbproj AssemblyInfo.vb CMySQLConnection.vb CMySqlDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MySQL/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:46 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> Index: CMySqlDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MySQL/CMySqlDatabase.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CMySqlDatabase.vb 1 Apr 2005 00:04:35 -0000 1.4 +++ CMySqlDatabase.vb 11 Apr 2005 00:31:46 -0000 1.5 @@ -3,7 +3,7 @@ 'Imports System.Data.OleDb Imports MySql.Data.MySqlClient -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -11,7 +11,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for MySQL Servers. +''' Implementation of RelationalDatabase for MySQL Servers. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with MySQL databases. ADO.NET functionality is provided @@ -22,7 +22,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class CMySqlDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase '************************************************** @@ -42,7 +42,7 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A CMySqlConnection containing the newly established connection.</returns> - ''' <remarks>The CMySqlConnection class implements the _CConnection interface which + ''' <remarks>The CMySqlConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para> ''' </remarks> @@ -50,7 +50,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New CMySqlConnection conn.Connection = New MySqlConnection 'MySql can manage transactions in if the mysql-max version is used. @@ -66,9 +66,9 @@ If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If If m_user Is Nothing OrElse m_user.Length = 0 Then conn.Connection.ConnectionString = "Server=" & m_serverName & ";" & "Database=" & m_name & ";" @@ -217,9 +217,9 @@ Dim row As System.Data.DataRow Dim p As MySqlParameter Dim initvals() As Object = {1} - Dim x As OIDException + Dim x As ObjectIdException Dim conn As CMySqlConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -239,10 +239,10 @@ conn.commit() Catch err As MySqlException conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -266,7 +266,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New MySqlDataAdapter Dim cb As MySqlCommandBuilder @@ -309,7 +309,7 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String 'Return "?" 'Return "@p" & CStr(i) - this is the old version - only use if still referencing bytefx Return "?p" & CStr(i) 'New syntax as of v1.04 of MySQLConnect/NET @@ -319,7 +319,8 @@ Return Me.m_name & "." & table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As CMySqlConnection Index: CMySQLConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MySQL/CMySQLConnection.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CMySQLConnection.vb 1 Apr 2005 00:04:35 -0000 1.3 +++ CMySQLConnection.vb 11 Apr 2005 00:31:46 -0000 1.4 @@ -1,5 +1,5 @@ Imports MySql.Data.MySqlClient -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for MySQL data sources (MySQL 4.0 or higher) ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to MySQL datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class CMySqlConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As MySqlTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -66,7 +66,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -74,7 +74,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -85,7 +85,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -93,7 +93,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -104,7 +104,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -112,7 +112,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -123,14 +123,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -167,7 +167,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <remarks>The mySQL database must support transactions for this to function properly. ''' If the database does not support transactions results may be unpredictable.</remarks> @@ -175,7 +175,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -195,7 +195,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <remarks>The mySQL database must support transactions for this to function properly. ''' If the database does not support transactions results may be unpredictable.</remarks> @@ -203,7 +203,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction(ByVal isolationLevel As IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -224,7 +224,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <remarks></remarks> @@ -233,10 +233,10 @@ ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New MySqlCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As MySqlParameter Try @@ -267,7 +267,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <param name="statement"></param> ''' <returns></returns> @@ -276,12 +276,12 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(CMySqlConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim m_command As New MySqlCommand - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As MySqlParameter If DEBUG_MODE Then @@ -319,14 +319,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback + Public Sub rollback() Implements IConnection.rollback If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -357,14 +357,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -373,7 +373,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -381,7 +381,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -389,7 +389,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <value></value> ''' <remarks></remarks> @@ -397,7 +397,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -408,7 +408,7 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTableSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTableSchema">IConnection</see>. ''' </summary> ''' <param name="tName"></param> ''' <returns></returns> @@ -417,7 +417,7 @@ ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As MySqlCommand Dim dr As MySqlDataReader @@ -435,11 +435,11 @@ Return dt End Function - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property Index: AF_MySQL.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MySQL/AF_MySQL.vbproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AF_MySQL.vbproj 7 Feb 2005 13:22:06 -0000 1.2 +++ AF_MySQL.vbproj 11 Apr 2005 00:31:46 -0000 1.3 @@ -1,112 +1,112 @@ -<VisualStudioProject> - <VisualBasic - ProjectType = "Local" - ProductVersion = "7.10.3077" - SchemaVersion = "2.0" - ProjectGuid = "{0421A413-1FDE-452E-AB47-82E2CD959461}" - > - <Build> - <Settings - ApplicationIcon = "" - AssemblyKeyContainerName = "" - AssemblyName = "AF_MySQL" - AssemblyOriginatorKeyFile = "" - AssemblyOriginatorKeyMode = "None" - DefaultClientScript = "JScript" - DefaultHTMLPageLayout = "Grid" - DefaultTargetSchema = "IE50" - DelaySign = "false" - OutputType = "Library" - OptionCompare = "Binary" - OptionExplicit = "On" - OptionStrict = "Off" - RootNamespace = "AF_MySQL" - StartupObject = "" - > - <Config - Name = "Debug" - BaseAddress = "285212672" - ConfigurationOverrideFile = "" - DefineConstants = "" - DefineDebug = "true" - DefineTrace = "true" - DebugSymbols = "true" - IncrementalBuild = "true" - Optimize = "false" - OutputPath = "bin\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "1" - /> - <Config - Name = "Release" - BaseAddress = "285212672" - ConfigurationOverrideFile = "" - DefineConstants = "" - DefineDebug = "false" - DefineTrace = "true" - DebugSymbols = "false" - IncrementalBuild = "false" - Optimize = "true" - OutputPath = "bin\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "1" - /> - </Settings> - <References> - <Reference - Name = "System" - AssemblyName = "System" - /> - <Reference - Name = "System.Data" - AssemblyName = "System.Data" - /> - <Reference - Name = "System.XML" - AssemblyName = "System.Xml" - /> - <Reference - Name = "AToMSFramework" - Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" - Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" - /> - <Reference - Name = "MySql.Data" - AssemblyName = "MySql.Data" - HintPath = "..\..\..\..\..\Program Files\MySQL\MySQL Connector Net 1.0.4\bin\.NET 1.1\MySql.Data.dll" - /> - </References> - <Imports> - <Import Namespace = "Microsoft.VisualBasic" /> - <Import Namespace = "System" /> - <Import Namespace = "System.Collections" /> - <Import Namespace = "System.Data" /> - <Import Namespace = "System.Diagnostics" /> - </Imports> - </Build> - <Files> - <Include> - <File - RelPath = "AssemblyInfo.vb" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "CMySQLConnection.vb" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "CMySqlDatabase.vb" - SubType = "Code" - BuildAction = "Compile" - /> - </Include> - </Files> - </VisualBasic> -</VisualStudioProject> - +<VisualStudioProject> + <VisualBasic + ProjectType = "Local" + ProductVersion = "7.10.3077" + SchemaVersion = "2.0" + ProjectGuid = "{0421A413-1FDE-452E-AB47-82E2CD959461}" + > + <Build> + <Settings + ApplicationIcon = "" + AssemblyKeyContainerName = "" + AssemblyName = "AF_MySQL" + AssemblyOriginatorKeyFile = "" + AssemblyOriginatorKeyMode = "None" + DefaultClientScript = "JScript" + DefaultHTMLPageLayout = "Grid" + DefaultTargetSchema = "IE50" + DelaySign = "false" + OutputType = "Library" + OptionCompare = "Binary" + OptionExplicit = "On" + OptionStrict = "Off" + RootNamespace = "AtomsFramework.Providers.MySQL" + StartupObject = "AtomsFramework.Providers.MySQL.(None)" + > + <Config + Name = "Debug" + BaseAddress = "285212672" + ConfigurationOverrideFile = "" + DefineConstants = "" + DefineDebug = "true" + DefineTrace = "true" + DebugSymbols = "true" + IncrementalBuild = "true" + Optimize = "false" + OutputPath = "bin\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "1" + /> + <Config + Name = "Release" + BaseAddress = "285212672" + ConfigurationOverrideFile = "" + DefineConstants = "" + DefineDebug = "false" + DefineTrace = "true" + DebugSymbols = "false" + IncrementalBuild = "false" + Optimize = "true" + OutputPath = "bin\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "1" + /> + </Settings> + <References> + <Reference + Name = "System" + AssemblyName = "System" + /> + <Reference + Name = "System.Data" + AssemblyName = "System.Data" + /> + <Reference + Name = "System.XML" + AssemblyName = "System.Xml" + /> + <Reference + Name = "MySql.Data" + AssemblyName = "MySql.Data" + HintPath = "..\..\..\..\..\Program Files\MySQL\MySQL Connector Net 1.0.4\bin\.NET 1.1\MySql.Data.dll" + /> + <Reference + Name = "Atoms.Framework" + Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" + Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" + /> + </References> + <Imports> + <Import Namespace = "Microsoft.VisualBasic" /> + <Import Namespace = "System" /> + <Import Namespace = "System.Collections" /> + <Import Namespace = "System.Data" /> + <Import Namespace = "System.Diagnostics" /> + </Imports> + </Build> + <Files> + <Include> + <File + RelPath = "AssemblyInfo.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "CMySQLConnection.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "CMySqlDatabase.vb" + SubType = "Code" + BuildAction = "Compile" + /> + </Include> + </Files> + </VisualBasic> +</VisualStudioProject> + |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:35
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_ODBC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_ODBC Modified Files: AF_ODBC.vbproj AssemblyInfo.vb CODBCConnection.vb CODBCDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_ODBC/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:46 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> Index: CODBCDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_ODBC/CODBCDatabase.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CODBCDatabase.vb 7 Feb 2005 07:37:53 -0000 1.1 +++ CODBCDatabase.vb 11 Apr 2005 00:31:46 -0000 1.2 @@ -3,7 +3,7 @@ Imports System.Data.Odbc Imports System.Collections.Specialized -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -11,7 +11,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for ODBC sources +''' Implementation of RelationalDatabase for ODBC sources ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with ODBC compliant @@ -21,7 +21,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class CODBCDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase '************************************************** 'Class: CODBCDatabase @@ -135,14 +135,14 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A CODBCConnection containing the newly established connection.</returns> - ''' <remarks>The CODBCConnection class implements the _CConnection interface which + ''' <remarks>The CODBCConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para></remarks> ''' <history> ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New CODBCConnection Try conn.Connection = New OdbcConnection @@ -172,11 +172,11 @@ Dim aValue As Integer Dim row As System.Data.DataRow Dim p As OdbcParameter - Dim x As OIDException + Dim x As ObjectIdException Dim initvals() As Object = {1} Dim conn As CODBCConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -204,7 +204,7 @@ conn.commit() Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -228,7 +228,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New OdbcDataAdapter Dim cb As OdbcCommandBuilder @@ -271,13 +271,13 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return "?" End Function '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CRelationalDatabase.getClauseStringTableAlias">_CRelationalDatabase</see>. + ''' See <see cref="P:AToMSFramework.IRelationalDatabase.getClauseStringTableAlias">IRelationalDatabase</see>. ''' </summary> ''' <param name="table"></param> ''' <param name="pAlias"></param> @@ -291,7 +291,8 @@ Return table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then Dim conn As CODBCConnection @@ -312,7 +313,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for MaxDB Servers. +''' Implementation of RelationalDatabase for MaxDB Servers. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with MaxDB databases. The only .NET provider is an ODBC connection Index: CODBCConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_ODBC/CODBCConnection.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CODBCConnection.vb 1 Apr 2005 00:04:36 -0000 1.2 +++ CODBCConnection.vb 11 Apr 2005 00:31:46 -0000 1.3 @@ -1,4 +1,4 @@ -Imports AToMSFramework +Imports AtomsFramework Imports System.Data.Odbc '''----------------------------------------------------------------------------- @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for ODBC data sources ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to ODBC datasources.</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 28/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class CODBCConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As OdbcTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -64,13 +64,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 28/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -81,13 +81,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -98,13 +98,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -115,13 +115,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -158,13 +158,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -184,17 +184,17 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New OdbcCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As OdbcParameter Try @@ -227,16 +227,16 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(CODBCConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim m_command As New OdbcCommand Dim param As OdbcParameter @@ -246,7 +246,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New OdbcParameter param.ParameterName = cp.Name @@ -275,14 +275,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback + Public Sub rollback() Implements IConnection.rollback If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -316,13 +316,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -331,13 +331,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -345,13 +345,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -362,13 +362,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTablesSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTablesSchema">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As OdbcCommand Dim dr As OdbcDataReader @@ -388,13 +388,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -412,11 +412,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property Index: AF_ODBC.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_ODBC/AF_ODBC.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_ODBC.vbproj 7 Feb 2005 07:37:53 -0000 1.1 +++ AF_ODBC.vbproj 11 Apr 2005 00:31:46 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_ODBC" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.ODBC" + StartupObject = "AtomsFramework.Providers.ODBC.(None)" > <Config Name = "Debug" @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "AToMSFramework" + Name = "Atoms.Framework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> |
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815 Modified Files: AFCustomAttributes.vb AFExceptions.vb AToMSFramework.sln AToMSFramework.vbproj AssemblyInfo.vb AtomsFramework.ndoc AtomsFramework.snk AtomsFramework.xml CAssociationKey.vb CAssociationObject.vb CAssociationState.vb CAssociationTable.vb CAttributeMap.vb CBetweenCriteria.vb CCacheEntry.vb CClassMap.vb CColumnMap.vb CConnection.vb CCriteriaCondition.vb CCursor.vb CDatabaseMap.vb CDeleteCriteria.vb CEqualToCriteria.vb CGreaterThanCriteria.vb CGreaterThanOrEqualToCriteria.vb CInCriteria.vb CInjectedObject.vb CInjectedObjects.vb CJoin.vb CLessThanCriteria.vb CLessThanOrEqualToCriteria.vb CLikeCriteria.vb CMultiRetrieveCriteria.vb CMultiSummaryCriteria.vb CNotBetweenCriteria.vb CNotEqualToCriteria.vb CNotInCrieteria.vb COID.vb COIDFactory.vb COrderEntry.vb CPersistenceBroker.vb CPersistentCollection.vb CPersistentCriteria.vb CPersistentObject.vb CQueuedDelete.vb CRelationalDatabase.vb CResultset.vb CRetrieveCriteria.vb CSelectInCriteria.vb CSelectInListCriteria.vb CSelectionCriteria.vb CSqlStatement.vb CSummaryCriteria.vb CTableMap.vb CTransaction.vb CUDAMap.vb CUDAMapEntry.vb CXMLConfigLoader.vb IConfigLoader.vb IPersistentObject.vb IniFiles.vb XMLMapping.xsd XMLMapping.xsx modAliasNull.vb modPersistenceBrokerSingleton.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: modAliasNull.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modAliasNull.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- modAliasNull.vb 7 Feb 2005 07:37:35 -0000 1.7 +++ modAliasNull.vb 11 Apr 2005 00:31:44 -0000 1.8 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : AToMSFramework +''' Project : Atoms.Framework ''' Module : modAliasNull ''' '''----------------------------------------------------------------------------- @@ -15,7 +15,7 @@ ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- -Public Module modAliasNull +Public Module ModAliasNull '----------------------------------------------------------- 'VBPJ Junio 2000 @@ -30,18 +30,18 @@ '----------------------------------------------------------- - Public Const NULL_INTEGER As Short = -32767 '-32768 - Public Const NULL_LONG As Double = -2147483647.0# '-2147483648# - Public Const NULL_SINGLE As Double = -3.402823E+38 - Public Const NULL_DOUBLE As Double = -1.7976931348623E+308 - Public Const NULL_CURRENCY As Double = -922337203685477.0# - Public Const NULL_STRING As String = "" - Public Const NULL_DATE As Date = #1/1/0100# - Public Const NULL_BYTE As Short = 0 + Public Const NullInteger As Short = -32767 '-32768 + Public Const NullLong As Double = -2147483647.0# '-2147483648# + Public Const NullSingle As Double = -3.402823E+38 + Public Const NullDouble As Double = -1.7976931348623E+308 + Public Const NullCurrency As Double = -922337203685477.0# + Public Const NullString As String = "" + Public Const NullDate As Date = #1/1/0100# + Public Const NullByte As Short = 0 'Constantes para devolver DATE y NOW - Public Const DEFAULT_DATE As Date = #1/1/0101# - Public Const DEFAULT_NOW As Date = #1/1/0101 1:01:01 AM# + Public Const DefaultDate As Date = #1/1/0101# + Public Const DefaultNow As Date = #1/1/0101 1:01:01 AM# '''----------------------------------------------------------------------------- ''' <summary> @@ -56,34 +56,34 @@ ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function IsNullAlias(ByVal InValue As Object) As Boolean + Public Function IsNullAlias(ByVal inValue As Object) As Boolean Dim blnValue As Boolean blnValue = False - Select Case VarType(InValue) + Select Case VarType(inValue) Case VariantType.Short - If InValue = NULL_INTEGER Then blnValue = True + If inValue = NullInteger Then blnValue = True Case VariantType.Integer - If InValue = NULL_LONG Then blnValue = True + If inValue = NullLong Then blnValue = True Case VariantType.Single - If InValue = NULL_SINGLE Then blnValue = True + If inValue = NullSingle Then blnValue = True Case VariantType.Double - If InValue = NULL_DOUBLE Then blnValue = True + If inValue = NullDouble Then blnValue = True Case VariantType.Decimal - If InValue = NULL_CURRENCY Then blnValue = True + If inValue = NullCurrency Then blnValue = True Case VariantType.String - If InValue Is Nothing Then + If inValue Is Nothing Then blnValue = True End If Case VariantType.Byte - If InValue = NULL_BYTE Then blnValue = True + If inValue = NullByte Then blnValue = True Case VariantType.DataObject.Null blnValue = True Case Else - If InValue Is Nothing Then + If inValue Is Nothing Then blnValue = True Else - If IsDBNull(InValue) Then + If IsDBNull(inValue) Then blnValue = True End If End If @@ -91,6 +91,9 @@ Return blnValue End Function + Public Sub NullToAlias(ByVal inValue As Object, ByRef outValue As Object) + Call NullToAlias(inValue, outValue, Nothing) + End Sub ' Replaces a Null value with an application defined null value. ' For example, instead of a Date being Null, an alias null @@ -113,50 +116,50 @@ ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub NullToAlias(ByVal InValue As Object, ByRef OutValue As Object, Optional ByRef Override As Object = Nothing) + Public Sub NullToAlias(ByVal inValue As Object, ByRef outValue As Object, ByRef override As Object) Dim vntOutValue As Object ' If the InValue is not Null, then just return that value - If Override Is Nothing Then - Override = System.DBNull.Value + If override Is Nothing Then + override = System.DBNull.Value End If - If Not IsDBNull(InValue) Then - vntOutValue = InValue + If Not IsDBNull(inValue) Then + vntOutValue = inValue ' Otherwise, check if we are to override the Null out value ' If not, then return a null alias specific for the variable type - ElseIf IsDBNull(Override) Then - Select Case VarType(OutValue) + ElseIf IsDBNull(override) Then + Select Case VarType(outValue) Case VariantType.Short - vntOutValue = CShort(NULL_INTEGER) + vntOutValue = CShort(NullInteger) Case VariantType.Integer - vntOutValue = CInt(NULL_LONG) + vntOutValue = CInt(NullLong) Case VariantType.Single - vntOutValue = CSng(NULL_SINGLE) + vntOutValue = CSng(NullSingle) Case VariantType.Double - vntOutValue = CDbl(NULL_DOUBLE) + vntOutValue = CDbl(NullDouble) Case VariantType.Decimal - vntOutValue = CDec(NULL_CURRENCY) + vntOutValue = CDec(NullCurrency) Case VariantType.String - vntOutValue = CStr(NULL_STRING) + vntOutValue = CStr(NullString) Case VariantType.Date - vntOutValue = CDate(NULL_DATE) + vntOutValue = CDate(NullDate) Case VariantType.Byte - vntOutValue = CByte(NULL_BYTE) + vntOutValue = CByte(NullByte) Case VariantType.Boolean vntOutValue = CBool(False) Case Else End Select ' Otherwise, return the Null override value Else - vntOutValue = Override + vntOutValue = override End If - OutValue = vntOutValue + outValue = vntOutValue End Sub - - - + Public Function AliasToNull(ByVal inValue As Object) As Object + Return AliasToNull(inValue, Nothing) + End Function ' Replaces an application defined null value with a ' true VB Null value. For example, a Date with a value @@ -176,34 +179,34 @@ ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function AliasToNull(ByVal InValue As Object, Optional ByRef NullValue As Object = Nothing) As Object + Public Function AliasToNull(ByVal inValue As Object, ByRef nullValue As Object) As Object Dim vntOutValue As Object - If NullValue Is Nothing Then - NullValue = System.DBNull.Value + If nullValue Is Nothing Then + nullValue = System.DBNull.Value End If - vntOutValue = InValue - Select Case VarType(InValue) + vntOutValue = inValue + Select Case VarType(inValue) Case VariantType.Short - If InValue = NULL_INTEGER Then vntOutValue = NullValue + If inValue = NullInteger Then vntOutValue = nullValue Case VariantType.Integer - If InValue = NULL_LONG Then vntOutValue = NullValue + If inValue = NullLong Then vntOutValue = nullValue Case VariantType.Single - If InValue = NULL_SINGLE Then vntOutValue = NullValue + If inValue = NullSingle Then vntOutValue = nullValue Case VariantType.Double - If InValue = NULL_DOUBLE Then vntOutValue = NullValue + If inValue = NullDouble Then vntOutValue = nullValue Case VariantType.Decimal - If InValue = NULL_CURRENCY Then vntOutValue = NullValue + If inValue = NullCurrency Then vntOutValue = nullValue Case VariantType.String - If Trim(InValue) = NULL_STRING Then - vntOutValue = NullValue + If Trim(inValue) = NullString Then + vntOutValue = nullValue Else - vntOutValue = Trim(InValue) + vntOutValue = Trim(inValue) End If Case VariantType.Date - If InValue = NULL_DATE Then vntOutValue = NullValue + If inValue = NullDate Then vntOutValue = nullValue Case VariantType.Byte - If InValue = NULL_BYTE Then vntOutValue = 0 + If inValue = NullByte Then vntOutValue = 0 Case Else ' Debug.Assert False End Select @@ -220,18 +223,18 @@ ''' <remarks>The calculation is based on a period (".") and will need ''' reworking in locales where the decimal is the thousands separator and ''' a comma is used for the decimal. - ''' <para>The function is unused by the AtomsFramework.</para></remarks> + ''' <para>The function is unused by the Atoms.Framework.</para></remarks> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function NumberOfDecimals(ByRef InNumber As Object) As Short + Public Function NumberOfDecimals(ByRef inNumber As Object) As Short ' finds the length of the string after the first decimal Dim iPos As Short Dim strTemp As String - If IsNumeric(InNumber) Then - strTemp = CStr(InNumber) + If IsNumeric(inNumber) Then + strTemp = CStr(inNumber) iPos = InStr(1, Trim(strTemp), ".") If iPos > 0 Then NumberOfDecimals = strTemp.Length - iPos @@ -252,19 +255,19 @@ ''' <remarks>The calculation is based on a period (".") and will need ''' reworking in locales where the decimal is the thousands separator and ''' a comma is used for the decimal. - ''' <para>The function is unused by the AtomsFramework.</para></remarks> + ''' <para>The function is unused by the Atoms.Framework.</para></remarks> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function NumberOfDigits(ByRef InNumber As Object) As Short + Public Function NumberOfDigits(ByRef inNumber As Object) As Short ' finds the length of the string after the first decimal Dim iPos As Short Dim strTemp As String Dim iNum As Short - If IsNumeric(InNumber) Then - strTemp = CStr(InNumber) + If IsNumeric(inNumber) Then + strTemp = CStr(inNumber) ' Only count digits to left of decimal point iPos = InStr(1, LTrim(strTemp), ".") If iPos > 0 Then Index: AToMSFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/AToMSFramework.vbproj,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- AToMSFramework.vbproj 21 Mar 2005 08:05:08 -0000 1.25 +++ AToMSFramework.vbproj 11 Apr 2005 00:31:41 -0000 1.26 @@ -9,7 +9,7 @@ <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" - AssemblyName = "AToMSFramework" + AssemblyName = "AtomsFramework" AssemblyOriginatorKeyFile = "" AssemblyOriginatorKeyMode = "None" DefaultClientScript = "JScript" @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AToMSFramework" - StartupObject = "AToMSFramework.(None)" + RootNamespace = "AtomsFramework" + StartupObject = "AtomsFramework.(None)" > <Config Name = "Debug" @@ -69,22 +69,13 @@ Name = "System.XML" AssemblyName = "System.Xml" /> - <Reference - Name = "Microsoft.VisualBasic.Compatibility" - AssemblyName = "Microsoft.VisualBasic.Compatibility" - /> - <Reference - Name = "Microsoft.VisualBasic.Compatibility.Data" - AssemblyName = "Microsoft.VisualBasic.Compatibility.Data" - /> </References> <Imports> - <Import Namespace = "Microsoft.VisualBasic" /> - <Import Namespace = "Microsoft.VisualBasic.Compatibility" /> <Import Namespace = "System" /> <Import Namespace = "System.Collections" /> <Import Namespace = "System.Data" /> <Import Namespace = "System.Diagnostics" /> + <Import Namespace = "Microsoft.VisualBasic" /> </Imports> </Build> <Files> @@ -339,11 +330,6 @@ BuildAction = "Compile" /> <File - RelPath = "CTransaction.vb" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "CUDAMap.vb" SubType = "Code" BuildAction = "Compile" @@ -369,11 +355,6 @@ BuildAction = "Compile" /> <File - RelPath = "IniFiles.vb" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "IPersistentObject.vb" SubType = "Code" BuildAction = "Compile" Index: IPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IPersistentObject.vb,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- IPersistentObject.vb 4 Apr 2005 01:27:29 -0000 1.14 +++ IPersistentObject.vb 11 Apr 2005 00:31:44 -0000 1.15 @@ -3,24 +3,24 @@ Property IsProxy() As Boolean Property IsDirty() As Boolean Property ExpiryInterval() As Double - Property OIDValue() As String - Property GUIDValue() As String + Property OidValue() As String + Property GuidValue() As String Property AssociationsLoaded() As Boolean Property IsLoading() As Boolean Property IsQueued() As Boolean ReadOnly Property IsReadOnly() As Boolean ReadOnly Property IsModifyOnly() As Boolean - Property OriginalCacheKey() As CCacheKey + Property OriginalCacheKey() As CacheKey Property State() As PersistenceState - Function GetClassMap() As CClassMap - Function GetFieldLengthByName(ByVal x As String) As Integer - Function GetFieldTypeByName(ByVal x As String) As Type + Function GetClassMap() As ClassMap + Function GetFieldLengthByName(ByVal propertyName As String) As Integer + Function GetFieldTypeByName(ByVal propertyName As String) As Type - Function GetCollectionByAttribute(ByVal pName As String) As IList - Function GetObjectByAttribute(ByVal pName As String) As IPersistableObject - Function GetValueByAttribute(ByVal pName As String) As Object - Sub SetAttributeValue(ByVal pName As String, ByRef Value As Object) + Function GetCollectionByAttribute(ByVal name As String) As IList + Function GetObjectByAttribute(ByVal name As String) As IPersistableObject + Function GetValueByAttribute(ByVal name As String) As Object + Sub SetAttributeValue(ByVal name As String, ByRef value As Object) Function GetRemovedCollectionItems(ByVal propertyName As String) As Collection Sub CopyOneToManyCollections() @@ -29,7 +29,7 @@ Function Equals(ByVal obj As IPersistableObject) As Boolean Function Copy() As IPersistableObject Sub ReplaceWith(ByVal obj As IPersistableObject, ByVal copyEventHandlers As Boolean) - Function GetObjectByClassMap(ByVal classMap As CClassMap) As IPersistableObject + Function GetObjectByClassMap(ByVal classMap As ClassMap) As IPersistableObject Function GetSourceObject() As Object Function HasValidKey() As Boolean Function IsIPersistentObject() As Boolean @@ -45,26 +45,26 @@ Sub ResetOriginalDates() Function Retrieve() As Boolean - Function Retrieve(ByRef obj As CPersistentObject) As Boolean - Function Retrieve(ByRef obj As CPersistentObject, ByVal usecache As Boolean) As Boolean + Function Retrieve(ByRef obj As PersistentObject) As Boolean + Function Retrieve(ByRef obj As PersistentObject, ByVal useCache As Boolean) As Boolean Function Find() As Boolean - Function Find(ByRef obj As CPersistentObject) As Boolean - Function Find(ByRef obj As CPersistentObject, ByVal usecache As Boolean) As Boolean + Function Find(ByRef obj As PersistentObject) As Boolean + Function Find(ByRef obj As PersistentObject, ByVal useCache As Boolean) As Boolean Sub Save() Sub Save(ByVal checkAssociationsRecursively As Boolean) - Sub Save(ByVal obj As CPersistentObject, ByVal checkAssociationsRecursivly As Boolean) + Sub Save(ByVal obj As PersistentObject, ByVal checkAssociationsRecursively As Boolean) Sub Delete() Sub Delete(ByVal deleteSuperClass As Boolean) - Sub Delete(ByVal obj As CPersistentObject) - Sub Delete(ByVal obj As CPersistentObject, ByVal deleteSuperClass As Boolean) + Sub Delete(ByVal obj As PersistentObject) + Sub Delete(ByVal obj As PersistentObject, ByVal deleteSuperClass As Boolean) Sub DeleteAll() Function IsReferenced() As Boolean - Function getNewObject() As CPersistentObject + Function GetNewObject() As PersistentObject Event MarkedAsDirty As EventHandler Event LoadStarted As EventHandler Index: COIDFactory.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/COIDFactory.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- COIDFactory.vb 25 Oct 2004 07:12:31 -0000 1.4 +++ COIDFactory.vb 11 Apr 2005 00:31:43 -0000 1.5 @@ -1,21 +1,21 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : AToMSFramework -''' Class : COIDFactory +''' Project : Atoms.Framework +''' Class : OIDFactory ''' '''----------------------------------------------------------------------------- ''' <summary> ''' Class used to generate object ID's ''' </summary> -''' <remarks>This class is used to generate new <see cref="T:AToMSFramework.COID">object ids</see> +''' <remarks>This class is used to generate new <see cref="T:Atoms.Framework.OID">object ids</see> ''' and manages the pool of B-values for a single session id (the A value). When the ''' pool is exhausted a new session id is retrieved and the pool is reset.</remarks> ''' <history> ''' [rbanks] 12/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- -Public Class COIDFactory +Public Class ObjectIdFactory Private m_nextAValue As Integer Private m_nextBValue As Short @@ -25,50 +25,50 @@ ''' <summary> ''' Creates and returns a new object id ''' </summary> - ''' <returns>A new populated COID object</returns> + ''' <returns>A new populated OID object</returns> ''' <remarks>Each time this function is called, the B counter is incremented.</remarks> ''' <history> ''' [rbanks] 12/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function newOID() As COID - Dim oid As New COID - oid.AValue = fetchAValue() + Public Function NewOid() As ObjectId + Dim oidvalue As New ObjectId + oidvalue.AValue = FetchAValue() Try m_nextBValue += 1S Catch m_fetchedAValue = False - oid.AValue = fetchAValue() ' get a new A value - m_nextBValue = 1 'reset the b values + oidvalue.AValue = FetchAValue() ' get a new A value + m_nextBValue = 1 'reset the b values End Try - oid.BValue = m_nextBValue - Return oid + oidvalue.BValue = m_nextBValue + Return oidvalue End Function '''----------------------------------------------------------------------------- ''' <summary> ''' Retrieves the A-Value ''' </summary> - ''' <returns>The current A value to use in creating new COID objects</returns> + ''' <returns>The current A value to use in creating new OID objects</returns> ''' <remarks>If no value is set the database OID table will be queried for the ''' next free A value and this will be returned, otherwise the current A value will be returned.</remarks> ''' <history> ''' [rbanks] 12/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Private Function fetchAValue() As Integer - Static persistenceBroker As CPersistenceBroker - Dim tmp As Integer + Private Function FetchAValue() As Integer + Static persistenceBroker As persistenceBroker + 'Dim tmp As Integer Dim de As DictionaryEntry - Dim reldb As _CRelationalDatabase + Dim reldb As IRelationalDatabase If m_fetchedAValue = False Then - persistenceBroker = getPersistenceBrokerInstance() + persistenceBroker = GetPersistenceBrokerInstance() For Each de In persistenceBroker.Databases - reldb = CType(de.Value, _CRelationalDatabase) + reldb = CType(de.Value, IRelationalDatabase) 'Just use the first database with an OID setting to get the AValue - If reldb.OIDTable.Length > 0 Then - m_nextAValue = reldb.getNextOIDAValue + If reldb.OidTable.Length > 0 Then + m_nextAValue = reldb.GetNextOidAValue Exit For End If Next @@ -77,19 +77,4 @@ Return m_nextAValue End Function - '''----------------------------------------------------------------------------- - ''' <summary> - ''' Creates a new instance of the COIDFactory - ''' </summary> - ''' <remarks>The A and B counters are set to 0. No A-value will be - ''' available until the first COID object is generated.</remarks> - ''' <history> - ''' [rbanks] 12/12/2003 Created - ''' </history> - '''----------------------------------------------------------------------------- - Public Sub New() - m_fetchedAValue = False - m_nextAValue = 0 - m_nextBValue = 0 - End Sub End Class Index: CSelectionCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CSelectionCriteria.vb,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CSelectionCriteria.vb 21 Jul 2004 02:55:38 -0000 1.8 +++ CSelectionCriteria.vb 11 Apr 2005 00:31:44 -0000 1.9 @@ -6,19 +6,19 @@ ''' Interface that all selection criteria objects must implement. ''' </summary> '''----------------------------------------------------------------------------- -Public Interface _CSelectionCriteria - Property AttrMap() As CAttributeMap +Public Interface ISelectionCriteria + Property AttrMap() As AttributeMap Property ValueA() As Object Property ValueB() As Object Property TableAlias() As String - Property ClassMap() As CClassMap + Property ClassMap() As ClassMap Property AddUsingOr() As Boolean - Sub fillSqlStatement(ByVal pStatement As CSqlStatement) + Sub FillSqlStatement(ByVal statement As AtomsSqlStatement) End Interface '''----------------------------------------------------------------------------- -''' Project : AToMSFramework -''' Class : CSelectionCriteria +''' Project : Atoms.Framework +''' Class : SelectionCriteria ''' '''----------------------------------------------------------------------------- ''' <summary> @@ -33,18 +33,18 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- -Public MustInherit Class CSelectionCriteria - Implements _CSelectionCriteria +Public MustInherit Class SelectionCriteria + Implements ISelectionCriteria '************************************************** - 'Class: CSelectionCriteria + 'Class: SelectionCriteria 'Author: Juan Carlos Alvarez '************************************************** - Private m_attrMap As CAttributeMap + Private m_attrMap As AttributeMap Private m_valueA As Object Private m_valueB As Object - Private m_classmap As CClassMap + Private m_classmap As ClassMap Private m_tableAlias As String Private m_addUsingOr As Boolean @@ -58,11 +58,11 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AttrMap() As CAttributeMap Implements _CSelectionCriteria.AttrMap + Public Property AttrMap() As AttributeMap Implements ISelectionCriteria.AttrMap Get AttrMap = m_attrMap End Get - Set(ByVal Value As CAttributeMap) + Set(ByVal Value As AttributeMap) m_attrMap = Value End Set End Property @@ -71,14 +71,14 @@ ''' <summary> ''' Method stub for generating the specific SQL and adding it to an SQL statement. ''' </summary> - ''' <param name="pStatement">The SQL statement to be modified</param> + ''' <param name="statement">The SQL statement to be modified</param> ''' <remarks>This must be implemented by each subclass to generate the SQL code ''' specific to the subclasses requirements.</remarks> ''' <history> ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public MustOverride Sub fillSqlStatement(ByVal pStatement As CSqlStatement) Implements _CSelectionCriteria.fillSqlStatement + Public MustOverride Sub FillSqlStatement(ByVal statement As AtomsSqlStatement) Implements ISelectionCriteria.fillSqlStatement '''----------------------------------------------------------------------------- ''' <summary> @@ -90,7 +90,7 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ValueA() As Object Implements _CSelectionCriteria.ValueA + Public Property ValueA() As Object Implements ISelectionCriteria.ValueA Get Return m_valueA End Get @@ -110,7 +110,7 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ValueB() As Object Implements _CSelectionCriteria.ValueB + Public Property ValueB() As Object Implements ISelectionCriteria.ValueB Get Return m_valueB End Get @@ -129,7 +129,7 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property TableAlias() As String Implements _CSelectionCriteria.TableAlias + Public Property TableAlias() As String Implements ISelectionCriteria.TableAlias Get Return m_tableAlias End Get @@ -148,7 +148,7 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AddUsingOr() As Boolean Implements _CSelectionCriteria.AddUsingOr + Public Property AddUsingOr() As Boolean Implements ISelectionCriteria.AddUsingOr Get Return m_addUsingOr End Get @@ -167,16 +167,16 @@ ''' [rbanks] 17/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ClassMap() As CClassMap Implements _CSelectionCriteria.ClassMap + Public Property ClassMap() As ClassMap Implements ISelectionCriteria.ClassMap Get Return m_classmap End Get - Set(ByVal Value As CClassMap) + Set(ByVal Value As ClassMap) m_classmap = Value End Set End Property - Public Sub New() + Protected Sub New() m_tableAlias = "" End Sub End Class \ No newline at end of file Index: IniFiles.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IniFiles.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- IniFiles.vb 21 Jul 2004 02:55:38 -0000 1.5 +++ IniFiles.vb 11 Apr 2005 00:31:44 -0000 1.6 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : AToMSFramework +''' Project : Atoms.Framework ''' Class : IniFiles ''' '''----------------------------------------------------------------------------- Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CInjectedObject.vb 7 Apr 2005 07:08:16 -0000 1.25 +++ CInjectedObject.vb 11 Apr 2005 00:31:43 -0000 1.26 @@ -5,19 +5,19 @@ 'These will be objects that do not inherit from the cperistentobject class, but which 'still need to be saved/retrieved from the database. -Public Class CInjectedObject +Public Class InjectedObject Implements IPersistableObject - Private m_object As Object + Private m_object As Object 'WeakReference Private m_originalObject As Object Private m_associationsLoaded As Boolean - Private m_oid As COID + Private m_oid As ObjectId Private m_cacheExpiry As Double Private m_guid As Guid - Private m_classmap As CClassMap + Private m_classmap As ClassMap Private m_persistent As Boolean Private m_state As PersistenceState = PersistenceState.Unknown - Private m_retrievedCacheKey As CCacheKey + Private m_retrievedCacheKey As CacheKey Private m_loading As Boolean Private m_queued As Boolean Private m_proxy As Boolean @@ -37,7 +37,11 @@ Public Property ReferencedObject() As Object Get - Return m_object + 'If m_object.IsAlive Then + Return m_object '.Target + 'Else + ' Return Nothing + 'End If End Get Set(ByVal Value As Object) m_object = Value @@ -59,32 +63,31 @@ Sub ReplaceWith(ByVal obj As IPersistableObject, ByVal copyEventHandlers As Boolean) Implements IPersistableObject.ReplaceWith If Not obj.GetObjectType Is Me.GetObjectType Then - Throw New Exception("Objects must be of the same type") + Throw New AtomsFrameworkException("Objects must be of the same type") End If - Dim injObj As CInjectedObject + Dim injObj As InjectedObject If Not obj.IsIPersistentObject Then - injObj = CType(obj, CInjectedObject) + injObj = CType(obj, InjectedObject) ReplaceValues(injObj.m_object, m_object, copyEventHandlers) Else ReplaceValues(obj, m_object, copyEventHandlers) End If End Sub - Public Sub ReplaceValues(ByVal sourceObject As Object, ByVal targetObject As Object, ByVal copyEventHandlers As Boolean) + Public Shared Sub ReplaceValues(ByVal source As Object, ByVal target As Object, ByVal copyEventHandlers As Boolean) 'Use reflection to copy all of the fields from sourceObj to targetobject (by value) - If sourceObject Is Nothing OrElse targetObject Is Nothing Then Return - If Not sourceObject.GetType Is targetObject.GetType And Not sourceObject.GetType.IsSubclassOf(targetObject.GetType) Then - Throw New Exception("Objects must be of the same type") + If source Is Nothing OrElse target Is Nothing Then Return + If Not source.GetType Is target.GetType And Not source.GetType.IsSubclassOf(target.GetType) Then + Throw New AtomsFrameworkException("Objects must be of the same type") End If - If sourceObject Is targetObject Then + If source Is target Then 'Same object so nothing to do Exit Sub End If Dim f, fields() As FieldInfo Dim value As Object - Dim t, iListType, iDicType As Type - Try - t = targetObject.GetType + Dim t, iListType, iDicType As Type Try + t = target.GetType While Not t Is Nothing fields = t.GetFields(BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) For Each f In fields @@ -92,13 +95,13 @@ 'This is an event! 'Do Nothing Else - iListType = f.FieldType.GetInterface("IList", True) - iDicType = f.FieldType.GetInterface("IDictionary", True) - 'Do not copy collections yet - we'll do that at the end - If iListType Is Nothing AndAlso iDicType Is Nothing Then - value = f.GetValue(sourceObject) - f.SetValue(targetObject, value) - End If + iListType = f.FieldType.GetInterface("IList", True) + iDicType = f.FieldType.GetInterface("IDictionary", True) + 'Do not copy collections yet - we'll do that at the end + If iListType Is Nothing AndAlso iDicType Is Nothing Then + value = f.GetValue(source) + f.SetValue(target, value) + End If End If Next If Not t.BaseType Is Nothing Then @@ -107,18 +110,17 @@ t = Nothing End If End While - CPersistenceBroker.CopyCollections(sourceObject, targetObject) - Catch ex As Exception + PersistenceBroker.CopyCollections(source, target) Catch ex As Exception Debug.WriteLine(ex.Message) End Try End Sub - Public Function getClassMap() As CClassMap Implements IPersistableObject.getClassMap - Dim tmpCMap As CClassMap + Public Function GetClassMap() As ClassMap Implements IPersistableObject.getClassMap + 'Dim tmpCMap As ClassMap If m_classmap Is Nothing Then - Dim persistenceBroker As CPersistenceBroker - persistenceBroker = getPersistenceBrokerInstance() - m_classmap = persistenceBroker.getClassMap(m_object.GetType) + Dim persistenceBroker As PersistenceBroker + persistenceBroker = GetPersistenceBrokerInstance() + m_classmap = persistenceBroker.GetClassMap(m_object.GetType) End If If (m_classmap Is Nothing) Then Throw New NoClassMapException("No class map for " & m_object.GetType.FullName) @@ -126,13 +128,13 @@ Return m_classmap End Function - Private Function getClassMap(ByVal name As String, ByVal fullname As String) As CClassMap + Private Function GetClassMap(ByVal name As String, ByVal fullname As String) As ClassMap If m_classmap Is Nothing Then - Dim persistenceBroker As CPersistenceBroker - persistenceBroker = getPersistenceBrokerInstance() - m_classmap = persistenceBroker.getClassMap(name) + Dim persistenceBroker As PersistenceBroker + persistenceBroker = GetPersistenceBrokerInstance() + m_classmap = persistenceBroker.GetClassMap(name) If m_classmap Is Nothing Then - m_classmap = persistenceBroker.getClassMap(fullname) + m_classmap = persistenceBroker.GetClassMap(fullname) End If If (m_classmap Is Nothing) Then Return Nothing @@ -142,23 +144,23 @@ End Function Public Function GetObjectType() As Type Implements IPersistableObject.GetObjectType - If m_object Is Nothing Then + If m_object Is Nothing Then 'OrElse Not m_object.IsAlive Then Return GetType(Object) End If Return m_object.GetType End Function - Public Function getValueByAttribute(ByVal obj As Object, ByVal pName As String) As Object + Public Shared Function GetValueByAttribute(ByVal obj As Object, ByVal name As String) As Object Dim dotPos As Integer - dotPos = pName.IndexOf(".") + dotPos = name.IndexOf(".") If dotPos = -1 Then - Return CallByName(obj, pName, CallType.Get) + Return CallByName(obj, name, CallType.Get) Else Dim o As Object Dim objName As String Dim propertyName As String - objName = pName.Substring(0, dotPos) - propertyName = pName.Substring(dotPos + 1) + objName = name.Substring(0, dotPos) + propertyName = name.Substring(dotPos + 1) o = CallByName(obj, objName, CallType.Get) If o Is Nothing Then Return Nothing @@ -167,18 +169,18 @@ End If End Function - Public Function getValueByAttribute(ByVal pName As String) As Object Implements IPersistableObject.getValueByAttribute - Return getValueByAttribute(m_object, pName) + Public Function GetValueByAttribute(ByVal name As String) As Object Implements IPersistableObject.getValueByAttribute + Return GetValueByAttribute(m_object, name) End Function - Public Function getOriginalValueByAttribute(ByVal pName As String) As Object - Return getValueByAttribute(m_originalObject, pName) + Public Function GetOriginalValueByAttribute(ByVal name As String) As Object + Return GetValueByAttribute(m_originalObject, name) End Function Public Property AssociationsLoaded() As Boolean Implements IPersistableObject.AssociationsLoaded Get - If Me.getClassMap.AssociationMapCount > 0 Then - Return m_associationsLoaded + If Me.GetClassMap.AssociationMapCount > 0 Then + Return m_associationsLoaded Else 'If the class has no associations then associations are already "loaded" 'However if the object is not persistent then the associations obviously can't be loaded yet @@ -217,46 +219,46 @@ End Set End Property - Public Function getFieldLengthByName(ByVal x As String) As Integer Implements IPersistableObject.getFieldLengthByName - Return getClassMap.getAttributeMapByString(x, True).ColumnMap.StorageSize() + Public Function GetFieldLengthByName(ByVal propertyName As String) As Integer Implements IPersistableObject.getFieldLengthByName + Return GetClassMap.GetAttributeMapByString(propertyName, True).ColumnMap.StorageSize() End Function - Public Function getFieldTypeByName(ByVal x As String) As System.Type Implements IPersistableObject.getFieldTypeByName - Return getClassMap.getAttributeMapByString(x, True).ColumnMap.StorageType + Public Function GetFieldTypeByName(ByVal propertyName As String) As System.Type Implements IPersistableObject.getFieldTypeByName + Return GetClassMap.GetAttributeMapByString(propertyName, True).ColumnMap.StorageType End Function - Public Property GUIDValue() As String Implements IPersistableObject.GUIDValue + Public Property GuidValue() As String Implements IPersistableObject.GUIDValue Get If m_guid.Equals(Guid.Empty) Then m_guid = Guid.NewGuid End If - GUIDValue = m_guid.ToString("N") + Return m_guid.ToString("N") End Get - Set(ByVal value As String) - m_guid = New Guid(value) + Set(ByVal Value As String) + m_guid = New Guid(Value) End Set End Property - Public Function ObjectsMatch(ByVal sourceObject As Object, ByVal targetObject As Object) As Boolean - If sourceObject Is Nothing AndAlso targetObject Is Nothing Then Return True - If sourceObject Is Nothing OrElse targetObject Is Nothing Then Return False - If Not sourceObject.GetType Is targetObject.GetType Then + Public Function ObjectsMatch(ByVal source As Object, ByVal target As Object) As Boolean + If source Is Nothing AndAlso target Is Nothing Then Return True + If source Is Nothing OrElse target Is Nothing Then Return False + If Not source.GetType Is target.GetType Then Return False End If - Dim cmap As CClassMap + Dim cmap As ClassMap Dim value As Object, value1 As Object - cmap = Me.getClassMap() + cmap = Me.GetClassMap() 'Do equality checks only on attributes that will be persisted 'Everything else is ignorable since it's only the database mapped fields 'that are important While Not cmap Is Nothing - For Each att As CAttributeMap In cmap.AttributeMaps + For Each att As AttributeMap In cmap.AttributeMaps If Not att.ColumnMap Is Nothing Then - value = getValueByAttribute(sourceObject, att.Name) - value1 = getValueByAttribute(targetObject, att.Name) + value = GetValueByAttribute(source, att.Name) + value1 = GetValueByAttribute(target, att.Name) If Not Equals(value, value1) Then Return False End If @@ -308,9 +310,9 @@ End Set End Property - Public ReadOnly Property isModifyOnly() As Boolean Implements IPersistableObject.isModifyOnly + Public ReadOnly Property IsModifyOnly() As Boolean Implements IPersistableObject.isModifyOnly Get - Return getClassMap.isModifyOnly + Return GetClassMap.IsModifyOnly End Get End Property @@ -323,26 +325,26 @@ End Set End Property - Public ReadOnly Property isReadOnly() As Boolean Implements IPersistableObject.isReadOnly + Public ReadOnly Property IsReadOnly() As Boolean Implements IPersistableObject.isReadOnly Get - Return getClassMap.isReadOnly + Return GetClassMap.IsReadOnly End Get End Property - Public Property OIDValue() As String Implements IPersistableObject.OIDValue + Public Property OidValue() As String Implements IPersistableObject.OIDValue Get - Dim oidfactory As COIDFactory + Dim oidfactory As ObjectIdFactory If m_oid Is Nothing Then - oidfactory = getOIDFactoryInstance() - m_oid = oidfactory.newOID + oidfactory = GetOidFactoryInstance() + m_oid = oidfactory.NewOid End If - OIDValue = m_oid.OID + Return m_oid.OID End Get - Set(ByVal value As String) + Set(ByVal Value As String) If m_oid Is Nothing Then - m_oid = New COID + m_oid = New ObjectId End If - m_oid.OID = value + m_oid.OID = Value End Set End Property @@ -364,22 +366,22 @@ End Set End Property - Public Function getCollectionByAttribute(ByVal pName As String) As IList Implements IPersistableObject.getCollectionByAttribute - Return getCollectionByAttribute(m_object, pName) + Public Function GetCollectionByAttribute(ByVal name As String) As IList Implements IPersistableObject.getCollectionByAttribute + Return GetCollectionByAttribute(m_object, name) End Function - Private Function getCollectionByAttribute(ByVal srcObj As Object, ByVal pName As String) As IList + Private Shared Function GetCollectionByAttribute(ByVal srcObj As Object, ByVal name As String) As IList Dim dotPos As Integer - dotPos = pName.IndexOf(".") + dotPos = name.IndexOf(".") Try If dotPos = -1 Then - Return CType(CallByName(srcObj, pName, CallType.Get), IList) + Return CType(CallByName(srcObj, name, CallType.Get), IList) Else Dim o As Object Dim objName As String Dim propertyName As String - objName = pName.Substring(0, dotPos) - propertyName = pName.Substring(dotPos + 1) + objName = name.Substring(0, dotPos) + propertyName = name.Substring(dotPos + 1) o = CallByName(srcObj, objName, CallType.Get) If o Is Nothing Then Return Nothing @@ -387,30 +389,30 @@ Return CType(CallByName(o, propertyName, CallType.Get), IList) End If Catch err As Exception - Throw New Exception("getCollectionByAttribute failed for attribute " & pName & " in " & srcObj.GetType.FullName, err) + Throw New AtomsFrameworkException("getCollectionByAttribute failed for attribute " & name & " in " & srcObj.GetType.FullName, err) End Try End Function - Public Function getObjectByAttribute(ByVal pName As String) As IPersistableObject Implements IPersistableObject.getObjectByAttribute - Return getObjectByAttribute(m_object, pName) + Public Function GetObjectByAttribute(ByVal name As String) As IPersistableObject Implements IPersistableObject.getObjectByAttribute + Return GetObjectByAttribute(m_object, name) End Function - Private Function getObjectByAttribute(ByVal srcObj As Object, ByVal pName As String) As IPersistableObject + Private Shared Function GetObjectByAttribute(ByVal srcObj As Object, ByVal name As String) As IPersistableObject Dim dotPos As Integer Dim obj As Object Dim injobj As IPersistableObject - Dim pbroker As CPersistenceBroker + Dim broker As PersistenceBroker - dotPos = pName.IndexOf(".") + dotPos = name.IndexOf(".") Try If dotPos = -1 Then - obj = CallByName(srcObj, pName, CallType.Get) + obj = CallByName(srcObj, name, CallType.Get) Else Dim o As Object Dim objName As String Dim propertyName As String - objName = pName.Substring(0, dotPos) - propertyName = pName.Substring(dotPos + 1) + objName = name.Substring(0, dotPos) + propertyName = name.Substring(dotPos + 1) o = CallByName(srcObj, objName, CallType.Get) If o Is Nothing Then Return Nothing @@ -422,110 +424,110 @@ If TypeOf obj Is IPersistableObject Then injobj = obj Else - pbroker = getPersistenceBrokerInstance() - injobj = pbroker.getInjectedObject(obj) + broker = GetPersistenceBrokerInstance() + injobj = broker.GetInjectedObject(obj) End If Catch ex As Exception - Throw New Exception("getObjectByAttribute failed for attribute " & pName & " in " & srcObj.GetType.FullName, ex) + Throw New AtomsFrameworkException("getObjectByAttribute failed for attribute " & name & " in " & srcObj.GetType.FullName, ex) End Try Return injobj End Function - Public Sub setAttributeValue(ByVal pName As String, ByRef Value As Object) Implements IPersistableObject.setAttributeValue - setAttributeValue(m_object, pName, Value) + Public Sub SetAttributeValue(ByVal name As String, ByRef value As Object) Implements IPersistableObject.setAttributeValue + SetAttributeValue(m_object, name, value) End Sub - Public Sub setAttributeValue(ByVal obj As Object, ByVal pName As String, ByRef Value As Object) - If TypeOf (Value) Is System.DBNull Then + Public Shared Sub SetAttributeValue(ByVal obj As Object, ByVal name As String, ByRef value As Object) + If TypeOf (value) Is System.DBNull Then Exit Sub End If Dim dotPos As Integer - dotPos = pName.IndexOf(".") + dotPos = name.IndexOf(".") Try If dotPos = -1 Then - If TypeOf (Value) Is System.SByte Then - CallByName(obj, pName, CallType.Set, IIf(Value.ToString = "1", True, False)) + If TypeOf (value) Is System.SByte Then + CallByName(obj, name, CallType.Set, IIf(value.ToString = "1", True, False)) Else - CallByName(obj, pName, CallType.Set, Value) + CallByName(obj, name, CallType.Set, value) End If Else Dim o As Object Dim objName As String Dim propertyName As String Dim val As ValueType - objName = pName.Substring(0, dotPos) - propertyName = pName.Substring(dotPos + 1) + objName = name.Substring(0, dotPos) + propertyName = name.Substring(dotPos + 1) o = CallByName(obj, objName, CallType.Get) If o Is Nothing Then Return End If If o.GetType.IsValueType Then val = o - If TypeOf (Value) Is System.SByte Then - CallByName(val, propertyName, CallType.Set, IIf(Value.ToString = "1", True, False)) + If TypeOf (value) Is System.SByte Then + CallByName(val, propertyName, CallType.Set, IIf(value.ToString = "1", True, False)) Else - CallByName(val, propertyName, CallType.Set, Value) + CallByName(val, propertyName, CallType.Set, value) End If CallByName(obj, objName, CallType.Set, val) Else - If TypeOf (Value) Is System.SByte Then - CallByName(o, propertyName, CallType.Set, IIf(Value.ToString = "1", True, False)) + If TypeOf (value) Is System.SByte Then + CallByName(o, propertyName, CallType.Set, IIf(value.ToString = "1", True, False)) Else - CallByName(o, propertyName, CallType.Set, Value) + CallByName(o, propertyName, CallType.Set, value) End If End If End If Catch ex As Exception - Throw New AttributeValueException("Could not set attribute " & pName & " (Value Type: " _ - & Value.GetType.Name & ") in CPersistentObject::SetAttributeValue." & vbCrLf & ex.Message, ex) + Throw New AttributeValueException("Could not set attribute " & name & " (Value Type: " _ + & value.GetType.Name & ") in PersistentObject::SetAttributeValue." & vbCrLf & ex.Message, ex) End Try End Sub - Friend Property OriginalCacheKey() As CCacheKey Implements IPersistableObject.OriginalCacheKey + Friend Property OriginalCacheKey() As CacheKey Implements IPersistableObject.OriginalCacheKey Get Return m_retrievedCacheKey End Get - Set(ByVal Value As CCacheKey) + Set(ByVal Value As CacheKey) m_retrievedCacheKey = Value End Set End Property Public Overloads Function Equals(ByVal obj As IPersistableObject) As Boolean Implements IPersistableObject.Equals - Dim ck1, ck2 As CCacheKey + Dim ck1, ck2 As CacheKey If Me Is Nothing And Not obj Is Nothing Then Return False End If If obj Is Nothing And Not Me Is Nothing Then Return False End If - ck1 = New CCacheKey(Me) - ck2 = New CCacheKey(obj) + ck1 = New CacheKey(Me) + ck2 = New CacheKey(obj) Return ck1.Equals(ck2) And Me.Persistent = obj.Persistent End Function Public Function Copy() As IPersistableObject Implements IPersistableObject.Copy - Dim injobj As CInjectedObject - injobj = Me.getClassMap.CreateObjectInstance + Dim injobj As InjectedObject + injobj = Me.GetClassMap.CreateObjectInstance Me.ReplaceValues(Me.GetSourceObject, injobj.GetSourceObject, False) 'For now we will copy the full object including event handlers 'Me.ReplaceValues(Me.GetSourceObject, injobj.GetSourceObject, True) - 'injobj = CType(Me.MemberwiseClone, CInjectedObject) + 'injobj = CType(Me.MemberwiseClone, InjectedObject) 'Because memberwise clone only reference copies collections we should also 'copy the collections as well, since failing to do so can corrupt the cache. - 'CPersistenceBroker.CopyCollections(Me.GetSourceObject, injobj.GetSourceObject) + 'PersistenceBroker.CopyCollections(Me.GetSourceObject, injobj.GetSourceObject) Return injobj End Function - Function getObjectByClassMap(ByVal classMap As CClassMap) As IPersistableObject Implements IPersistableObject.getObjectByClassMap - Dim obj, Value As IPersistableObject - Dim col As IList - Dim i, k As Short - Dim cm As CClassMap - Dim de As DictionaryEntry - Dim udamap As CUDAMap + Function GetObjectByClassMap(ByVal classMap As ClassMap) As IPersistableObject Implements IPersistableObject.getObjectByClassMap + Dim obj As IPersistableObject + 'Dim col As IList + Dim i As Short ', k As Short + Dim cm As ClassMap + 'Dim de As DictionaryEntry + Dim udamap As AssociationMap obj = classMap.CreateObjectInstance @@ -535,28 +537,28 @@ obj.State = Me.State End If - Dim ci As CInjectedObject + Dim ci As InjectedObject If Not obj.IsIPersistentObject Then - ci = CType(obj, CInjectedObject) + ci = CType(obj, InjectedObject) End If 'set object's attributes - also copy the original values as well. 'set the associated objects - For i = 1 To classMap.getStraightAssociationMapSize - udamap = classMap.getStraightAssociationMap(i) - If udamap.Cardinality = CUDAMap.CardinalityEnum.ONE_TO_ONE Then - obj.SetAttributeValue(udamap.FromClassTarget, Me.getObjectByAttribute(udamap.FromClassTarget)) - If Not ci Is Nothing Then ci.setAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.getObjectByAttribute(m_originalObject, udamap.FromClassTarget)) - ElseIf udamap.Cardinality = CUDAMap.CardinalityEnum.ONE_TO_MANY Or udamap.Cardinality = CUDAMap.CardinalityEnum.MANY_TO_MANY Then - obj.SetAttributeValue(udamap.FromClassTarget, Me.getCollectionByAttribute(udamap.FromClassTarget)) - If Not ci Is Nothing Then ci.setAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.getCollectionByAttribute(m_originalObject, udamap.FromClassTarget)) + For i = 1 To classMap.GetStraightAssociationMapSize + udamap = classMap.GetStraightAssociationMap(i) + If udamap.CardinalityType = AssociationMap.Cardinality.OneToOne Then + obj.SetAttributeValue(udamap.FromClassTarget, Me.GetObjectByAttribute(udamap.FromClassTarget)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetObjectByAttribute(m_originalObject, udamap.FromClassTarget)) + ElseIf udamap.CardinalityType = AssociationMap.Cardinality.OneToMany Or udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany Then + obj.SetAttributeValue(udamap.FromClassTarget, Me.GetCollectionByAttribute(udamap.FromClassTarget)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetCollectionByAttribute(m_originalObject, udamap.FromClassTarget)) End If Next i - Dim AttrMap As CAttributeMap + Dim AttrMap As AttributeMap For i = 1 To CType(classMap.AttributeMaps.Count, Short) - AttrMap = classMap.getAttributeMap(i) + AttrMap = classMap.GetAttributeMap(i) If Not AttrMap.ColumnMap Is Nothing Then - obj.SetAttributeValue(AttrMap.Name, Me.getValueByAttribute(AttrMap.Name)) - If Not ci Is Nothing Then ci.setAttributeValue(ci.m_originalObject, AttrMap.Name, Me.getOriginalValueByAttribute(AttrMap.Name)) + obj.SetAttributeValue(AttrMap.Name, Me.GetValueByAttribute(AttrMap.Name)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, AttrMap.Name, Me.GetOriginalValueByAttribute(AttrMap.Name)) End If Next @@ -564,23 +566,23 @@ cm = classMap.SuperClass While Not cm Is Nothing 'set the associated objects - For i = 1 To cm.getStraightAssociationMapSize - udamap = cm.getStraightAssociationMap(i) - If udamap.Cardinality = CUDAMap.CardinalityEnum.ONE_TO_ONE Then - obj.SetAttributeValue(udamap.FromClassTarget, Me.getObjectByAttribute(udamap.FromClassTarget)) - If Not ci Is Nothing Then ci.setAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.getObjectByAttribute(m_originalObject, udamap.FromClassTarget)) - ElseIf udamap.Cardinality = CUDAMap.CardinalityEnum.ONE_TO_MANY Or udamap.Cardinality = CUDAMap.CardinalityEnum.MANY_TO_MANY Then - obj.SetAttributeValue(udamap.FromClassTarget, Me.getCollectionByAttribute(udamap.FromClassTarget)) - If Not ci Is Nothing Then ci.setAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.getCollectionByAttribute(m_originalObject, udamap.FromClassTarget)) + For i = 1 To cm.GetStraightAssociationMapSize + udamap = cm.GetStraightAssociationMap(i) + If udamap.CardinalityType = AssociationMap.Cardinality.OneToOne Then + obj.SetAttributeValue(udamap.FromClassTarget, Me.GetObjectByAttribute(udamap.FromClassTarget)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetObjectByAttribute(m_originalObject, udamap.FromClassTarget)) + ElseIf udamap.CardinalityType = AssociationMap.Cardinality.OneToMany Or udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany Then + obj.SetAttributeValue(udamap.FromClassTarget, Me.GetCollectionByAttribute(udamap.FromClassTarget)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetCollectionByAttribute(m_originalObject, udamap.FromClassTarget)) End If Next i 'set superclass's attributes For i = 1 To CType(cm.AttributeMaps.Count, Short) - AttrMap = cm.getAttributeMap(i) + AttrMap = cm.GetAttributeMap(i) If Not AttrMap.ColumnMap Is Nothing Then - obj.SetAttributeValue(AttrMap.Name, Me.getValueByAttribute(AttrMap.Name)) - If Not ci Is Nothing Then ci.setAttributeValue(ci.m_originalObject, AttrMap.Name, Me.getValueByAttribute(m_originalObject, AttrMap.Name)) + obj.SetAttributeValue(AttrMap.Name, Me.GetValueByAttribute(AttrMap.Name)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, AttrMap.Name, Me.GetValueByAttribute(m_originalObject, AttrMap.Name)) End If Next cm = cm.SuperClass @@ -591,11 +593,11 @@ Public Overrides Function ToString() As String Dim s As String Dim i As Short - Dim indent As Integer + 'Dim indent As Integer Dim formatString As String - Dim cm As CClassMap - Dim am As CAttributeMap + Dim cm As ClassMap + Dim am As AttributeMap Dim x As Object Dim y As Object Dim xstring As String @@ -606,19 +608,19 @@ End If s = Me.GetObjectType.ToString & ": " & vbCrLf - indent = s.Length + 'indent = s.Length formatString = Space(s.Length) & "{0,-9}" & vbTab & "{1,-13}" & vbTab & "{2,-14}" & vbCrLf s &= [String].Format(formatString, "Attribute", "Current Value", "Original Value") s &= [String].Format(formatString, "---------", "-------------", "--------------") i = 0 - cm = getClassMap() - For i = 1 To cm.getKeySize - am = cm.getKeyAttributeMap(i) - x = Me.getValueByAttribute(am.Name) - y = Me.getOriginalValueByAttribute(am.Name) + cm = GetClassMap() + For i = 1 To cm.GetKeySize + am = cm.GetKeyAttributeMap(i) + x = Me.GetValueByAttribute(am.Name) + y = Me.GetOriginalValueByAttribute(am.Name) Try xstring = x.ToString - Catch ex As Exception + Catch If x Is Nothing Then xstring = "Nothing" Else @@ -627,7 +629,7 @@ End Try Try ystring = y.ToString - Catch ex As Exception + Catch If y Is Nothing Then ystring = "Nothing" Else @@ -643,13 +645,13 @@ Return m_object End Function - Public Overridable Function hasValidKey() As Boolean Implements IPersistableObject.HasValidKey + Public Overridable Function HasValidKey() As Boolean Implements IPersistableObject.HasValidKey 'Check for any non-null key attributes - Dim am As CAttributeMap - Dim cm As CClassMap - cm = Me.getClassMap + Dim am As AttributeMap + Dim cm As ClassMap + cm = Me.GetClassMap For Each am In cm.KeyAttributeMaps - If Not IsNullAlias(Me.getValueByAttribute(am.Name)) Then + If Not IsNullAlias(Me.GetValueByAttribute(am.Name)) Then Return True End If Next @@ -657,30 +659,30 @@ End Function Private Sub CopyOneToManyCollections() Implements IPersistableObject.CopyOneToManyCollections - Dim cm As CClassMap + Dim cm As ClassMap Dim coll As Object - cm = Me.getClassMap + cm = Me.GetClassMap m_oneToManyCollections = New Collection - Dim aMap As CUDAMap + Dim aMap As AssociationMap While Not cm Is Nothing - For Each de As DictionaryEntry In cm.AssociationMaps - aMap = de.Value - If aMap.Cardinality = aMap.CardinalityEnum.ONE_TO_MANY Then - coll = CPersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) - m_oneToManyCollections.Add(coll, aMap.FromClassTarget) - End If - Next + For Each de As DictionaryEntry In cm.AssociationMaps + aMap = de.Value + If aMap.CardinalityType = aMap.Cardinality.OneToMany Then + coll = PersistenceBroker.CopyCollection(Me, aMap.FromClassTarget) + m_oneToManyCollections.Add(coll, aMap.FromClassTarget) + End If + Next cm = cm.SuperClass End While End Sub Public Function GetRemovedCollectionItems(ByVal propertyName As String) As Collection Implements IPersistableObject.GetRemovedCollectionItems - Dim t, iListType, iDicType As Type - Dim fromColl, origColl, collItem As Object + Dim iListType, iDicType As Type + Dim origColl, collItem As Object Dim fromIList, origIList As IList - Dim fromDict, origDict As IDictionary + Dim fromDict As IDictionary Dim p As PropertyInfo - Dim tmpObj As Object + 'Dim tmpObj As Object Dim toColl As New Collection Dim injObj As IPersistableObject @@ -688,24 +690,24 @@ If m_oneToManyCollections.Count = 0 Then origColl = Nothing Else - origColl = m_oneToManyCollections.Item(PropertyName) + origColl = m_oneToManyCollections.Item(propertyName) End If Catch origColl = Nothing End Try If origColl Is Nothing Then Return toColl - p = Me.GetObjectType.GetProperty(PropertyName, BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) + p = Me.GetObjectType.GetProperty(propertyName, BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public) iListType = p.PropertyType.GetInterface("IList", True) iDicType = p.PropertyType.GetInterface("IDictionary", True) If Not iListType Is Nothing OrElse Not iDicType Is Nothing Then If Not iListType Is Nothing Then origIList = CType(origColl, IList) - fromIList = CType(Me.getValueByAttribute(PropertyName), IList) + fromILis... [truncated message content] |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:34
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MaxDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_MaxDB Modified Files: AF_MaxDB.vbproj AssemblyInfo.vb CMaxDBDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: AF_MaxDB.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MaxDB/AF_MaxDB.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_MaxDB.vbproj 7 Feb 2005 07:37:37 -0000 1.1 +++ AF_MaxDB.vbproj 11 Apr 2005 00:31:46 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_MaxDB" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.MaxDB" + StartupObject = "AtomsFramework.Providers.MaxDB.(None)" > <Config Name = "Debug" Index: CMaxDBDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MaxDB/CMaxDBDatabase.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CMaxDBDatabase.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ CMaxDBDatabase.vb 11 Apr 2005 00:31:46 -0000 1.3 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On -Imports AF_ODBC +Imports AtomsFramework.Providers.ODBC '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for MaxDB Servers. +''' Implementation of RelationalDatabase for MaxDB Servers. ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with MaxDB databases. The only .NET provider is an ODBC connection Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MaxDB/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:46 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:15
|
Update of /cvsroot/jcframework/dotnet/Nunit/StandardClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Nunit/StandardClasses Added Files: LazyEmployee.vb NPEmployee.vb NPJob.vb NPTeam.vb NonInheritedRetreiveCriteria.vb NonInheritedTests.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository --- NEW FILE: NPEmployee.vb --- Namespace StandardClasses Public Class NPEmployee Private m_name As String Private m_parentname As String Private m_parent As NPEmployee Private m_children As ArrayList Private m_team As NPTeam Private m_teamname As String Public Property Name() As String Get Return m_name End Get Set(ByVal Value As String) m_name = Value End Set End Property Public Property ReportsTo() As NPEmployee Get Return m_parent End Get Set(ByVal Value As NPEmployee) If Not Value Is Nothing Then m_parent = Value m_parentname = Value.Name End If End Set End Property Public Property ReportsToName() As String Get If m_parent Is Nothing Then Return m_parentname Else Return (m_parent.Name) End If End Get Set(ByVal Value As String) m_parentname = Value 'Clear the parent object if the name is cleared If m_parentname = Nothing OrElse m_parentname = String.Empty Then m_parent = Nothing End If End Set End Property Public Property Workers() As ArrayList Get Return m_children End Get Set(ByVal Value As ArrayList) m_children = Value End Set End Property Public Property Team() As NPTeam Get Return m_team End Get Set(ByVal Value As NPTeam) If Not Value Is Nothing Then m_team = Value m_teamname = Value.Name End If End Set End Property Public Property TeamName() As String Get If m_team Is Nothing Then Return m_teamname Else Return (m_team.Name) End If End Get Set(ByVal Value As String) m_teamname = Value End Set End Property Public Sub New() MyBase.New() m_children = New ArrayList End Sub End Class End Namespace --- NEW FILE: NonInheritedTests.vb --- Imports AtomsFramework Imports NUnit.Framework Namespace StandardClasses <TestFixture()> Public Class NonInheritedTests Private pbroker As PersistenceBroker Private job As NPJob Private emp As NPEmployee <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory Dim retry As Boolean = True While retry = True Try 'Remove any existing test database System.IO.File.Delete(".\db1.mdb") retry = False Catch iox As IO.IOException 'file is in use - so we will loop around until it is released Catch ex As Exception retry = False End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") pbroker = New PersistenceBroker pbroker.init() End Sub <TestFixtureTearDown()> Public Sub Dispose() pbroker.Dispose() pbroker = Nothing End Sub <SetUp()> Public Sub TestInit() job = New NPJob emp = New NPEmployee End Sub <Test()> Public Sub LoadJob_a1() job.Id = "a1" pbroker.GetObject(job) Assert.IsTrue(pbroker.getInjectedObject(job).Persistent) Assert.AreEqual("basic", job.Description) End Sub <Test()> Public Sub FindJob_basic() pbroker.ClearCache() Dim job As New NPJob 'NPJob has no find attributes so we set the key id job.Id = "a1" pbroker.FindObject(job) Assert.IsTrue(pbroker.getInjectedObject(job).Persistent) Assert.AreEqual("basic", job.Description) End Sub <Test(), ExpectedException(GetType(System.Exception))> Public Sub CheckForError() pbroker.GetObject(job) End Sub <Test()> Public Sub SaveJob_a2() job.Id = "a2" pbroker.GetObject(job) job.Description = "SomeJob" Assert.IsTrue(pbroker.getInjectedObject(job).IsDirty) pbroker.PersistChanges(job) Assert.IsFalse(pbroker.getInjectedObject(job).IsDirty) End Sub <Test()> Public Sub DeleteAJob() job.Id = "a3" pbroker.GetObject(job) job.Description = "SomeJob3" pbroker.PersistChanges(job) pbroker.MarkForDeletion(job) pbroker.PersistChanges(job) Assert.IsFalse(pbroker.ObjectIsTracked(job)) End Sub <Test()> Public Sub CheckInjectionCache() Dim job2 As New NPJob Try pbroker.GetObject(job) Catch End Try Assert.IsFalse(pbroker.ObjectIsTracked(job)) job.Id = "1" pbroker.GetObject(job) job.Description = "a" Assert.IsTrue(pbroker.ObjectIsTracked(job)) job2.Id = "2" pbroker.GetObject(job2) job2.Description = "b" pbroker.PersistChanges(job) pbroker.PersistChanges(job2) End Sub <Test()> Public Sub CheckInjectionCache2() Dim job2 As New NPJob job.Id = "3" job2.Id = "4" pbroker.GetObject(job) pbroker.GetObject(job2) job.Description = "c" job2.Description = "d" Assert.IsFalse(pbroker.getInjectedObject(job).Persistent) pbroker.PersistChanges() Assert.IsTrue(pbroker.getInjectedObject(job).Persistent) End Sub <Test()> Public Sub LoadEmployee_a() emp.Name = "a" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.AreEqual(emp.Workers.Count, 0) Assert.IsTrue(Not emp.ReportsTo Is Nothing) Assert.AreEqual(emp.ReportsTo.Name, "c") Dim emp2 As NPEmployee emp2 = CType(emp.ReportsTo.Workers(0), NPEmployee) Assert.AreEqual(emp2.Name, emp.Name) Assert.AreSame(emp2, emp) End Sub <Test()> Public Sub LoadEmployee_ac() emp.Name = "ac" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.AreEqual(emp.Workers.Count, 3) emp = CType(emp.Workers.Item(1), NPEmployee) Assert.AreEqual(emp.Name, "aa") Assert.AreEqual(emp.ReportsTo.Name, "ac") End Sub <Test()> Public Sub CheckSchemaBasedProperties() emp.Name = "ac" pbroker.FindObject(emp) Assert.AreEqual(50, pbroker.getInjectedObject(emp).getFieldLengthByName("Name")) Assert.IsTrue(pbroker.getInjectedObject(emp).getFieldTypeByName("Name") Is GetType([String])) End Sub <Test()> Public Sub PersistentObjectEquality() Dim emp2 As NPEmployee emp.Name = "ac" pbroker.FindObject(emp) emp2 = New NPEmployee emp2.Name = "aa" pbroker.FindObject(emp2) Assert.IsTrue(emp.Equals(emp2.ReportsTo)) Assert.AreEqual(3, emp2.ReportsTo.Workers.Count) End Sub <Test()> Public Sub LoadSaveandDeleteEmployee() emp.Name = "new" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) pbroker.PersistChanges(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.IsTrue(emp.ReportsTo Is Nothing) Debug.WriteLine(pbroker.DumpCacheDetails) emp = New NPEmployee emp.Name = "new" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.AreEqual(emp.Name, "new") pbroker.MarkForDeletion(emp) pbroker.PersistChanges(emp) emp = New NPEmployee emp.Name = "new" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) End Sub <Test()> Public Sub ChangeFindFieldValue() emp.Name = "SaveThenChange" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) pbroker.PersistChanges(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.IsTrue(emp.ReportsTo Is Nothing) emp = New NPEmployee emp.Name = "SaveThenChange" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.AreEqual(emp.Name, "SaveThenChange") emp.Name = "Changed" pbroker.PersistChanges(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) pbroker.MarkForDeletion(emp) pbroker.PersistChanges(emp) emp = New NPEmployee emp.Name = "Changed" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) emp = New NPEmployee emp.Name = "SaveThenChange" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) End Sub <Test()> Public Sub saveHierarchy() Dim emp2 As New NPEmployee Dim emp3 As New NPEmployee emp.Name = "theBoss" pbroker.GetObject(emp) emp2.Name = "middleMgr" emp3.Name = "slave" emp.Workers.Add(emp2) emp2.ReportsTo = emp emp2.Workers.Add(emp3) emp3.ReportsTo = emp2 pbroker.PersistChanges(emp) pbroker.ClearCache() emp = New NPEmployee emp.Name = "slave" pbroker.FindObject(emp) Assert.AreEqual("middleMgr", emp.ReportsTo.Name) Assert.AreEqual("theBoss", emp.ReportsTo.ReportsTo.Name) emp2 = CType(emp.ReportsTo.Workers(0), NPEmployee) Assert.AreEqual("slave", emp2.Name) End Sub <Test()> Public Sub RemoveFromCollection() Dim emp2 As New NPEmployee Dim emp3 As New NPEmployee emp.Name = "ABoss" pbroker.GetObject(emp) emp2.Name = "AManager" emp3.Name = "AWorker" emp.Workers.Add(emp2) emp2.ReportsTo = emp emp2.Workers.Add(emp3) emp3.ReportsTo = emp2 pbroker.PersistChanges(emp) pbroker.ClearCache() emp = New NPEmployee emp.Name = "ABoss" pbroker.FindObject(emp) emp.Workers.Clear() 'Save auto is true so workers should be deleted pbroker.PersistChanges(emp) emp = New NPEmployee emp.Name = "AManager" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent, "AManager was deleted") Assert.IsNull(emp.ReportsTo, "AManager's ReportsTo wasn't cleared") emp = New NPEmployee emp.Name = "AWorker" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent, "AWorker was deleted") End Sub <Test()> Public Sub LazyLoadEmployees() Dim emp1 As New LazyEmployee emp1.Name = "aa" pbroker.FindObject(emp1) Assert.AreEqual("aa", emp1.Name) Assert.AreEqual("ac", emp1.ReportsTo.Name) Assert.AreEqual(emp1.ReportsToName, emp1.ReportsTo.Name) Assert.AreEqual(0, emp1.ReportsTo.Workers.Count) End Sub End Class End Namespace --- NEW FILE: NonInheritedRetreiveCriteria.vb --- Imports AtomsFramework Imports NUnit.Framework Namespace StandardClasses <TestFixture()> Public Class NonInheritedRetreiveCriteria Private pbroker As PersistenceBroker Private emp As NPEmployee Private r As RetrieveCriteria Private mr As MultiRetrieveCriteria Private c As ResultCursor Private injObj As InjectedObject <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory Dim retry As Boolean = True While retry = True Try 'Remove any existing test database System.IO.File.Delete(".\db1.mdb") retry = False Catch iox As IO.IOException 'file is in use - so we will loop around until it is released Catch ex As Exception retry = False End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") pbroker = New PersistenceBroker pbroker.init() End Sub <TestFixtureTearDown()> Public Sub Dispose() pbroker.Dispose() pbroker = Nothing End Sub <SetUp()> Public Sub testInit() emp = New NPEmployee End Sub <Test()> Public Sub SingleClassRetrieve() r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(GetType(NPEmployee)) c = r.perform Assert.IsTrue(c.hasElements) Assert.IsTrue(Not c.EOF) Assert.IsTrue(c.HoldsProxies) Assert.AreEqual(c.ResultSet.ResultSet.Tables(0).Rows.Count, 6) End Sub <Test()> Public Sub LoadFullObjects() r = New RetrieveCriteria r.ReturnFullObjects = True r.ClassMap = pbroker.getClassMap(emp.GetType) c = r.perform Assert.IsFalse(c.HoldsProxies) While c.hasElements And Not c.EOF emp = New NPEmployee c.loadObject(emp) injObj = pbroker.getInjectedObject(emp) Assert.IsTrue(injObj.Persistent) c.nextCursor() End While c.SetCursor(0) emp = New NPEmployee c.loadObject(emp) Assert.AreEqual(emp.Name, "ab") End Sub <Test()> Public Sub SimpleOrCriteria() r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(emp.GetType) r.WhereCondition.addSelectEqualTo("Name", "aa") r.WhereCondition.addSelectEqualTo("Name", "b", True) c = r.perform Assert.IsTrue(c.hasElements) Assert.AreEqual(c.ResultSet.ResultSet.Tables(0).Rows.Count, 2) c.loadObject(emp) Assert.AreEqual(emp.Name, "aa") c.nextCursor() emp = New NPEmployee c.loadObject(emp) Assert.AreEqual(emp.Name, "b") End Sub <Test()> Public Sub SelectInList() Dim al As New ArrayList al.Add("aa") al.Add("b") r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(emp.GetType) r.WhereCondition.addSelectInList("Name", al) c = r.perform Assert.IsTrue(c.hasElements) Assert.AreEqual(c.ResultSet.ResultSet.Tables(0).Rows.Count, 2) c.loadObject(emp) Assert.AreEqual(emp.Name, "aa") c.nextCursor() emp = New NPEmployee c.loadObject(emp) Assert.AreEqual(emp.Name, "b") End Sub <Test()> Public Sub SubCriteria() Dim xx_1 As New CriteriaCondition Dim xx_2 As New CriteriaCondition Dim xx_3 As New CriteriaCondition Dim xx_4 As New CriteriaCondition r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(emp.GetType) xx_1.ClassMap = r.ClassMap xx_2.ClassMap = r.ClassMap xx_3.ClassMap = r.ClassMap xx_4.ClassMap = r.ClassMap xx_1.addSelectEqualTo("Name", "aa") xx_2.addSelectEqualTo("Name", "ab") xx_1.addSubCriteria(xx_2, True) xx_3.addSelectEqualTo("Name", "ab") xx_4.addSelectEqualTo("Name", "ac") xx_3.addSubCriteria(xx_4, True) r.WhereCondition.addSubCriteria(xx_1, True) r.WhereCondition.addSubCriteria(xx_3, False) c = r.perform Assert.IsTrue(c.hasElements) Assert.AreEqual(c.ResultSet.ResultSet.Tables(0).Rows.Count, 1) While c.hasElements And Not c.EOF emp = New NPEmployee c.loadObject(emp) Assert.AreEqual(emp.Name, "ab") c.nextCursor() End While End Sub <Test()> Public Sub MultiRetrieveTest1() Dim si As SelectInCriteria mr = New MultiRetrieveCriteria(emp) mr.WhereCondition.addSelectEqualTo("Name", "ac") si = New SelectInCriteria(emp) si.WhereCondition.addSelectEqualTo("Name", "ac") si.SetSelectAttribute("Name") mr.WhereCondition.addSelectNotIn("Name", si) c = mr.perform Assert.IsFalse(c.hasElements) Assert.IsTrue(c.EOF) End Sub End Class End Namespace --- NEW FILE: NPJob.vb --- Namespace StandardClasses Public Class NPJob Private m_id As String Private m_description As String Public Property Id() As String Get Return m_id End Get Set(ByVal Value As String) m_id = Value End Set End Property Public Property Description() As String Get Return m_description End Get Set(ByVal Value As String) m_description = Value End Set End Property End Class End Namespace --- NEW FILE: NPTeam.vb --- Namespace StandardClasses Public Class NPTeam Private m_leader As NPEmployee Private m_leadername As String Private m_name As String Private m_job As NPJob Private m_jobId As String Private m_members As ArrayList Public Property TeamLeader() As NPEmployee Get Return m_leader End Get Set(ByVal Value As NPEmployee) m_leader = Value m_leadername = Value.Name End Set End Property Public Property TeamLeaderName() As String Get If m_leader Is Nothing Then Return m_leadername Else Return (m_leader.Name) End If End Get Set(ByVal Value As String) m_leadername = Value End Set End Property Public Property Job() As NPJob Get Return m_job End Get Set(ByVal Value As NPJob) m_job = Value m_jobId = Value.Id End Set End Property Public Property jobId() As String Get If m_job Is Nothing Then Return m_jobId Else Return (m_job.Id) End If End Get Set(ByVal Value As String) m_jobId = Value End Set End Property Public Property Name() As String Get Return m_name End Get Set(ByVal Value As String) m_name = Value End Set End Property Public Property Members() As ArrayList Get Return m_members End Get Set(ByVal Value As ArrayList) m_members = Value End Set End Property Public Sub New() MyBase.new() m_members = New ArrayList End Sub End Class End Namespace --- NEW FILE: LazyEmployee.vb --- Namespace StandardClasses Public Class LazyEmployee Private m_name As String Private m_parentname As String Private m_parent As LazyEmployee Private m_children As ArrayList Private m_teamname As String Public Property Name() As String Get Return m_name End Get Set(ByVal Value As String) m_name = Value End Set End Property Public Property ReportsTo() As LazyEmployee Get Return m_parent End Get Set(ByVal Value As LazyEmployee) If Not Value Is Nothing Then m_parent = Value m_parentname = Value.Name End If End Set End Property Public Property ReportsToName() As String Get If m_parent Is Nothing Then Return m_parentname Else Return (m_parent.Name) End If End Get Set(ByVal Value As String) m_parentname = Value 'Clear the parent object if the name is cleared If m_parentname = Nothing OrElse m_parentname = String.Empty Then m_parent = Nothing End If End Set End Property Public Property Workers() As ArrayList Get Return m_children End Get Set(ByVal Value As ArrayList) m_children = Value End Set End Property Public Sub New() MyBase.New() m_children = New ArrayList End Sub End Class End Namespace |
Update of /cvsroot/jcframework/dotnet/Nunit/Interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Nunit/Interfaces Added Files: EmployeeInterfaceTests.vb IEmployee.vb IOptimistic.vb ManyToManyClasses.vb ManyToManyTests.vb TimestampTests.vb ValidatedEmployee.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository --- NEW FILE: ValidatedEmployee.vb --- Namespace Interfaces Public Class ValidatedEmployee Inherits EmployeeClass Implements AtomsFramework.IValidation Private _allowValidation As Boolean Public Property AllowValidation() As Boolean Get Return _allowvalidation End Get Set(ByVal Value As Boolean) _allowvalidation = Value End Set End Property Public Function IsValid() As Boolean Implements AtomsFramework.IValidation.IsValid Return _allowValidation End Function Public Function IsValidToDelete() As Boolean Implements AtomsFramework.IValidation.IsValidToDelete Return _allowValidation End Function End Class End Namespace --- NEW FILE: ManyToManyClasses.vb --- Imports AtomsFramework Namespace Interfaces #Region "Interface Definitions" Public Interface iM2MA Property GUIDValue() As String Property Description() As String Property M2MBCollection() As M2MBCollection End Interface Public Interface iM2MB Property GUIDValue() As String Property Description() As String Property M2MACollection() As M2MACollection End Interface #End Region #Region "Realizations" Public Class M2MA Implements iM2MA Private _guid As Guid = Guid.NewGuid Private _description As String Private _bCol As M2MBCollection Public Property Description() As String Implements iM2MA.Description Get Return _description End Get Set(ByVal Value As String) _description = Value End Set End Property Public Property M2MBCollection() As M2MBCollection Implements iM2MA.M2MBCollection Get Return _bCol End Get Set(ByVal Value As M2MBCollection) _bCol = Value End Set End Property Public Sub New() _bCol = New M2MBCollection End Sub Public Property GUIDValue() As String Implements iM2MA.GUIDValue Get If _guid.Equals(Guid.Empty) Then _guid = Guid.NewGuid End If Return _guid.ToString("N") End Get Set(ByVal value As String) _guid = New Guid(value) End Set End Property End Class Public Class M2MB Implements iM2MB Private _guid As Guid = Guid.NewGuid Private _description As String Private _aCol As M2MACollection Public Property Description() As String Implements iM2MB.Description Get Return _description End Get Set(ByVal Value As String) _description = Value End Set End Property Public Property M2MACollection() As M2MACollection Implements iM2MB.M2MaCollection Get Return _aCol End Get Set(ByVal Value As M2MACollection) _aCol = Value End Set End Property Public Property GUIDValue() As String Implements iM2MB.GUIDValue Get If _guid.Equals(Guid.Empty) Then _guid = Guid.NewGuid End If Return _guid.ToString("N") End Get Set(ByVal value As String) _guid = New Guid(value) End Set End Property Public Sub New() _aCol = New M2MACollection End Sub End Class #End Region #Region "M2MACollection" Public Class M2MACollection Inherits CollectionBase Public Overloads Sub Add(ByVal a As iM2MA) list.Add(a) End Sub Public Shadows Function Item(ByVal index As Integer) As iM2MA Return CType(list(index), iM2MA) End Function End Class #End Region #Region "M2MBCollection" Public Class M2MBCollection Inherits CollectionBase Public Overloads Sub Add(ByVal b As iM2MB) list.Add(b) End Sub Public Shadows Function Item(ByVal index As Integer) As iM2MB Return CType(list(index), M2MB) End Function End Class #End Region #Region "Interface Factories" Public Class M2MAFactory Implements AtomsFramework.IClassFactory Public Function CreateObject() As Object Implements AtomsFramework.IClassFactory.CreateObject Return New M2MA End Function End Class Public Class M2MBFactory Implements AtomsFramework.IClassFactory Public Function CreateObject() As Object Implements AtomsFramework.IClassFactory.CreateObject Return New M2MB End Function End Class #End Region End Namespace --- NEW FILE: IOptimistic.vb --- Namespace Interfaces Public Interface IOptimistic Property GuidValue() As String Property Description() As String Property CreatedDate() As Date Property ModifiedDate() As Date End Interface Public Class COptimistic Implements IOptimistic Private m_guid As Guid = Guid.Empty Private m_description As String Private m_created As Date Private m_modified As Date Public Property Description() As String Implements IOptimistic.Description Get Return m_description End Get Set(ByVal Value As String) If Not String.Equals(m_description, Value) Then m_description = Value m_modified = Now End If End Set End Property Public Property GuidValue() As String Implements IOptimistic.GuidValue Get If m_guid.Equals(Guid.Empty) Then m_guid = Guid.NewGuid End If Return m_guid.ToString("N") End Get Set(ByVal value As String) m_guid = New Guid(value) End Set End Property Public Property CreatedDate() As Date Implements IOptimistic.CreatedDate Get Return m_created End Get Set(ByVal Value As Date) m_created = Value End Set End Property Public Property ModifiedDate() As Date Implements IOptimistic.ModifiedDate Get Return m_modified End Get Set(ByVal Value As Date) m_modified = Value End Set End Property Public Sub New() m_created = Now End Sub End Class Public Class IOptimisticFactory Implements AtomsFramework.IClassFactory Public Function CreateObject() As Object Implements AtomsFramework.IClassFactory.CreateObject Return New COptimistic End Function End Class End Namespace --- NEW FILE: TimestampTests.vb --- Imports AtomsFramework Imports NUnit.Framework Namespace Interfaces <TestFixture()> Public Class TimestampTests Private pbroker As PersistenceBroker Private opt As IOptimistic <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory Dim retry As Boolean = True While retry = True Try 'Remove any existing test database System.IO.File.Delete(".\db1.mdb") retry = False Catch iox As IO.IOException 'file is in use - so we will loop around until it is released Catch ex As Exception retry = False End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") pbroker = New PersistenceBroker pbroker.init() End Sub <TestFixtureTearDown()> Public Sub Dispose() pbroker.Dispose() pbroker = Nothing End Sub <SetUp()> Public Sub TestInit() opt = New COptimistic End Sub <Test()> Public Sub SaveAndModify() Dim gVal As String gVal = opt.GuidValue pbroker.GetObject(opt) opt.Description = "a" pbroker.PersistChanges(opt) pbroker.ClearCache() opt = New COptimistic opt.GuidValue = gVal pbroker.GetObject(opt) Assert.AreEqual("a", opt.Description) opt.Description = "b" pbroker.PersistChanges(opt) End Sub End Class End Namespace --- NEW FILE: ManyToManyTests.vb --- Imports AtomsFramework Imports NUnit.Framework Namespace Interfaces <TestFixture()> Public Class ManyToManyTests Private pbroker As PersistenceBroker Private A As iM2MA Private B As iM2MB <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory Dim retry As Boolean = True While retry = True Try 'Remove any existing test database System.IO.File.Delete(".\db1.mdb") retry = False Catch iox As IO.IOException 'file is in use - so we will loop around until it is released GC.Collect() Catch ex As Exception retry = False End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") pbroker = New PersistenceBroker pbroker.init() End Sub <TestFixtureTearDown()> Public Sub Dispose() pbroker.Dispose() pbroker = Nothing End Sub <Test()> Public Sub SaveThenRetrieve() Dim gval As String Dim x As Integer, y As Integer A = New M2MA pbroker.GetObject(A) A.Description = "A-one" gval = A.GUIDValue B = New M2MB B.Description = "B-one" A.M2MBCollection.Add(B) B.M2MACollection.Add(A) Dim B2 As iM2MB = New M2MB B2.Description = "B-two" A.M2MBCollection.Add(B2) Dim A2 As iM2MA = New M2MA A2.Description = "A-two" B2.M2MACollection.Add(A2) pbroker.PersistChanges() pbroker.ClearCache() A = New M2MA A.GUIDValue = gval pbroker.GetObject(A) Assert.AreEqual(2, A.M2MBCollection.Count) 'Order of guids can affect order of the collection If A.M2MBCollection.Item(0).M2MACollection.Count = 1 Then x = 0 y = 1 Else x = 1 y = 0 End If B = A.M2MBCollection.Item(x) Assert.IsNotNull(B) Assert.AreEqual("B-one", B.Description) Assert.AreEqual(1, B.M2MACollection.Count) Assert.AreEqual(A.GUIDValue, B.M2MACollection.Item(0).GUIDValue) B = A.M2MBCollection.Item(y) Assert.IsNotNull(B) Assert.AreEqual("B-two", B.Description) Assert.AreEqual(2, B.M2MACollection.Count) End Sub <Test()> Public Sub SaveThenDelete() Dim gval As String Dim x As Integer, y As Integer A = New M2MA pbroker.GetObject(A) A.Description = "A1" gval = A.GUIDValue B = New M2MB B.Description = "B1" A.M2MBCollection.Add(B) B.M2MACollection.Add(A) Dim B2 As M2MB = New M2MB B2.Description = "B2" A.M2MBCollection.Add(B2) B2.M2MACollection.Add(A) Dim A2 As M2MA = New M2MA A2.Description = "A2" B2.M2MACollection.Add(A2) pbroker.PersistChanges() pbroker.ClearCache() A = New M2MA A.GUIDValue = gval pbroker.GetObject(A) Assert.AreEqual(2, A.M2MBCollection.Count) 'Order of guids can affect order of the collection If A.M2MBCollection.Item(0).M2MACollection.Count = 1 Then x = 0 y = 1 Else x = 1 y = 0 End If B = A.M2MBCollection.Item(x) Assert.IsNotNull(B) Assert.AreEqual("B1", B.Description) Assert.AreEqual(1, B.M2MACollection.Count) Assert.AreEqual(A.GUIDValue, B.M2MACollection.Item(0).GUIDValue) B = A.M2MBCollection.Item(y) Assert.IsNotNull(B) Assert.AreEqual("B2", B.Description) Assert.AreEqual(2, B.M2MACollection.Count) 'Now delete B2 - because of autodelete, allobjects should be deleted pbroker.MarkForDeletion(B) pbroker.PersistChanges() A = New M2MA A.GUIDValue = gval pbroker.GetObject(A) Assert.IsFalse(pbroker.getInjectedObject(A).Persistent, "Object A is still persistent") End Sub <Test()> Public Sub SaveThenChangeKeyValues() Dim gvalA, gvalB As String Dim s As String A = New M2MA pbroker.GetObject(A) A.Description = "A1" gvalA = A.GUIDValue B = New M2MB B.Description = "B1" gvalB = B.GUIDValue A.M2MBCollection.Add(B) B.M2MACollection.Add(A) pbroker.PersistChanges() A.GUIDValue = Guid.NewGuid.ToString("N") pbroker.PersistChanges(A) s = "select * from ManyToManyAB where AGuidValue = """ & gvalA & """ and BGuidValue = """ & gvalB & """" Dim c As ResultCursor = pbroker.ProcessPureSql(s, pbroker.GetClassMap(GetType(NunitTests.Interfaces.iM2MA)).RelationalDatabase.GetConnection) Assert.AreEqual(0, c.ResultSet.ResultSet.Tables(0).Rows.Count) End Sub <Test()> Public Sub RemoveFromCollection() Dim gvalA, gvalB As String Dim s As String A = New M2MA pbroker.GetObject(A) A.Description = "A1" gvalA = A.GUIDValue B = New M2MB B.Description = "B1" gvalB = B.GUIDValue A.M2MBCollection.Add(B) B.M2MACollection.Add(A) pbroker.PersistChanges() pbroker.ClearCache() A = New M2MA A.GUIDValue = gvalA pbroker.GetObject(A) Assert.IsTrue(pbroker.getInjectedObject(A).Persistent) 'Being bi-directional this should result in both A/B objects having empty collections A.M2MBCollection.RemoveAt(0) pbroker.PersistChanges(A) pbroker.ClearCache() A = New M2MA A.GUIDValue = gvalA pbroker.GetObject(A) B = New M2MB B.GUIDValue = gvalB pbroker.GetObject(B) Assert.IsTrue(pbroker.getInjectedObject(A).Persistent) Assert.IsTrue(pbroker.getInjectedObject(B).Persistent) Assert.AreEqual(0, A.M2MBCollection.Count) Assert.AreEqual(0, B.M2MACollection.Count) End Sub End Class End Namespace --- NEW FILE: EmployeeInterfaceTests.vb --- Imports AtomsFramework Imports NUnit.Framework Namespace Interfaces <TestFixture()> Public Class EmployeeInterfaceTests Private pbroker As PersistenceBroker Private emp As IEmployee Private eventcount As Integer = 0 <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory Dim retry As Boolean = True While retry = True Try 'Remove any existing test database System.IO.File.Delete(".\db1.mdb") retry = False Catch iox As IO.IOException 'file is in use - so we will loop around until it is released Catch ex As Exception retry = False End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") pbroker = New PersistenceBroker pbroker.init() End Sub <TestFixtureTearDown()> Public Sub Dispose() pbroker.Dispose() pbroker = Nothing End Sub <SetUp()> Public Sub TestInit() emp = New EmployeeClass End Sub <Test()> Public Sub LoadEmployee_a() emp.Name = "a" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.AreEqual(emp.Workers.Count, 0) Assert.IsTrue(Not emp.ReportsTo Is Nothing) Assert.AreEqual(emp.ReportsTo.Name, "c") Dim emp2 As IEmployee emp2 = CType(emp.ReportsTo.Workers(0), IEmployee) Assert.AreEqual(emp2.Name, emp.Name) Assert.AreSame(emp2, emp) End Sub <Test()> Public Sub LoadEmployee_ac() emp.Name = "ac" pbroker.FindObject(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.AreEqual(emp.Workers.Count, 3) emp = CType(emp.Workers.Item(1), IEmployee) Assert.AreEqual(emp.Name, "aa") Assert.AreEqual(emp.ReportsTo.Name, "ac") End Sub <Test()> Public Sub CheckSchemaBasedProperties() emp.Name = "ac" pbroker.FindObject(emp) Assert.AreEqual(50, pbroker.getInjectedObject(emp).getFieldLengthByName("Name")) Assert.IsTrue(pbroker.getInjectedObject(emp).getFieldTypeByName("Name") Is GetType([String])) End Sub <Test()> Public Sub SaveInvalidEmployee() Dim emp2 As ValidatedEmployee emp2 = New ValidatedEmployee emp2.AllowValidation = False emp = emp2 emp.Name = "invalid" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) Try pbroker.PersistChanges(emp) Assert.Fail("Didn't throw the exception") Catch End Try Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) Assert.IsTrue(emp.ReportsTo Is Nothing) End Sub <Test()> Public Sub SaveValidEmployee() Dim emp2 As ValidatedEmployee emp2 = New ValidatedEmployee emp2.AllowValidation = True emp = emp2 emp.Name = "valid" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) pbroker.PersistChanges(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent) Assert.IsTrue(emp.ReportsTo Is Nothing) End Sub <Test()> Public Sub SaveAndDeleteValidEmp1() Dim emp2 As ValidatedEmployee emp2 = New ValidatedEmployee emp2.AllowValidation = True emp2.Name = "validCheck" pbroker.FindObject(emp2) Assert.IsFalse(pbroker.getInjectedObject(emp2).Persistent) pbroker.PersistChanges(emp2) emp2.AllowValidation = False pbroker.MarkForDeletion(emp2) Try pbroker.PersistChanges() Assert.Fail("Didn't throw an exception") Catch End Try pbroker.ClearCache() emp2 = New ValidatedEmployee emp2.Name = "validCheck" pbroker.GetObject(emp2) Assert.IsTrue(pbroker.getInjectedObject(emp2).Persistent) End Sub <Test()> Public Sub SaveThenSaveWithoutRetrieve() Dim oidvalue As String emp.Name = "SaveThisEmp" pbroker.FindObject(emp) Assert.IsFalse(pbroker.getInjectedObject(emp).Persistent) pbroker.PersistChanges(emp) emp = New EmployeeClass emp.Name = "SaveThisEmp" 'Should update record, not try to insert pbroker.PersistChanges(emp) Assert.IsTrue(pbroker.getInjectedObject(emp).Persistent, "persistent check failed") End Sub '<Test(), Ignore("Not yet ready")> Public Sub CheckEvents() ' AddHandler emp.NameChanged, AddressOf NameChanged ' eventcount = 0 ' emp.Name = "Events" ' Assert.AreEqual(1, eventcount) ' pbroker.FindObject(emp) ' pbroker.PersistChanges(emp) ' emp = New EmployeeClass ' emp.Name = "Events" ' pbroker.FindObject(emp) ' 'Should not have any events from the previous handler still firing ' eventcount = 0 ' emp.Name = "New Name 1" ' Assert.AreEqual(0, eventcount) ' AddHandler emp.NameChanged, AddressOf NameChanged ' emp.Name = "New Name 2" ' Assert.AreEqual(1, eventcount) 'End Sub '<Test(), Ignore("Not yet ready")> Public Sub CheckEvents2() ' AddHandler emp.NameChanged, AddressOf NameChanged ' eventcount = 0 ' emp.Name = "Events2" ' Assert.AreEqual(1, eventcount) ' pbroker.FindObject(emp) ' pbroker.PersistChanges(emp) ' emp = New EmployeeClass ' eventcount = 0 ' AddHandler emp.NameChanged, AddressOf NameChanged ' emp.Name = "Events2" ' Assert.AreEqual(1, eventcount) ' 'Should retain the event handlers ' pbroker.FindObject(emp) ' emp.Name = "Events2a" ' Assert.AreEqual(2, eventcount) 'End Sub '<Test(), Ignore("Not yet ready")> Public Sub CheckEvents3() ' AddHandler emp.NameChanged, AddressOf NameChanged ' eventcount = 0 ' emp.Name = "Events3" ' Assert.AreEqual(1, eventcount) ' pbroker.FindObject(emp) ' pbroker.PersistChanges(emp) ' pbroker.ClearCache() ' emp = New EmployeeClass ' eventcount = 0 ' AddHandler emp.NameChanged, AddressOf NameChanged ' emp.Name = "Events3" ' Assert.AreEqual(1, eventcount) ' 'Event should fire when property is set during retrieve ' pbroker.FindObject(emp) ' Assert.AreEqual(2, eventcount) ' 'Check event is still wired up after find completes ' emp.Name = "Events3a" ' Assert.AreEqual(3, eventcount) 'End Sub '<Test(), Ignore("Not yet ready")> Public Sub CheckEvents4() ' AddHandler emp.NameChanged, AddressOf NameChanged ' eventcount = 0 ' emp.Name = "Events4" ' Assert.AreEqual(1, eventcount) ' pbroker.FindObject(emp) ' pbroker.PersistChanges(emp) ' emp = New EmployeeClass ' emp.Name = "Events4" ' pbroker.FindObject(emp) ' 'Should not have any events from the previous handler still firing ' eventcount = 0 ' emp.Name = "Events4a" ' Assert.AreEqual(0, eventcount) ' AddHandler emp.NameChanged, AddressOf NameChanged ' emp.Name = "Events4b" ' Assert.AreEqual(1, eventcount) 'End Sub 'Private Sub NameChanged(ByVal sender As Object, ByVal e As System.EventArgs) ' eventcount += 1 'End Sub <Test()> Public Sub CacheTest() 'Check that local object changes don't impact the cache emp.Name = "Initial2" pbroker.FindObject(emp) pbroker.PersistChanges(emp) pbroker.ClearCache() emp = New EmployeeClass emp.Name = "Initial2" pbroker.FindObject(emp) 'Change local copy emp.Name = "Final" emp = New EmployeeClass emp.Name = "Initial2" pbroker.FindObject(emp) Assert.AreEqual("Initial2", emp.Name) End Sub End Class End Namespace --- NEW FILE: IEmployee.vb --- Namespace Interfaces Public Interface IEmployee Property Name() As String Property ReportsTo() As IEmployee Property ReportsToName() As String Property Workers() As ArrayList Property Team() As InheritedClasses.CTeam Property TeamName() As String Event NameChanged As EventHandler End Interface Public Class EmployeeClass Implements IEmployee Private m_name As String Private m_parentName As String Private m_parent As IEmployee Private m_children As ArrayList Private m_team As InheritedClasses.CTeam Private m_teamName As String Public Event NameChanged As EventHandler Implements IEmployee.NameChanged Public Property Name() As String Implements IEmployee.Name Get Return m_name End Get Set(ByVal Value As String) m_name = Value RaiseEvent NameChanged(Me, New System.EventArgs) End Set End Property Public Property ReportsTo() As IEmployee Implements IEmployee.ReportsTo Get Return m_parent End Get Set(ByVal Value As IEmployee) If Not Value Is Nothing Then m_parent = Value m_parentName = Value.Name End If End Set End Property Public Property ReportsToName() As String Implements IEmployee.ReportsToName Get If m_parent Is Nothing Then Return m_parentName Else Return (m_parent.Name) End If End Get Set(ByVal Value As String) m_parentName = Value End Set End Property Public Property Workers() As ArrayList Implements IEmployee.Workers Get Return m_children End Get Set(ByVal Value As ArrayList) m_children = Value End Set End Property Public Property Team() As InheritedClasses.CTeam Implements IEmployee.Team Get Return m_team End Get Set(ByVal Value As InheritedClasses.CTeam) If Not Value Is Nothing Then m_team = Value m_teamName = Value.OIDValue End If End Set End Property Public Property TeamName() As String Implements IEmployee.TeamName Get If m_team Is Nothing Then Return m_teamName Else Return (m_team.OIDValue) End If End Get Set(ByVal Value As String) m_teamName = Value End Set End Property Public Sub New() MyBase.New() m_children = New ArrayList End Sub End Class Public Class IEmployeeFactory Implements AtomsFramework.IClassFactory Public Function CreateObject() As Object Implements AtomsFramework.IClassFactory.CreateObject Return New EmployeeClass End Function End Class End Namespace |
From: Richard B. <rb...@us...> - 2005-04-11 00:32:14
|
Update of /cvsroot/jcframework/dotnet/FxCop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/FxCop Added Files: AtomsFramework.FxCop Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository --- NEW FILE: AtomsFramework.FxCop --- (This appears to be a binary file; contents omitted.) |