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: Dan M. <dan...@us...> - 2005-07-10 11:35:52
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6561/dotnet Modified Files: AtomsFramework.xml CClassMap.vb CInjectedObject.vb CInjectedObjects.vb CJoin.vb CMultiRetrieveCriteria.vb CMultiSummaryCriteria.vb CPersistenceBroker.vb CPersistentCriteria.vb CSelectInCriteria.vb Log Message: Add support for standard classes super classes. Add new NUnit test to test standard classes super classes. Index: CMultiSummaryCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMultiSummaryCriteria.vb,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CMultiSummaryCriteria.vb 24 May 2005 07:43:42 -0000 1.20 +++ CMultiSummaryCriteria.vb 10 Jul 2005 11:35:39 -0000 1.21 @@ -35,7 +35,7 @@ Private m_fieldsForSum As Collection Private m_methodsForSum As Collection Private m_aliasForSum As Collection - Private m_joins As Join + 'Private m_joins As Join '''----------------------------------------------------------------------------- ''' Project : AtomsFramework Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- CPersistenceBroker.vb 25 May 2005 01:26:11 -0000 1.112 +++ CPersistenceBroker.vb 10 Jul 2005 11:35:39 -0000 1.113 @@ -299,7 +299,7 @@ 'each entry will store the class map and the sql alias for the map 'Dim rMaps As New HybridDictionary Dim mapName As String - Dim cm2 As ClassMap, cm3 As ClassMap + Dim cm2 As ClassMap, cm3 As ClassMap, cm4 As ClassMap Dim classMapCount As Integer = 0 Dim udamap As AssociationMap Dim joins As Join @@ -445,66 +445,28 @@ 'Now process associations For i = 0 To rs.ResultSet.Tables(0).Rows.Count - 1 classMapCount = j - For Each de In cm.AssociationMaps - udamap = de.Value - If udamap.RetrieveAutomatic Then - mapName = "t" & classMapCount.ToString - classMapCount += 1 - cm2 = udamap.ToClass - 'Only process one-to-one relationships on the first record retrieved - If udamap.CardinalityType = AssociationMap.Cardinality.OneToOne And i = 0 Then - gotValue = False - classMapCount += Me.GetChildCountForMultipleInheritance(udamap.ToClass) - 1 - targetobj = obj.GetObjectByAttribute(udamap.FromClassTarget) - If Not targetobj Is Nothing Then - 'if the class as child classes then check if the targetobj is of type child - If cm2.ChildrenMaps.Count > 0 Then - cm3 = targetobj.GetClassMap() - cm2.PopulateObject(cm3, targetobj, rs, joins.GetClassMapTableAlias(cm3)) - Else - cm2.PopulateObject(cm2, targetobj, rs, mapName) - End If - If targetobj.Persistent Then - If Not targetobj.IsIPersistentObject Then - targetobj = LocateOrCacheInjObject(targetobj, True, True) - Else - tmpObj = m_cache.Item(targetobj) - End If - If Not (tmpObj Is Nothing) Then - targetobj = tmpObj - Try - PCCacheHits.Increment() - Catch - End Try - Else - ' All objects are loaded to the cache regardless of applications cache usage - m_cache.Add(targetobj) - Try - PCCacheSize.RawValue = m_cache.Count - Catch - End Try - End If - obj.SetAttributeValue(udamap.FromClassTarget, targetobj.GetSourceObject) - If Not targetobj.AssociationsLoaded Then - If udamap.LazyLoad Then - targetobj.IsDirty = False - targetobj.IsProxy = True - targetobj.AssociationsLoaded = True - Else - RetrievePrivateObject(targetobj, conn, False, False) - End If + cm4 = cm + Do + For Each de In cm4.AssociationMaps + udamap = de.Value + If udamap.RetrieveAutomatic Then + mapName = "t" & classMapCount.ToString + classMapCount += 1 + cm2 = udamap.ToClass + 'Only process one-to-one relationships on the first record retrieved + If udamap.CardinalityType = AssociationMap.Cardinality.OneToOne And i = 0 Then + gotValue = False + classMapCount += Me.GetChildCountForMultipleInheritance(udamap.ToClass) - 1 + targetobj = obj.GetObjectByAttribute(udamap.FromClassTarget) + If Not targetobj Is Nothing Then + 'if the class as child classes then check if the targetobj is of type child + If cm2.ChildrenMaps.Count > 0 Then + cm3 = targetobj.GetClassMap() + cm2.PopulateObject(cm3, targetobj, rs, joins.GetClassMapTableAlias(cm3)) Else - targetobj.IsDirty = False - targetobj.OriginalCacheKey = New CacheKey(targetobj) + cm2.PopulateObject(cm2, targetobj, rs, mapName) End If - gotValue = True - End If - End If - If Not gotValue Then - 'Check whether the object is of child type - If udamap.ToClass.ChildrenMaps.Count > 0 Then - targetobj = Me.CreateTargetObjectForMultipleInheritance(udamap.ToClass, obj.GetObjectType, obj.GetObjectType.Namespace, rs.ResultSet.Tables(0).Rows(i), joins, conn) - If Not targetobj Is Nothing AndAlso targetobj.Persistent Then + If targetobj.Persistent Then If Not targetobj.IsIPersistentObject Then targetobj = LocateOrCacheInjObject(targetobj, True, True) Else @@ -524,6 +486,7 @@ Catch End Try End If + obj.SetAttributeValue(udamap.FromClassTarget, targetobj.GetSourceObject) If Not targetobj.AssociationsLoaded Then If udamap.LazyLoad Then targetobj.IsDirty = False @@ -536,15 +499,14 @@ targetobj.IsDirty = False targetobj.OriginalCacheKey = New CacheKey(targetobj) End If - obj.SetAttributeValue(udamap.FromClassTarget, targetobj.GetSourceObject) + gotValue = True End If - Else - 'Object doesn't exist - let's create it - 'See if the assembly path is specified - targetobj = udamap.ToClass.CreateObjectInstance - If Not targetobj Is Nothing Then - cm2.PopulateObject(cm2, targetobj, rs, mapName) - If targetobj.Persistent Then + End If + If Not gotValue Then + 'Check whether the object is of child type + If udamap.ToClass.ChildrenMaps.Count > 0 Then + targetobj = Me.CreateTargetObjectForMultipleInheritance(udamap.ToClass, obj.GetObjectType, obj.GetObjectType.Namespace, rs.ResultSet.Tables(0).Rows(i), joins, conn) + If Not targetobj Is Nothing AndAlso targetobj.Persistent Then If Not targetobj.IsIPersistentObject Then targetobj = LocateOrCacheInjObject(targetobj, True, True) Else @@ -578,163 +540,206 @@ End If obj.SetAttributeValue(udamap.FromClassTarget, targetobj.GetSourceObject) End If + Else + 'Object doesn't exist - let's create it + 'See if the assembly path is specified + targetobj = udamap.ToClass.CreateObjectInstance + If Not targetobj Is Nothing Then + cm2.PopulateObject(cm2, targetobj, rs, mapName) + If targetobj.Persistent Then + If Not targetobj.IsIPersistentObject Then + targetobj = LocateOrCacheInjObject(targetobj, True, True) + Else + tmpObj = m_cache.Item(targetobj) + End If + If Not (tmpObj Is Nothing) Then + targetobj = tmpObj + Try + PCCacheHits.Increment() + Catch + End Try + Else + ' All objects are loaded to the cache regardless of applications cache usage + m_cache.Add(targetobj) + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try + End If + If Not targetobj.AssociationsLoaded Then + If udamap.LazyLoad Then + targetobj.IsDirty = False + targetobj.IsProxy = True + targetobj.AssociationsLoaded = True + Else + RetrievePrivateObject(targetobj, conn, False, False) + End If + Else + targetobj.IsDirty = False + targetobj.OriginalCacheKey = New CacheKey(targetobj) + End If + obj.SetAttributeValue(udamap.FromClassTarget, targetobj.GetSourceObject) + End If + End If End If End If - End If - ElseIf udamap.CardinalityType = AssociationMap.Cardinality.OneToMany Or udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany Then - If udamap.CardinalityType = AssociationMap.Cardinality.OneToMany Then - col = obj.GetCollectionByAttribute(udamap.FromClassTarget) - 'fromClass = udamap.FromClass - toClass = udamap.ToClass - Else - If obj.GetClassMap.Name = udamap.FromClass.Name Then + ElseIf udamap.CardinalityType = AssociationMap.Cardinality.OneToMany Or udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany Then + If udamap.CardinalityType = AssociationMap.Cardinality.OneToMany Then col = obj.GetCollectionByAttribute(udamap.FromClassTarget) 'fromClass = udamap.FromClass toClass = udamap.ToClass Else - col = obj.GetCollectionByAttribute(udamap.ToClassTarget) - toClass = udamap.FromClass - 'fromClass = udamap.ToClass - End If - End If - 'When retrieving we need to make sure the collection is cleared before - 'we go an load objects. - ' Under normal circumstances this will be the case, however when the - 'collection is in a many-to-many associations it is possible for - 'one side to be cleared, but for the other object to still - 'have the reference in place. (see the unit tests for an example) - If i = 0 Then - 'Obviously we don't want to clear it each time through ;-) - col.Clear() - End If - - 'Check whether the object is of child type - If toClass.ChildrenMaps.Count > 0 Then - targetobj = Me.CreateTargetObjectForMultipleInheritance(toClass, obj.GetObjectType, obj.GetObjectType.Namespace, rs.ResultSet.Tables(0).Rows(i), joins, conn) - 'update classMapCount with the child count number - classMapCount += Me.GetChildCountForMultipleInheritance(toClass) - classMapCount -= 1 'This is because we added one in the beginning of the for loop - If Not targetobj Is Nothing AndAlso targetobj.Persistent Then - If Not targetobj.IsIPersistentObject Then - targetobj = LocateOrCacheInjObject(targetobj, True, True) - Else - tmpObj = m_cache.Item(targetobj) - End If - If Not (tmpObj Is Nothing) Then - targetobj = tmpObj - Try - PCCacheHits.Increment() - Catch - End Try + If obj.GetClassMap.Name = udamap.FromClass.Name Then + col = obj.GetCollectionByAttribute(udamap.FromClassTarget) + 'fromClass = udamap.FromClass + toClass = udamap.ToClass Else - ' All objects are loaded to the cache regardless of applications cache usage - m_cache.Add(targetobj) - Try - PCCacheSize.RawValue = m_cache.Count - Catch - End Try + col = obj.GetCollectionByAttribute(udamap.ToClassTarget) + toClass = udamap.FromClass + 'fromClass = udamap.ToClass End If + End If + 'When retrieving we need to make sure the collection is cleared before + 'we go an load objects. + ' Under normal circumstances this will be the case, however when the + 'collection is in a many-to-many associations it is possible for + 'one side to be cleared, but for the other object to still + 'have the reference in place. (see the unit tests for an example) + If i = 0 Then + 'Obviously we don't want to clear it each time through ;-) + col.Clear() + End If - 'Need to determine if new object is already in the collection - '(prevents duplicates when multiple one-to-many associations exist) - gotValue = False - For Each tmpColObj As Object In col - If tmpColObj.GetType.IsSubclassOf(GetType(PersistentObject)) Then - tmpObj = tmpColObj + 'Check whether the object is of child type + If toClass.ChildrenMaps.Count > 0 Then + targetobj = Me.CreateTargetObjectForMultipleInheritance(toClass, obj.GetObjectType, obj.GetObjectType.Namespace, rs.ResultSet.Tables(0).Rows(i), joins, conn) + 'update classMapCount with the child count number + classMapCount += Me.GetChildCountForMultipleInheritance(toClass) + classMapCount -= 1 'This is because we added one in the beginning of the for loop + If Not targetobj Is Nothing AndAlso targetobj.Persistent Then + If Not targetobj.IsIPersistentObject Then + targetobj = LocateOrCacheInjObject(targetobj, True, True) + tmpObj = Nothing Else - tmpObj = GetInjectedObject(tmpColObj) + tmpObj = m_cache.Item(targetobj) End If - If tmpObj.Equals(targetobj) Then - gotValue = True + If Not (tmpObj Is Nothing) Then + targetobj = tmpObj + Try + PCCacheHits.Increment() + Catch + End Try + Else + ' All objects are loaded to the cache regardless of applications cache usage + m_cache.Add(targetobj) + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If - Next - If Not gotValue Then - If Not targetobj.AssociationsLoaded Then - If udamap.LazyLoad Then - targetobj.IsDirty = False - targetobj.IsProxy = True - targetobj.AssociationsLoaded = True + 'Need to determine if new object is already in the collection + '(prevents duplicates when multiple one-to-many associations exist) + gotValue = False + For Each tmpColObj As Object In col + If tmpColObj.GetType.IsSubclassOf(GetType(PersistentObject)) Then + tmpObj = tmpColObj Else - RetrievePrivateObject(targetobj, conn, False, False) + tmpObj = GetInjectedObject(tmpColObj) + End If + If tmpObj.Equals(targetobj) Then + gotValue = True + End If + Next + + If Not gotValue Then + If Not targetobj.AssociationsLoaded Then + If udamap.LazyLoad Then + targetobj.IsDirty = False + targetobj.IsProxy = True + targetobj.AssociationsLoaded = True + Else + RetrievePrivateObject(targetobj, conn, False, False) + End If + Else + targetobj.IsDirty = False + targetobj.OriginalCacheKey = New CacheKey(targetobj) + End If + If targetobj.AssociationsLoaded Then + col.Add(targetobj.GetSourceObject) End If - Else - targetobj.IsDirty = False - targetobj.OriginalCacheKey = New CacheKey(targetobj) - End If - If targetobj.AssociationsLoaded Then - col.Add(targetobj.GetSourceObject) End If End If - End If - Else - targetobj = toClass.CreateObjectInstance - row = rs.ResultSet.Tables(0).Rows(i) - toClass.PopulateObject(toClass, targetobj, row, mapName) - If targetobj.Persistent Then - If Not targetobj.IsIPersistentObject Then - 'For injected objects we want to work with just one version - 'By not checking the persistent cache we can ensure this, and - 'we will also be keeping the persistent cache updated - targetobj = LocateOrCacheInjObject(targetobj, True, True) - tmpObj = Nothing - Else - tmpObj = m_cache.Item(targetobj) - End If - If Not (tmpObj Is Nothing) Then - targetobj = tmpObj - Try - PCCacheHits.Increment() - Catch - End Try - Else - ' All objects are loaded to the cache regardless of applications cache usage - m_cache.Add(targetobj) - Try - PCCacheSize.RawValue = m_cache.Count - Catch - End Try - End If - 'Need to determine if new object is already in the collection - '(prevents duplicates when multiple one-to-many associations exist) - gotValue = False - For Each tmpColObj As Object In col - If tmpColObj.GetType.IsSubclassOf(GetType(PersistentObject)) Then - tmpObj = tmpColObj + Else + targetobj = toClass.CreateObjectInstance + row = rs.ResultSet.Tables(0).Rows(i) + toClass.PopulateObject(toClass, targetobj, row, mapName) + If targetobj.Persistent Then + If Not targetobj.IsIPersistentObject Then + 'For injected objects we want to work with just one version + 'By not checking the persistent cache we can ensure this, and + 'we will also be keeping the persistent cache updated + targetobj = LocateOrCacheInjObject(targetobj, True, True) + tmpObj = Nothing Else - tmpObj = GetInjectedObject(tmpColObj) + tmpObj = m_cache.Item(targetobj) End If - If tmpObj.Equals(targetobj) Then - gotValue = True + If Not (tmpObj Is Nothing) Then + targetobj = tmpObj + Try + PCCacheHits.Increment() + Catch + End Try + Else + ' All objects are loaded to the cache regardless of applications cache usage + m_cache.Add(targetobj) + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If - Next - If Not gotValue Then - If Not targetobj.AssociationsLoaded Then - If udamap.LazyLoad Then - targetobj.IsDirty = False - targetobj.IsProxy = True - targetobj.AssociationsLoaded = True + 'Need to determine if new object is already in the collection + '(prevents duplicates when multiple one-to-many associations exist) + gotValue = False + For Each tmpColObj As Object In col + If tmpColObj.GetType.IsSubclassOf(GetType(PersistentObject)) Then + tmpObj = tmpColObj Else - RetrievePrivateObject(targetobj, conn, False, False) + tmpObj = GetInjectedObject(tmpColObj) + End If + If tmpObj.Equals(targetobj) Then + gotValue = True + End If + Next + If Not gotValue Then + If Not targetobj.AssociationsLoaded Then + If udamap.LazyLoad Then + targetobj.IsDirty = False + targetobj.IsProxy = True + targetobj.AssociationsLoaded = True + Else + RetrievePrivateObject(targetobj, conn, False, False) + End If + Else + targetobj.IsDirty = False + targetobj.OriginalCacheKey = New CacheKey(targetobj) + End If + If targetobj.AssociationsLoaded Then + col.Add(targetobj.GetSourceObject) End If - Else - targetobj.IsDirty = False - targetobj.OriginalCacheKey = New CacheKey(targetobj) - End If - If targetobj.AssociationsLoaded Then - col.Add(targetobj.GetSourceObject) End If End If End If End If End If - End If - Next + Next + cm4 = cm4.SuperClass + Loop While Not cm4 Is Nothing Next - If Not cm.SuperClass Is Nothing Then - 'need to process associations for the parent as well - RetrieveAssociations(obj, conn, cm.SuperClass, useCache) - End If + 'If Not cm.SuperClass Is Nothing Then + ' 'need to process associations for the parent as well + ' RetrieveAssociations(obj, conn, cm.SuperClass, useCache) + 'End If obj.IsProxy = False If obj.Persistent Then obj.IsDirty = False 'Clear the dirty flag only if the object is persistent @@ -825,7 +830,8 @@ Next j If valuesSet Then If Not Value.IsIPersistentObject Then - anObjPers = LocateOrCacheInjObject(Value, True, True) + 'anObjPers = LocateOrCacheInjObject(Value, False, False) + anObjPers = m_injectedObjects.Find(Value) Else anObjPers = m_cache.Item(Value) End If @@ -3159,6 +3165,60 @@ ''' ----------------------------------------------------------------------------- ''' <summary> + ''' Returns all objects in the database of the same type. + ''' </summary> + ''' <param name="type">Object type to return</param> + ''' <returns>Arraylist. All objects of the same type</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [danmayer] 10/7/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- + Public Function GetAll(ByVal type As Type) As ArrayList + Return GetAll(type, False) + End Function + + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Returns all objects of the same type and their associated objects from the database. + ''' </summary> + ''' <param name="type">Object type to return</param> + ''' <param name="getAssociations">True - get all associated object.</param> + ''' <returns>Arraylist. All objects of the same type</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [danmayer] 10/7/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- + Public Function GetAll(ByVal type As Type, ByVal getAssociations As Boolean) As ArrayList + Dim injObj As InjectedObject + Dim col As ArrayList + Dim r As RetrieveCriteria + Dim c As ResultCursor + + r = New RetrieveCriteria + r.ReturnFullObjects = True + r.ClassMap = Me.GetClassMap(type) + c = r.Perform + col = New ArrayList + While c.HasElements And Not c.EOF + injObj = New InjectedObject(Activator.CreateInstance(type)) + c.LoadObject(injObj.ReferencedObject) + If getAssociations And Not injObj.AssociationsLoaded Then + 'Load the full object + injObj = Me.GetInjectedObject(injObj.ReferencedObject) + Me.RetrieveObject(injObj, False, False) + End If + col.Add(injObj) + c.NextCursor() + End While + Return col + End Function + + ''' ----------------------------------------------------------------------------- + ''' <summary> ''' Finds an object in the database using the Find attributes. ''' </summary> ''' <param name="obj">The object to be found.</param> @@ -3264,16 +3324,14 @@ If addToCache Then m_injectedObjects.Add(injObj) End If - Else - If replaceCachedValues And Not injObj.IsLoading Then - If TypeOf obj Is IPersistableObject Then - 'If the object is loading we will already be setting associations and values - redoing it can wipe out collections, etc - injObj.ReplaceValues(CType(obj, IPersistableObject).GetSourceObject, injObj.ReferencedObject, False) - injObj.AssociationsLoaded = False - Else - injObj.ReplaceValues(obj, injObj.ReferencedObject, False) - injObj.AssociationsLoaded = False - End If + ElseIf replaceCachedValues AndAlso Not injObj.IsLoading Then + If TypeOf obj Is IPersistableObject Then + 'If the object is loading we will already be setting associations and values - redoing it can wipe out collections, etc + injObj.ReplaceValues(CType(obj, IPersistableObject).GetSourceObject, injObj.ReferencedObject, False) + injObj.AssociationsLoaded = False + Else + injObj.ReplaceValues(obj, injObj.ReferencedObject, False) + injObj.AssociationsLoaded = False End If End If Return injObj Index: CMultiRetrieveCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMultiRetrieveCriteria.vb,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- CMultiRetrieveCriteria.vb 24 May 2005 07:43:42 -0000 1.23 +++ CMultiRetrieveCriteria.vb 10 Jul 2005 11:35:39 -0000 1.24 @@ -36,7 +36,7 @@ Private m_rows As Short Private m_Having As CriteriaCondition Private m_fullObjects As Boolean 'default is false, ie proxy objects only - Private m_joins As Join + 'Private m_joins As Join '''----------------------------------------------------------------------------- ''' <summary> @@ -143,7 +143,7 @@ Me.New() Me.AddObjectToJoin(obj, Nothing, "") Me.ClassMap = obj.GetClassMap(obj) - m_joins = New Join(obj.GetClassMap(obj), "t1") + 'm_joins = New Join(obj.GetClassMap(obj), "t1") End Sub ''' ----------------------------------------------------------------------------- @@ -165,7 +165,7 @@ injObj = broker.GetInjectedObject(obj) Me.AddObjectToJoin(injObj, Nothing, "") Me.ClassMap = broker.GetClassMap(obj.GetType) - m_joins = New Join(Me.ClassMap, "t1") + 'm_joins = New Join(Me.ClassMap, "t1") End Sub '''----------------------------------------------------------------------------- @@ -212,20 +212,29 @@ End While Exit Sub End If + + If m_fromCMaps.Count = 0 Then + Throw New RetrieveException("The From Object has not been added to the criteria yet") + End If + cm = fromObj.GetClassMap i = 0 'Used to track the index of the from object For Each cm2 In m_fromCMaps i += 1 If cm2.Name = cm.Name Then - bfound = True - Exit For + am = cm2.GetAssociationMapByName(assocName) + If Not am Is Nothing Then + 'bfound = True + Exit For + End If End If Next - If Not bfound Then - Throw New RetrieveException("The From Object has not been added to the criteria yet") - End If - am = cm2.GetAssociationMapByName(assocName) + 'If Not bfound Then + ' Throw New RetrieveException("The From Object has not been added to the criteria yet") + 'End If + + ' am = cm2.GetAssociationMapByName(assocName) If am Is Nothing Then Throw New NoAssociationException("Invalid association " & assocName & " selected - no such association exists") End If @@ -371,7 +380,7 @@ For Each cm In m_fromCMaps j += 1 mapName = "t" & j.ToString - ht.Add(cm.Name, mapName) + ht.Add(cm.ClassNamespace & "." & cm.Name, mapName) 'Load each individual column, and process in order of objects to join For i = 1 To cm.GetSize 'process attributes for either the whole object or proxy attributes only @@ -417,7 +426,7 @@ Else statement.AddSqlClause(" ") End If - statement.AddSqlClause(entry.AttributeMap.ColumnMap.GetAliasQualifiedName(ht(entry.ClassMap.Name))) + statement.AddSqlClause(entry.AttributeMap.ColumnMap.GetAliasQualifiedName(ht(entry.ClassMap.ClassNamespace & "." & entry.ClassMap.Name))) 'statement.addSqlClause(entry.AttributeMap.ColumnMap.getAliasQualifiedName("t1")) If entry.Ascend Then statement.AddSqlClause(" " & Me.ClassMap.RelationalDatabase.GetClauseStringAscend) @@ -521,11 +530,21 @@ Public Function GetObjectAlias(ByVal obj As IPersistableObject, ByVal offset As Integer) As String Dim i As Integer = 0 For Each o As DictionaryEntry In m_objectsToJoin - If o.Value.GetType Is obj.GetSourceObject.GetType Then - If i = offset Then - Return o.Key - Else - i += 1 + If TypeOf (o.Value) Is InjectedObject Then + If CType(o.Value, InjectedObject).ReferencedObject.GetType Is obj.GetSourceObject.GetType Then + If i = offset Then + Return o.Key + Else + i += 1 + End If + End If + Else + If o.Value.GetType Is obj.GetSourceObject.GetType Then + If i = offset Then + Return o.Key + Else + i += 1 + End If End If End If Next Index: CSelectInCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CSelectInCriteria.vb,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- CSelectInCriteria.vb 25 May 2005 01:26:12 -0000 1.12 +++ CSelectInCriteria.vb 10 Jul 2005 11:35:39 -0000 1.13 @@ -22,7 +22,7 @@ Private m_udamaps As Collection Private m_fromCMaps As Collection Private m_selectAttribute As AttributeMap - Private m_joins As Join + 'Private m_joins As Join Private Shared m_subQueryCount As Integer Private m_SQC As Integer Private m_alias As String Index: CInjectedObjects.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObjects.vb,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- CInjectedObjects.vb 23 May 2005 07:23:55 -0000 1.10 +++ CInjectedObjects.vb 10 Jul 2005 11:35:39 -0000 1.11 @@ -403,7 +403,7 @@ ''' </history> ''' ----------------------------------------------------------------------------- Public Overloads Function Find(ByVal obj As InjectedObject, ByVal useFindAttributes As Boolean) As InjectedObject - Return Find(obj, useFindAttributes, True) + Return Find(obj, useFindAttributes, False) End Function ''' ----------------------------------------------------------------------------- Index: CJoin.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CJoin.vb,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CJoin.vb 24 May 2005 07:43:42 -0000 1.15 +++ CJoin.vb 10 Jul 2005 11:35:39 -0000 1.16 @@ -337,8 +337,13 @@ s = s & " " & db.GetClauseStringAnd & " " End If udaEntry = Association.GetEntry(i) - s = s & udaEntry.FromAttrMap.ColumnMap.GetAliasQualifiedName(LeftTableAlias) & " = " _ - & udaEntry.ToAttrMap.ColumnMap.GetAliasQualifiedName(TableAlias) + If Not Association.FromClass Is Nothing AndAlso Not Association.FromClass.Equals(Association.ToClass) AndAlso Association.FromClass.ChildrenMaps.Count > 0 Then + s = s & udaEntry.FromAttrMap.ColumnMap.GetAliasQualifiedName(Me.GetClassMapTableAlias(Association.FromClass)) & " = " _ + & udaEntry.ToAttrMap.ColumnMap.GetAliasQualifiedName(TableAlias) + Else + s = s & udaEntry.FromAttrMap.ColumnMap.GetAliasQualifiedName(LeftTableAlias) & " = " _ + & udaEntry.ToAttrMap.ColumnMap.GetAliasQualifiedName(TableAlias) + End If Next i s = s & rightBracket Else Index: AtomsFramework.xml =================================================================== RCS file: /cvsroot/jcframework/dotnet/AtomsFramework.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- AtomsFramework.xml 25 May 2005 01:26:10 -0000 1.15 +++ AtomsFramework.xml 10 Jul 2005 11:35:39 -0000 1.16 @@ -2681,7 +2681,7 @@ <history> [rbanks] 27/11/2003 Created </history></member> - <member name="M:AtomsFramework.ClassMap.GetInheritedAssociations"> + <member name="M:AtomsFramework.ClassMap.GetInheritedAssociations(AtomsFramework.Join)"> <summary> Gets SQL text for processing inheritance associations. </summary> @@ -6409,6 +6409,29 @@ <history> [rbanks] 24/05/2005 Created </history></member> + <member name="M:AtomsFramework.PersistenceBroker.GetAll(System.Type)"> + <summary> + Returns all objects in the database of the same type. + </summary> + <param name="type">Object type to return</param> + <returns>Arraylist. All objects of the same type</returns> + <remarks> + </remarks> + <history> + [danmayer] 10/7/2005 Created + </history></member> + <member name="M:AtomsFramework.PersistenceBroker.GetAll(System.Type,System.Boolean)"> + <summary> + Returns all objects of the same type and their associated objects from the database. + </summary> + <param name="type">Object type to return</param> + <param name="getAssociations">True - get all associated object.</param> + <returns>Arraylist. All objects of the same type</returns> + <remarks> + </remarks> + <history> + [danmayer] 10/7/2005 Created + </history></member> <member name="M:AtomsFramework.PersistenceBroker.FindObject(System.Object@)"> <summary> Finds an object in the database using the Find attributes. Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- CInjectedObject.vb 24 May 2005 07:43:42 -0000 1.31 +++ CInjectedObject.vb 10 Jul 2005 11:35:39 -0000 1.32 @@ -835,17 +835,25 @@ Exit Sub End If + Dim v As Object Dim dotPos As Integer dotPos = name.IndexOf(".") Try If dotPos = -1 Then - If TypeOf (value) Is System.SByte Then - CallByName(obj, name, CallType.Set, IIf(value.ToString = "1", True, False)) - ElseIf TypeOf (value) Is System.Guid Then - CallByName(obj, name, CallType.Set, CType(value, Guid).ToString("N")) + If TypeOf (value) Is InjectedObject Then + v = CType(value, InjectedObject).ReferencedObject + If TypeOf (v) Is System.SByte Then + CallByName(obj, name, CallType.Set, IIf(v.ToString = "1", True, False)) + Else + CallByName(obj, name, CallType.Set, v) + End If Else - CallByName(obj, name, CallType.Set, value) + If TypeOf (value) Is System.SByte Then + CallByName(obj, name, CallType.Set, IIf(value.ToString = "1", True, False)) + Else + CallByName(obj, name, CallType.Set, value) + End If End If Else Dim o As Object @@ -981,10 +989,10 @@ 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)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetObjectByAttribute(m_object, 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)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetCollectionByAttribute(m_object, udamap.FromClassTarget)) End If Next i Dim AttrMap As AttributeMap @@ -1004,10 +1012,10 @@ 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)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetObjectByAttribute(m_object, 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)) + If Not ci Is Nothing Then ci.SetAttributeValue(ci.m_originalObject, udamap.FromClassTarget, Me.GetCollectionByAttribute(m_object, udamap.FromClassTarget)) End If Next i Index: CPersistentCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentCriteria.vb,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CPersistentCriteria.vb 24 May 2005 07:43:43 -0000 1.15 +++ CPersistentCriteria.vb 10 Jul 2005 11:35:39 -0000 1.16 @@ -172,6 +172,8 @@ Private m_Associations As Collection Private m_WhereCondition As CriteriaCondition + Protected m_joins As Join + '''----------------------------------------------------------------------------- ''' <summary> ''' A collection of the various sub-criteria that make up this criteria. @@ -354,7 +356,7 @@ Dim clauseConditionAdded As Boolean = False Dim cm As ClassMap - inheritedAssoc = Me.ClassMap.GetInheritedAssociations + inheritedAssoc = Me.ClassMap.GetInheritedAssociations(m_joins) If inheritedAssoc Is Nothing Then inheritedAssoc = "" End If Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- CClassMap.vb 25 May 2005 01:26:11 -0000 1.61 +++ CClassMap.vb 10 Jul 2005 11:35:39 -0000 1.62 @@ -1866,7 +1866,7 @@ ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function GetInheritedAssociations() As String + Public Function GetInheritedAssociations(ByVal join As Join) As String Dim strTemp As String Dim addAndClause As Boolean Dim i As Short @@ -1879,8 +1879,13 @@ If addAndClause Then strTemp = strTemp & " " & Me.RelationalDatabase.GetClauseStringAnd & " " End If - strTemp = strTemp & clMap.GetReferenceAttributeMap(i).ColumnMap.GetFullyQualifiedName _ - & "=" & clMap.GetReferenceAttributeMap(i).AttributeMap.ColumnMap.GetFullyQualifiedName + If Not join Is Nothing Then + strTemp = strTemp & clMap.GetReferenceAttributeMap(i).ColumnMap.GetAliasQualifiedName(join.GetClassMapTableAlias(clMap)) _ + & " = " & clMap.GetReferenceAttributeMap(i).AttributeMap.ColumnMap.GetAliasQualifiedName(join.GetClassMapTableAlias(clMap.SuperClass)) + Else + strTemp = strTemp & clMap.GetReferenceAttributeMap(i).ColumnMap.GetFullyQualifiedName _ + & " = " & clMap.GetReferenceAttributeMap(i).AttributeMap.ColumnMap.GetFullyQualifiedName + End If addAndClause = True Next i clMap = clMap.SuperClass @@ -2006,23 +2011,28 @@ cm3 = cm2 cm2 = cm2.SuperClass End While - For Each de In Me.AssociationMaps - udamap = de.Value - If udamap.RetrieveAutomatic Then - classMapCount += 1 - mapName = "t" & classMapCount.ToString - If udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany AndAlso Me.Name <> udamap.FromClass.Name Then - rMaps.Add(mapName, udamap.FromClass) - m_joinSet = New Join(m_joinSet, udamap.FromClass, mapName, udamap) - broker.CreateJoinForMultipleInheritance(udamap.FromClass, classMapCount, m_joinSet, rMaps) - Else - rMaps.Add(mapName, udamap.ToClass) - m_joinSet = New Join(m_joinSet, udamap.ToClass, mapName, udamap) - 'Add joins for multiple inheritance - broker.CreateJoinForMultipleInheritance(udamap.ToClass, classMapCount, m_joinSet, rMaps) + + cm2 = Me + Do + For Each de In cm2.AssociationMaps + udamap = de.Value + If udamap.RetrieveAutomatic Then + classMapCount += 1 + mapName = "t" & classMapCount.ToString + If udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany AndAlso cm2.Name <> udamap.FromClass.Name Then + rMaps.Add(mapName, udamap.FromClass) + m_joinSet = New Join(m_joinSet, udamap.FromClass, mapName, udamap) + broker.CreateJoinForMultipleInheritance(udamap.FromClass, classMapCount, m_joinSet, rMaps) + Else + rMaps.Add(mapName, udamap.ToClass) + m_joinSet = New Join(m_joinSet, udamap.ToClass, mapName, udamap) + 'Add joins for multiple inheritance + broker.CreateJoinForMultipleInheritance(udamap.ToClass, classMapCount, m_joinSet, rMaps) + End If End If - End If - Next + Next + cm2 = cm2.SuperClass + Loop While Not cm2 Is Nothing 'Now build the SQL statement statement.AddSqlClause(Me.RelationalDatabase.GetClauseStringSelect & " ") @@ -2148,23 +2158,28 @@ cm3 = cm2 cm2 = cm2.SuperClass End While - For Each de In Me.AssociationMaps - udamap = de.Value - If udamap.RetrieveAutomatic Then - classMapCount += 1 - mapName = "t" & classMapCount.ToString - If udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany AndAlso Me.Name <> udamap.FromClass.Name Then - rMaps.Add(mapName, udamap.FromClass) - m_joinSet = New Join(m_joinSet, udamap.FromClass, mapName, udamap) - broker.CreateJoinForMultipleInheritance(udamap.FromClass, classMapCount, m_joinSet, rMaps) - Else - rMaps.Add(mapName, udamap.ToClass) - m_joinSet = New Join(m_joinSet, udamap.ToClass, mapName, udamap) - 'Add joins for multiple inheritance - broker.CreateJoinForMultipleInheritance(udamap.ToClass, classMapCount, m_joinSet, rMaps) + + cm2 = Me + Do + For Each de In cm2.AssociationMaps + udamap = de.Value + If udamap.RetrieveAutomatic Then + classMapCount += 1 + mapName = "t" & classMapCount.ToString + If udamap.CardinalityType = AssociationMap.Cardinality.ManyToMany AndAlso cm2.Name <> udamap.FromClass.Name Then + rMaps.Add(mapName, udamap.FromClass) + m_joinSet = New Join(m_joinSet, udamap.FromClass, mapName, udamap) + broker.CreateJoinForMultipleInheritance(udamap.FromClass, classMapCount, m_joinSet, rMaps) + Else + rMaps.Add(mapName, udamap.ToClass) + m_joinSet = New Join(m_joinSet, udamap.ToClass, mapName, udamap) + 'Add joins for multiple inheritance + broker.CreateJoinForMultipleInheritance(udamap.ToClass, classMapCount, m_joinSet, rMaps) + End If End If - End If - Next + Next + cm2 = cm2.SuperClass + Loop While Not cm2 Is Nothing 'Now build the SQL statement statement.AddSqlClause(Me.RelationalDatabase.GetClauseStringSelect & " ") |
From: Dan M. <dan...@us...> - 2005-07-10 11:35:52
|
Update of /cvsroot/jcframework/Nunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6561/Nunit Modified Files: AtomsFramework.xml Nunit_AtomsFramework.vbproj Nunit_AtomsFramework.vbproj.user nunit.sln original db1.mdb Log Message: Add support for standard classes super classes. Add new NUnit test to test standard classes super classes. Index: Nunit_AtomsFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/Nunit/Nunit_AtomsFramework.vbproj,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Nunit_AtomsFramework.vbproj 1 Apr 2005 00:00:10 -0000 1.21 +++ Nunit_AtomsFramework.vbproj 10 Jul 2005 11:35:36 -0000 1.22 @@ -200,7 +200,7 @@ BuildAction = "Compile" /> <File - RelPath = "InheritedClasses\tblAtoKClasses.vb" + RelPath = "InheritedClasses\tblAtoNClasses.vb" SubType = "Code" BuildAction = "Compile" /> @@ -250,6 +250,11 @@ BuildAction = "Compile" /> <File + RelPath = "StandardClasses\NonInheritedSuperClassTests.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "StandardClasses\NonInheritedTests.vb" SubType = "Code" BuildAction = "Compile" @@ -269,6 +274,11 @@ SubType = "Code" BuildAction = "Compile" /> + <File + RelPath = "StandardClasses\tblAAtoNNClasses.vb" + SubType = "Code" + BuildAction = "Compile" + /> </Include> </Files> </VisualBasic> Index: original db1.mdb =================================================================== RCS file: /cvsroot/jcframework/Nunit/original db1.mdb,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 Binary files /tmp/cvsSlZUBe and /tmp/cvsWVtLZP differ Index: AtomsFramework.xml =================================================================== RCS file: /cvsroot/jcframework/Nunit/AtomsFramework.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- AtomsFramework.xml 1 Apr 2005 00:00:09 -0000 1.21 +++ AtomsFramework.xml 10 Jul 2005 11:35:36 -0000 1.22 @@ -4,375 +4,466 @@ <parameter name="name" value=".\db1.mdb" /> <parameter name="user" value="anyuser" /> <parameter name="password" value="anypassword" /> - <parameter name="OIDTable" value="OID"/> + <parameter name="OIDTable" value="OID" /> + <parameter name="ansinulls" value="true" /> </database> - -<class name="SharedParent" table="SharedClasses" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary"/> - <attribute name="CreatedDate" column="created" timestamp="true"/> - <attribute name="ModifiedDate" column="modified" timestamp="true"/> - <attribute name="Field1" column="field1" /> -</class> -<!-- Proper XML mapping here would be to not have the OIDValue attribute since it + <class name="SharedParent" table="SharedClasses" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="OIDValue" column="oid" key="primary" /> + <attribute name="CreatedDate" column="created" timestamp="true" /> + <attribute name="ModifiedDate" column="modified" timestamp="true" /> + <attribute name="Field1" column="field1" /> + </class> + <!-- Proper XML mapping here would be to not have the OIDValue attribute since it inherits from the parent class (for shared tables). It is here for testing only. --> -<class name="SharedChild" table="SharedClasses" superclass="SharedParent" database="MSA" sharedtablefield="IType" sharedtablevalue="PLN" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="Field2" column="field2" /> -</class> - -<class name="NPJob" table="NPJobs" database="MSA" namespace="NunitTests.StandardClasses"> - <attribute name="Id" column="id" key="primary"/> - <attribute name="Description" column="description"/> -</class> -<class name="NPEmployee" table="NPEmployee" database="MSA" namespace="NunitTests.StandardClasses"> - <attribute name="Name" column="name" find="true" key="primary"/> - <attribute name="ReportsToName" column="parentname" /> - <attribute name="TeamName" column="teamname" /> - <attribute name="Team" /> - <attribute name="ReportsTo" /> - <attribute name="Workers" /> -</class> -<class name="NPTeam" table="NPTeams" database="MSA" namespace="NunitTests.StandardClasses"> - <attribute name="Name" column="teamname" find="true" key="primary"/> - <attribute name="TeamLeaderName" column="teamleader" /> - <attribute name="jobId" column="jobid" /> - <attribute name="TeamLeader" /> - <attribute name="Job" /> -</class> -<association fromClass="NunitTests.StandardClasses.NPEmployee" toClass="NunitTests.StandardClasses.NPEmployee" target="ReportsTo" cardinality="OneToOne" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="ReportsToName" toAttribute="Name"/> -</association> -<association fromClass="NunitTests.StandardClasses.NPEmployee" toClass="NunitTests.StandardClasses.NPEmployee" target="Workers" cardinality="OneToMany" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="Name" toAttribute="ReportsToName"/> -</association> -<association fromClass="NunitTests.StandardClasses.NPTeam" toClass="NunitTests.StandardClasses.NPEmployee" target="TeamLeader" cardinality="OneToOne" - retrieveAutomatic="true" saveAutomatic="false" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="TeamLeaderName" toAttribute="Name"/> -</association> -<association fromClass="NunitTests.StandardClasses.NPTeam" toClass="NunitTests.StandardClasses.NPJob" target="Job" cardinality="OneToOne" - retrieveAutomatic="true" saveAutomatic="false" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="jobId" toAttribute="Id"/> -</association> -<association fromClass="NunitTests.StandardClasses.NPTeam" toClass="NunitTests.StandardClasses.NPEmployee" target="Members" cardinality="OneToMany" - retrieveAutomatic="true" saveAutomatic="false" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="Name" toAttribute="TeamName"/> -</association> - - -<class name="IEmployee" table="NPEmployee" database="MSA" factory="IEmployeeFactory" namespace="NunitTests.Interfaces"> - <attribute name="Name" column="name" key="primary" find="true"/> - <attribute name="ReportsToName" column="parentname" /> - <attribute name="TeamName" column="teamname" /> - <attribute name="Team" /> - <attribute name="ReportsTo" /> - <attribute name="Workers" /> -</class> -<association fromClass="NunitTests.Interfaces.IEmployee" toClass="NunitTests.Interfaces.IEmployee" target="ReportsTo" cardinality="OneToOne" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="ReportsToName" toAttribute="Name"/> -</association> -<association fromClass="NunitTests.Interfaces.IEmployee" toClass="NunitTests.Interfaces.IEmployee" target="Workers" cardinality="OneToMany" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="Name" toAttribute="ReportsToName"/> -</association> - - -<class name="mr1" table="mr1" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="id" column="id" key="primary"/> - <attribute name="field1" column="field1" /> - <attribute name="field2" column="field2" /> - <attribute name="mr2_id" column="mr2_id" /> - <attribute name="mr2" /> -</class> -<class name="mr2" table="mr2" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="id" column="id" key="primary"/> - <attribute name="field1" column="field1" /> - <attribute name="field2" column="field2" /> - <attribute name="mr3_id" column="mr3_id" /> - <attribute name="mr3" /> -</class> -<class name="mr3" table="mr3" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="id" column="id" key="primary"/> - <attribute name="field1" column="field1" /> - <attribute name="field2" column="field2" /> -</class> -<association fromClass="NunitTests.InheritedClasses.mr1" toClass="NunitTests.InheritedClasses.mr2" target="mr2" cardinality="OneToOne" - retrieveAutomatic="false" saveAutomatic="true" deleteAutomatic="false" inverse="false" name="mr1tomr2"> - <entry fromAttribute="mr2_id" toAttribute="id"/> -</association> -<association fromClass="NunitTests.InheritedClasses.mr2" toClass="NunitTests.InheritedClasses.mr3" target="mr3" cardinality="OneToOne" - retrieveAutomatic="false" saveAutomatic="true" deleteAutomatic="false" inverse="false" name="mr2tomr3"> - <entry fromAttribute="mr3_id" toAttribute="id"/> -</association> - - -<class name="TableA" table="tableA" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="Id" column="id" key="primary"/> - <attribute name="field1" column="field1" /> - <attribute name="TableBCollection" /> - <attribute name="TableCCollection" /> -</class> -<class name="TableB" table="TableB" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="Id" column="id" key="primary"/> - <attribute name="field1" column="field1" /> - <attribute name="AId" column="a_id" /> - <attribute name="TableA" /> - <attribute name="TableDCollection" /> -</class> -<class name="TableC" table="TableC" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="Id" column="id" key="primary"/> - <attribute name="field1" column="field1" /> - <attribute name="AId" column="a_id" /> - <attribute name="TableA" /> -</class> -<association fromClass="NunitTests.InheritedClasses.TableA" toClass="NunitTests.InheritedClasses.TableB" target="TableBCollection" cardinality="OneToMany" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" inverse="false" name="AtoB"> - <entry fromAttribute="Id" toAttribute="AId"/> -</association> -<association fromClass="NunitTests.InheritedClasses.TableA" toClass="NunitTests.InheritedClasses.TableC" target="TableCCollection" cardinality="OneToMany" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" inverse="false" name="AtoC"> - <entry fromAttribute="Id" toAttribute="AId"/> -</association> - + <class name="SharedChild" table="SharedClasses" superclass="SharedParent" database="MSA" + sharedtablefield="IType" sharedtablevalue="PLN" namespace="NunitTests.InheritedClasses"> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="Field2" column="field2" /> + </class> + <class name="NPJob" table="NPJobs" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" find="true" /> + <attribute name="Description" column="description" /> + </class> + <class name="NPEmployee" table="NPEmployee" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Name" column="name" find="true" key="primary" /> + <attribute name="ReportsToName" column="parentname" /> + <attribute name="TeamName" column="teamname" /> + <attribute name="Team" /> + <attribute name="ReportsTo" /> + <attribute name="Workers" /> + </class> + <class name="NPTeam" table="NPTeams" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Name" column="teamname" find="true" key="primary" /> + <attribute name="TeamLeaderName" column="teamleader" /> + <attribute name="jobId" column="jobid" /> + <attribute name="TeamLeader" /> + <attribute name="Job" /> + </class> + <association fromClass="NunitTests.StandardClasses.NPEmployee" toClass="NunitTests.StandardClasses.NPEmployee" + target="ReportsTo" cardinality="OneToOne" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="ReportsToName" toAttribute="Name" /> + </association> + <association fromClass="NunitTests.StandardClasses.NPEmployee" toClass="NunitTests.StandardClasses.NPEmployee" + target="Workers" cardinality="OneToMany" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="Name" toAttribute="ReportsToName" /> + </association> + <association fromClass="NunitTests.StandardClasses.NPTeam" toClass="NunitTests.StandardClasses.NPEmployee" + target="TeamLeader" cardinality="OneToOne" retrieveAutomatic="true" saveAutomatic="false" + deleteAutomatic="false" inverse="false"> + <entry fromAttribute="TeamLeaderName" toAttribute="Name" /> + </association> + <association fromClass="NunitTests.StandardClasses.NPTeam" toClass="NunitTests.StandardClasses.NPJob" + target="Job" cardinality="OneToOne" retrieveAutomatic="true" saveAutomatic="false" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="jobId" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.NPTeam" toClass="NunitTests.StandardClasses.NPEmployee" + target="Members" cardinality="OneToMany" retrieveAutomatic="true" saveAutomatic="false" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="Name" toAttribute="TeamName" /> + </association> + <class name="IEmployee" table="NPEmployee" database="MSA" factory="IEmployeeFactory" namespace="NunitTests.Interfaces"> + <attribute name="Name" column="name" key="primary" find="true" /> + <attribute name="ReportsToName" column="parentname" /> + <attribute name="TeamName" column="teamname" /> + <attribute name="Team" /> + <attribute name="ReportsTo" /> + <attribute name="Workers" /> + </class> + <association fromClass="NunitTests.Interfaces.IEmployee" toClass="NunitTests.Interfaces.IEmployee" + target="ReportsTo" cardinality="OneToOne" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="ReportsToName" toAttribute="Name" /> + </association> + <association fromClass="NunitTests.Interfaces.IEmployee" toClass="NunitTests.Interfaces.IEmployee" + target="Workers" cardinality="OneToMany" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="Name" toAttribute="ReportsToName" /> + </association> + <class name="mr1" table="mr1" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="id" column="id" key="primary" /> + <attribute name="field1" column="field1" /> + <attribute name="field2" column="field2" /> + <attribute name="mr2_id" column="mr2_id" /> + <attribute name="mr2" /> + </class> + <class name="mr2" table="mr2" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="id" column="id" key="primary" /> + <attribute name="field1" column="field1" /> + <attribute name="field2" column="field2" /> + <attribute name="mr3_id" column="mr3_id" /> + <attribute name="mr3" /> + </class> + <class name="mr3" table="mr3" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="id" column="id" key="primary" /> + <attribute name="field1" column="field1" /> + <attribute name="field2" column="field2" /> + </class> + <association fromClass="NunitTests.InheritedClasses.mr1" toClass="NunitTests.InheritedClasses.mr2" + target="mr2" cardinality="OneToOne" retrieveAutomatic="false" saveAutomatic="true" deleteAutomatic="false" + inverse="false" name="mr1tomr2"> + <entry fromAttribute="mr2_id" toAttribute="id" /> + </association> + <association fromClass="NunitTests.InheritedClasses.mr2" toClass="NunitTests.InheritedClasses.mr3" + target="mr3" cardinality="OneToOne" retrieveAutomatic="false" saveAutomatic="true" deleteAutomatic="false" + inverse="false" name="mr2tomr3"> + <entry fromAttribute="mr3_id" toAttribute="id" /> + </association> + <class name="TableA" table="tableA" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="field1" column="field1" /> + <attribute name="TableBCollection" /> + <attribute name="TableCCollection" /> + </class> + <class name="TableB" table="TableB" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="field1" column="field1" /> + <attribute name="AId" column="a_id" /> + <attribute name="TableA" /> + <attribute name="TableDCollection" /> + </class> + <class name="TableC" table="TableC" database="MSA" namespace="NunitTests.InheritedClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="field1" column="field1" /> + <attribute name="AId" column="a_id" /> + <attribute name="TableA" /> + </class> + <association fromClass="NunitTests.InheritedClasses.TableA" toClass="NunitTests.InheritedClasses.TableB" + target="TableBCollection" cardinality="OneToMany" retrieveAutomatic="true" saveAutomatic="true" + deleteAutomatic="true" inverse="false" name="AtoB"> + <entry fromAttribute="Id" toAttribute="AId" /> + </association> + <association fromClass="NunitTests.InheritedClasses.TableA" toClass="NunitTests.InheritedClasses.TableC" + target="TableCCollection" cardinality="OneToMany" retrieveAutomatic="true" saveAutomatic="true" + deleteAutomatic="true" inverse="false" name="AtoC"> + <entry fromAttribute="Id" toAttribute="AId" /> + </association> <class name="A" table="tblA" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="Id" column="id" find="true"/> + <attribute name="OIDValue" column="oid" key="primary" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="Id" column="id" find="true" /> + <attribute name="Text" column="textCol" /> <attribute name="BCol" /> <attribute name="C" /> - <attribute name="COID" column="cOID"/> + <attribute name="COID" column="cOID" /> </class> <class name="B" table="tblB" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="Id" column="id" find="true"/> - <attribute name="Text" column="textCol"/> + <attribute name="OIDValue" column="oid" key="primary" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="Id" column="id" find="true" /> + <attribute name="Text" column="textCol" /> <attribute name="A" /> - <attribute name="AOID" column="aOID"/> + <attribute name="AOID" column="aOID" /> <attribute name="NCol" /> </class> <class name="C" table="tblC" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="Id" column="id" find="true"/> - <attribute name="Text" column="textCol"/> + <attribute name="OIDValue" column="oid" key="primary" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="Id" column="id" find="true" /> + <attribute name="Text" column="textCol" /> </class> <class name="D" table="tblD" database="MSA" superclass="B" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> <attribute name="Id" column="id" find="true" /> - <attribute name="Str" column="str"/> + <attribute name="Str" column="str" /> </class> <class name="E" table="tblE" database="MSA" superclass="B" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="Id" column="id" find="true"/> - <attribute name="Str" column="str"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="Id" column="id" find="true" /> + <attribute name="Str" column="str" /> </class> <class name="F" table="tblF" database="MSA" superclass="E" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="Id" column="id" find="true"/> - <attribute name="I" column="i"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="Id" column="id" find="true" /> + <attribute name="I" column="i" /> </class> <class name="G" table="tblG" database="MSA" superclass="E" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> <attribute name="Id" column="id" find="true" /> - <attribute name="I" column="i"/> + <attribute name="I" column="i" /> <attribute name="M" /> <attribute name="MOID" column="mOID" /> </class> <class name="H" table="tblH" database="MSA" superclass="C" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> <attribute name="Id" column="id" find="true" /> - <attribute name="Str" column="str"/> + <attribute name="Str" column="str" /> </class> <class name="I" table="tblI" database="MSA" superclass="C" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> <attribute name="Id" column="id" find="true" /> - <attribute name="Str" column="str"/> + <attribute name="Str" column="str" /> </class> <class name="J" table="tblJ" database="MSA" superclass="H" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> <attribute name="Id" column="id" find="true" /> - <attribute name="I" column="i"/> + <attribute name="I" column="i" /> </class> <class name="K" table="tblK" database="MSA" superclass="H" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> <attribute name="Id" column="id" find="true" /> - <attribute name="I" column="i"/> - <attribute name="M"/> - <attribute name="MOID" column="mOID"/> + <attribute name="I" column="i" /> + <attribute name="M" /> + <attribute name="MOID" column="mOID" /> </class> <class name="M" table="tblM" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="I" column="i"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="I" column="i" /> </class> <class name="N" table="tblN" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue"/> - <attribute name="CreatedDate" column="CreatedDate" timestamp="true"/> - <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true"/> - <attribute name="I" column="i"/> + <attribute name="OIDValue" column="oid" key="primary" reference="OIDValue" /> + <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> + <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> + <attribute name="I" column="i" /> <attribute name="B" /> - <attribute name="BOID" column="bOID"/> + <attribute name="BOID" column="bOID" /> </class> - <association fromClass="NunitTests.InheritedClasses.A" - toClass="NunitTests.InheritedClasses.B" - cardinality="oneToMany" - target="BCol" - retrieveAutomatic="true" - deleteAutomatic="true" - saveAutomatic="true" + <association fromClass="NunitTests.InheritedClasses.A" toClass="NunitTests.InheritedClasses.B" + cardinality="oneToMany" target="BCol" retrieveAutomatic="true" deleteAutomatic="true" saveAutomatic="true" inverse="false"> - <entry fromAttribute="OIDValue" toAttribute="AOID"/> + <entry fromAttribute="OIDValue" toAttribute="AOID" /> </association> - <association fromClass="NunitTests.InheritedClasses.B" - toClass="NunitTests.InheritedClasses.A" - cardinality="oneToOne" - target="A" - retrieveAutomatic="true" - deleteAutomatic="false" - saveAutomatic="false" + <association fromClass="NunitTests.InheritedClasses.B" toClass="NunitTests.InheritedClasses.A" + cardinality="oneToOne" target="A" retrieveAutomatic="true" deleteAutomatic="false" saveAutomatic="false" inverse="false"> - <entry fromAttribute="AOID" toAttribute="OIDValue"/> + <entry fromAttribute="AOID" toAttribute="OIDValue" /> </association> - <association fromClass="NunitTests.InheritedClasses.G" - toClass="NunitTests.InheritedClasses.M" - cardinality="oneToOne" - target="M" - retrieveAutomatic="true" - saveAutomatic="true" - deleteAutomatic="true" + <association fromClass="NunitTests.InheritedClasses.G" toClass="NunitTests.InheritedClasses.M" + cardinality="oneToOne" target="M" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" inverse="false"> - <entry fromAttribute="MOID" toAttribute="OIDValue"/> + <entry fromAttribute="MOID" toAttribute="OIDValue" /> </association> - <association fromClass="NunitTests.InheritedClasses.K" - toClass="NunitTests.InheritedClasses.M" - cardinality="oneToOne" - target="M" - retrieveAutomatic="true" - saveAutomatic="true" - deleteAutomatic="true" + <association fromClass="NunitTests.InheritedClasses.K" toClass="NunitTests.InheritedClasses.M" + cardinality="oneToOne" target="M" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" inverse="false"> - <entry fromAttribute="MOID" toAttribute="OIDValue"/> + <entry fromAttribute="MOID" toAttribute="OIDValue" /> </association> - <association fromClass="NunitTests.InheritedClasses.A" - toClass="NunitTests.InheritedClasses.C" - cardinality="oneToOne" - target="C" - retrieveAutomatic="true" - saveAutomatic="true" - deleteAutomatic="true" + <association fromClass="NunitTests.InheritedClasses.A" toClass="NunitTests.InheritedClasses.C" + cardinality="oneToOne" target="C" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" inverse="false"> - <entry fromAttribute="COID" toAttribute="OIDValue"/> + <entry fromAttribute="COID" toAttribute="OIDValue" /> </association> - <association fromClass="NunitTests.InheritedClasses.B" - toClass="NunitTests.InheritedClasses.N" - cardinality="oneToMany" - target="NCol" - retrieveAutomatic="true" - deleteAutomatic="true" - saveAutomatic="true" + <association fromClass="NunitTests.InheritedClasses.B" toClass="NunitTests.InheritedClasses.N" + cardinality="oneToMany" target="NCol" retrieveAutomatic="true" deleteAutomatic="true" saveAutomatic="true" inverse="false"> - <entry fromAttribute="OIDValue" toAttribute="BOID"/> + <entry fromAttribute="OIDValue" toAttribute="BOID" /> </association> - <association fromClass="NunitTests.InheritedClasses.N" - toClass="NunitTests.InheritedClasses.B" - cardinality="oneToOne" - target="B" - retrieveAutomatic="true" - deleteAutomatic="false" - saveAutomatic="false" + <association fromClass="NunitTests.InheritedClasses.N" toClass="NunitTests.InheritedClasses.B" + cardinality="oneToOne" target="B" retrieveAutomatic="true" deleteAutomatic="false" saveAutomatic="false" inverse="false"> - <entry fromAttribute="BOID" toAttribute="OIDValue"/> + <entry fromAttribute="BOID" toAttribute="OIDValue" /> </association> - + <class name="AA" table="tblAA" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="Text" column="textCol" /> + <attribute name="BCol" /> + <attribute name="C" /> + <attribute name="CId" column="cId" /> + </class> + <class name="BB" table="tblBB" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="Text" column="textCol" /> + <attribute name="A" /> + <attribute name="AId" column="aId" /> + <attribute name="M" /> + <attribute name="MId" column="mId" /> + <attribute name="NCol" /> + </class> + <class name="CC" table="tblCC" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="Text" column="textCol" /> + </class> + <class name="DD" table="tblDD" database="MSA" superclass="BB" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="Str" column="str" /> + </class> + <class name="EE" table="tblEE" database="MSA" superclass="BB" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="Str" column="str" /> + <attribute name="M1" /> + <attribute name="M1Id" column="mId" /> + </class> + <class name="FF" table="tblFF" database="MSA" superclass="EE" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="I" column="i" /> + </class> + <class name="GG" table="tblGG" database="MSA" superclass="EE" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="I" column="i" /> + <attribute name="M2" /> + <attribute name="M2Id" column="mId" /> + </class> + <class name="HH" table="tblHH" database="MSA" superclass="CC" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="Str" column="str" /> + <attribute name="M1" /> + <attribute name="M1Id" column="m1Id" /> + </class> + <class name="II" table="tblII" database="MSA" superclass="CC" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="Str" column="str" /> + </class> + <class name="JJ" table="tblJJ" database="MSA" superclass="HH" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="I" column="i" /> + </class> + <class name="KK" table="tblKK" database="MSA" superclass="HH" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="I" column="i" /> + <attribute name="M" /> + <attribute name="MId" column="mId" /> + </class> + <class name="MM" table="tblMM" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="I" column="i" /> + </class> + <class name="NN" table="tblNN" database="MSA" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" /> + <attribute name="I" column="i" /> + <attribute name="B" /> + <attribute name="BId" column="bId" /> + </class> + <class name="LL" table="tblLL" database="MSA" superclass="NN" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="Str" column="str" /> + </class> + <class name="OO" table="tblOO" database="MSA" superclass="MM" namespace="NunitTests.StandardClasses"> + <attribute name="Id" column="id" key="primary" reference="Id" /> + <attribute name="Str" column="str" /> + </class> + <association fromClass="NunitTests.StandardClasses.AA" toClass="NunitTests.StandardClasses.BB" + cardinality="oneToMany" target="BCol" retrieveAutomatic="true" deleteAutomatic="true" saveAutomatic="true" + inverse="false"> + <entry fromAttribute="Id" toAttribute="AId" /> + </association> + <association fromClass="NunitTests.StandardClasses.BB" toClass="NunitTests.StandardClasses.AA" + cardinality="oneToOne" target="A" retrieveAutomatic="true" deleteAutomatic="false" saveAutomatic="false" + inverse="false"> + <entry fromAttribute="AId" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.AA" toClass="NunitTests.StandardClasses.CC" + cardinality="oneToOne" target="C" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" + inverse="false"> + <entry fromAttribute="CId" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.BB" toClass="NunitTests.StandardClasses.NN" + cardinality="oneToMany" target="NCol" retrieveAutomatic="true" deleteAutomatic="true" saveAutomatic="true" + inverse="false"> + <entry fromAttribute="Id" toAttribute="BId" /> + </association> + <association fromClass="NunitTests.StandardClasses.NN" toClass="NunitTests.StandardClasses.BB" + cardinality="oneToOne" target="B" retrieveAutomatic="true" deleteAutomatic="false" saveAutomatic="false" + inverse="false"> + <entry fromAttribute="BId" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.BB" toClass="NunitTests.StandardClasses.MM" + cardinality="oneToOne" target="M" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" + inverse="false"> + <entry fromAttribute="MId" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.EE" toClass="NunitTests.StandardClasses.MM" + cardinality="oneToOne" target="M1" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" + inverse="false"> + <entry fromAttribute="M1Id" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.GG" toClass="NunitTests.StandardClasses.MM" + cardinality="oneToOne" target="M2" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" + inverse="false"> + <entry fromAttribute="M2Id" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.HH" toClass="NunitTests.StandardClasses.MM" + cardinality="oneToOne" target="M1" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" + inverse="false"> + <entry fromAttribute="M1Id" toAttribute="Id" /> + </association> + <association fromClass="NunitTests.StandardClasses.KK" toClass="NunitTests.StandardClasses.MM" + cardinality="oneToOne" target="M" retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true" + inverse="false"> + <entry fromAttribute="MId" toAttribute="Id" /> + </association> + <class name="LazyEmployee" table="NPEmployee" database="MSA" namespace="NunitTests.StandardClasses"> - <attribute name="Name" column="name" find="true" key="primary"/> + <attribute name="Name" column="name" find="true" key="primary" /> <attribute name="ReportsToName" column="parentname" /> <attribute name="ReportsTo" /> <attribute name="Workers" /> </class> - <association fromClass="NunitTests.StandardClasses.LazyEmployee" toClass="NunitTests.StandardClasses.LazyEmployee" target="ReportsTo" cardinality="OneToOne" - retrieveAutomatic="lazy" saveAutomatic="true" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="ReportsToName" toAttribute="Name"/> + <association fromClass="NunitTests.StandardClasses.LazyEmployee" toClass="NunitTests.StandardClasses.LazyEmployee" + target="ReportsTo" cardinality="OneToOne" retrieveAutomatic="lazy" saveAutomatic="true" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="ReportsToName" toAttribute="Name" /> </association> - <association fromClass="NunitTests.StandardClasses.LazyEmployee" toClass="NunitTests.StandardClasses.LazyEmployee" target="Workers" cardinality="OneToMany" - retrieveAutomatic="lazy" saveAutomatic="true" deleteAutomatic="false" inverse="false"> - <entry fromAttribute="Name" toAttribute="ReportsToName"/> + <association fromClass="NunitTests.StandardClasses.LazyEmployee" toClass="NunitTests.StandardClasses.LazyEmployee" + target="Workers" cardinality="OneToMany" retrieveAutomatic="lazy" saveAutomatic="true" deleteAutomatic="false" + inverse="false"> + <entry fromAttribute="Name" toAttribute="ReportsToName" /> </association> - <class name="M2MA" table="ManyToManyA" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="GUIDValue" column="GuidValue" key="primary"/> + <attribute name="GUIDValue" column="GuidValue" key="primary" /> <attribute name="Description" column="description" /> <attribute name="M2MBCollection" /> </class> <class name="M2MB" table="ManyToManyB" database="MSA" namespace="NunitTests.InheritedClasses"> - <attribute name="GUIDValue" column="GuidValue" key="primary"/> + <attribute name="GUIDValue" column="GuidValue" key="primary" /> <attribute name="Description" column="description" /> <attribute name="M2MACollection" /> </class> - <association fromClass="NunitTests.InheritedClasses.M2MA" - toClass="NunitTests.InheritedClasses.M2MB" - cardinality="ManyToMany" - fromClassTarget="M2MBCollection" - toClassTarget="M2MACollection" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true"> - <associationTable name="ManyToManyAB"> - <fromClassKey name="GUIDValue" column="AGuidValue" /> - <toClassKey name="GUIDValue" column="BGuidValue" /> - </associationTable> + <association fromClass="NunitTests.InheritedClasses.M2MA" toClass="NunitTests.InheritedClasses.M2MB" + cardinality="ManyToMany" fromClassTarget="M2MBCollection" toClassTarget="M2MACollection" + retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true"> + <associationTable name="ManyToManyAB"> + <fromClassKey name="GUIDValue" column="AGuidValue" /> + <toClassKey name="GUIDValue" column="BGuidValue" /> + </associationTable> </association> - - - <class name="iM2MA" table="ManyToManyA" database="MSA" namespace="NunitTests.Interfaces" factory="M2MAFactory"> - <attribute name="GUIDValue" column="GuidValue" key="primary"/> + <class name="iM2MA" table="ManyToManyA" database="MSA" namespace="NunitTests.Interfaces" + factory="M2MAFactory"> + <attribute name="GUIDValue" column="GuidValue" key="primary" /> <attribute name="Description" column="description" /> <attribute name="M2MBCollection" /> </class> - <class name="iM2MB" table="ManyToManyB" database="MSA" namespace="NunitTests.Interfaces" factory="M2MBFactory"> - <attribute name="GUIDValue" column="GuidValue" key="primary"/> + <class name="iM2MB" table="ManyToManyB" database="MSA" namespace="NunitTests.Interfaces" + factory="M2MBFactory"> + <attribute name="GUIDValue" column="GuidValue" key="primary" /> <attribute name="Description" column="description" /> <attribute name="M2MACollection" /> </class> - <association fromClass="NunitTests.Interfaces.iM2MA" - toClass="NunitTests.Interfaces.iM2MB" - cardinality="ManyToMany" - fromClassTarget="M2MBCollection" - toClassTarget="M2MACollection" - retrieveAutomatic="true" saveAutomatic="true" deleteAutomatic="true"> - <associationTable name="ManyToManyAB"> - <fromClassKey name="GUIDValue" column="AGuidValue" /> - <toClassKey name="GUIDValue" column="BGuidValue" /> - </associationTable> + <association fromClass="NunitTests.Interfaces.iM2MA" toClass="NunitTests.Interfaces.iM2MB" cardinality="ManyToMany" + fromClassTarget="M2MBCollection" toClassTarget="M2MACollection" retrieveAutomatic="true" + saveAutomatic="true" deleteAutomatic="true"> + <associationTable name="ManyToManyAB"> + <fromClassKey name="GUIDValue" column="AGuidValue" /> + <toClassKey name="GUIDValue" column="BGuidValue" /> + </associationTable> </association> - - <class name="IOptimistic" table="NPOptimistic" database="MSA" namespace="NunitTests.Interfaces" factory="IOptimisticFactory"> - <attribute name="GUIDValue" column="GuidValue" key="primary"/> + <class name="IOptimistic" table="NPOptimistic" database="MSA" namespace="NunitTests.Interfaces" + factory="IOptimisticFactory"> + <attribute name="GUIDValue" column="GuidValue" key="primary" /> <attribute name="Description" column="Description" /> <attribute name="CreatedDate" column="CreatedDate" timestamp="true" /> <attribute name="ModifiedDate" column="ModifiedDate" timestamp="true" /> </class> - - </map> \ No newline at end of file Index: nunit.sln =================================================================== RCS file: /cvsroot/jcframework/Nunit/nunit.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nunit.sln 1 Mar 2005 20:51:34 -0000 1.1 +++ nunit.sln 10 Jul 2005 11:35:36 -0000 1.2 @@ -3,6 +3,14 @@ ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AToMSFramework", "..\dotnet\AToMSFramework.vbproj", "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AF_OLEDB", "..\dotnet\Providers\AF_OLEDB\AF_OLEDB.vbproj", "{1E2BB267-A506-4F32-B2E0-6672184EC6BF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -13,6 +21,14 @@ {60C96393-CBF7-4F59-B43A-DA1D6608EEBD}.Debug.Build.0 = Debug|.NET {60C96393-CBF7-4F59-B43A-DA1D6608EEBD}.Release.ActiveCfg = Release|.NET {60C96393-CBF7-4F59-B43A-DA1D6608EEBD}.Release.Build.0 = Release|.NET + {8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}.Debug.ActiveCfg = Debug|.NET + {8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}.Debug.Build.0 = Debug|.NET + {8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}.Release.ActiveCfg = Release|.NET + {8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}.Release.Build.0 = Release|.NET + {1E2BB267-A506-4F32-B2E0-6672184EC6BF}.Debug.ActiveCfg = Debug|.NET + {1E2BB267-A506-4F32-B2E0-6672184EC6BF}.Debug.Build.0 = Debug|.NET + {1E2BB267-A506-4F32-B2E0-6672184EC6BF}.Release.ActiveCfg = Release|.NET + {1E2BB267-A506-4F32-B2E0-6672184EC6BF}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Index: Nunit_AtomsFramework.vbproj.user =================================================================== RCS file: /cvsroot/jcframework/Nunit/Nunit_AtomsFramework.vbproj.user,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Nunit_AtomsFramework.vbproj.user 1 Mar 2005 20:51:34 -0000 1.4 +++ Nunit_AtomsFramework.vbproj.user 10 Jul 2005 11:35:36 -0000 1.5 @@ -1,7 +1,7 @@ <VisualStudioProject> <VisualBasic LastOpenVersion = "7.10.3077" > <Build> - <Settings ReferencePath = "C:\Program Files\NUnit 2.2\bin\;C:\Projects\Sourceforge\dotnet\bin\" > + <Settings ReferencePath = "C:\Program Files\NUnit 2.2\bin\;C:\Projects\Sourceforge\dotnet\bin\;C:\My Programs\JCFramework\dotnet\bin\" > <Config Name = "Debug" EnableASPDebugging = "false" @@ -13,7 +13,7 @@ StartAction = "Program" StartArguments = '"..\Nunit_AtomsFramework.nunit"' StartPage = "" - StartProgram = "C:\Program Files\NUnit 2.2\bin\nunit-gui.exe" + StartProgram = "C:\Program Files\NUnit\bin\nunit-gui.exe" StartURL = "" StartWorkingDirectory = "" StartWithIE = "true" |
Update of /cvsroot/jcframework/Nunit/InheritedClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6561/Nunit/InheritedClasses Modified Files: AtomsFrameworkTests.vb AutoIdClasses.vb AutoIdTests.vb CEmployee.vb CJob.vb CSharedClasses.vb CTeam.vb ManyToManyClasses_v2.vb ManyToManyTests_v2.vb MultiRetrieveTestClasses.vb MultiRetrieveTests.vb RetrieveCriteriaTests.vb SharedTests.vb SuperClassTests.vb TableA_B.vb Added Files: tblAtoNClasses.vb Log Message: Add support for standard classes super classes. Add new NUnit test to test standard classes super classes. Index: CJob.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/CJob.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CJob.vb 19 Oct 2004 00:13:38 -0000 1.1 +++ CJob.vb 10 Jul 2005 11:35:38 -0000 1.2 @@ -3,7 +3,7 @@ Namespace InheritedClasses <AFTable("jobs", "MSA", AFTableAttribute.KeyType.useOIDValue, OIDcolumn:="oidvalue")> _ Public Class CJob - Inherits CPersistentObject + Inherits PersistentObject Private m_description As String @@ -18,7 +18,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New CJob End Function Index: MultiRetrieveTestClasses.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/MultiRetrieveTestClasses.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MultiRetrieveTestClasses.vb 19 Dec 2004 22:44:46 -0000 1.3 +++ MultiRetrieveTestClasses.vb 10 Jul 2005 11:35:38 -0000 1.4 @@ -3,7 +3,7 @@ Namespace InheritedClasses Public Class mr1 - Inherits CPersistentObject + Inherits PersistentObject Private _id As String Private _mr2_id As String @@ -64,7 +64,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New mr1 End Function @@ -74,7 +74,7 @@ End Class Public Class mr2 - Inherits CPersistentObject + Inherits PersistentObject Private _id As String Public Property id() As String @@ -136,7 +136,7 @@ End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New mr2 End Function @@ -146,7 +146,7 @@ End Class Public Class mr3 - Inherits CPersistentObject + Inherits PersistentObject Private _id As String Public Property id() As String @@ -181,7 +181,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New mr3 End Function Index: TableA_B.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/TableA_B.vb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TableA_B.vb 14 Feb 2005 02:24:12 -0000 1.6 +++ TableA_B.vb 10 Jul 2005 11:35:38 -0000 1.7 @@ -2,7 +2,7 @@ Namespace InheritedClasses Public Class TableA - Inherits CPersistentObject + Inherits PersistentObject Private _id As String Public Property Id() As String @@ -26,27 +26,27 @@ End Set End Property - Private WithEvents _tableBCol As New CPersistentCollection - Public Property TableBCollection() As CPersistentCollection + Private WithEvents _tableBCol As New PersistentObjectCollection + Public Property TableBCollection() As PersistentObjectCollection Get Return _tableBCol End Get - Set(ByVal Value As CPersistentCollection) + Set(ByVal Value As PersistentObjectCollection) _tableBCol = Value End Set End Property - Private _tableCCol As New CPersistentCollection - Public Property TableCCollection() As CPersistentCollection + Private _tableCCol As New PersistentObjectCollection + Public Property TableCCollection() As PersistentObjectCollection Get Return _tableCCol End Get - Set(ByVal Value As CPersistentCollection) + Set(ByVal Value As PersistentObjectCollection) _tableCCol = Value End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New TableA End Function @@ -68,7 +68,7 @@ End Class Public Class TableB - Inherits CPersistentObject + Inherits PersistentObject Private _id As String Public Property Id() As String @@ -116,7 +116,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New TableB End Function @@ -126,7 +126,7 @@ End Class Public Class TableC - Inherits CPersistentObject + Inherits PersistentObject Private _id As String Public Property Id() As String @@ -174,7 +174,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New TableC End Function --- NEW FILE: tblAtoNClasses.vb --- Imports AToMSFramework Namespace InheritedClasses Public Class A Inherits PersistentObject Public _id As Integer = 0 Public _text As String = String.Empty Public _c As C Public _cOID As String Public WithEvents _bCol As PersistentObjectCollection Public Sub New() _bCol = New PersistentObjectCollection Me.SetDirtyFlag() End Sub Public Property Id() As Integer Get Return _id End Get Set(ByVal value As Integer) If (_id <> value) Then _id = value SetDirtyFlag() End If End Set End Property Public Property Text() As String Get Return _text End Get Set(ByVal Value As String) If (_text <> Value) Then _text = Value SetDirtyFlag() End If End Set End Property Public Property C() As C Get 'Retrieving manually when we have an association set to autoretrieve can produce 'unpredictable results. 'If _c Is Nothing AndAlso _cOID <> String.Empty Then ' _c = New C ' _c.OIDValue = _cOID ' _c.Retrieve() 'End If Return _c End Get Set(ByVal Value As C) If Me._c Is Nothing AndAlso Not (Value Is Nothing) Then Me._c = Value Me._cOID = Value.OidValue Else If Value Is Nothing Then Me._c = Nothing Me._cOID = Nothing Else If Not Me._c.Equals(Value) Then Me._c = Value Me._cOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property COID() As String Get If Not _c Is Nothing Then Return _c.OidValue Else Return _cOID End If End Get Set(ByVal Value As String) _cOID = Value End Set End Property Public Property BCol() As PersistentObjectCollection Get Return _bCol End Get Set(ByVal Value As PersistentObjectCollection) If _bCol.Equals(Value) Then _bCol = Value For Each _b As B In _bCol _b.A = Me Next SetDirtyFlag() End If End Set End Property Public Overrides Function GetNewObject() As PersistentObject Return New A End Function Public Overrides Function IsValid() As Boolean Return True End Function Private Sub _bCol_ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Handles _bCol.ListChanged Me.SetDirtyFlag() End Sub End Class Public Class B Inherits PersistentObject Public Sub New() _nCol = New PersistentObjectCollection Me.SetDirtyFlag() End Sub Public _id As Integer = 0 Public _text As String = String.Empty Public _a As A = Nothing Public _aOID As String = Nothing Public WithEvents _nCol As PersistentObjectCollection Public Property Id() As Integer Get Return Me._id End Get Set(ByVal Value As Integer) If Not (Me._id = Value) Then Me._id = Value Me.SetDirtyFlag() End If End Set End Property Public Property Text() As String Get Return Me._text End Get Set(ByVal Value As String) If Not (Me._text = Value) Then Me._text = Value Me.SetDirtyFlag() End If End Set End Property Public Property A() As A Get Return Me._a End Get Set(ByVal Value As A) If Me._a Is Nothing AndAlso Not (Value Is Nothing) Then Me._a = Value Me._aOID = Value.OidValue Else If Value Is Nothing Then Me._a = Nothing Me._aOID = Nothing Else If Not Me._a.Equals(Value) Then Me._a = Value Me._aOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property AOID() As String Get If Not (Me._a Is Nothing) Then Return Me._a.OidValue Else Return Me._aOID End If End Get Set(ByVal Value As String) If Not (Me._a Is Nothing) Then If Not (Me._a.OidValue = Value) Then Me._a.OidValue = Value Me.SetDirtyFlag() End If End If Me._aOID = Value End Set End Property Public Property NCol() As PersistentObjectCollection Get Return Me._nCol End Get Set(ByVal Value As PersistentObjectCollection) If Me._nCol.Equals(Value) Then Me._nCol = Value For Each _n As N In Me._nCol _n.B = Me Next SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New B End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function Private Sub _nCol_ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Handles _nCol.ListChanged Me.SetDirtyFlag() End Sub End Class Public Class C Inherits PersistentObject Public Sub New() End Sub Private _id As Integer = 0 Private _text As String = String.Empty Public Property Id() As Integer Get Return Me._id End Get Set(ByVal Value As Integer) If Not (Me._id = Value) Then Me._id = Value Me.SetDirtyFlag() End If End Set End Property Public Property Text() As String Get Return Me._text End Get Set(ByVal Value As String) If Not (Me._text = Value) Then Me._text = Value Me.SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New C End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class D Inherits B Public Sub New() End Sub Private _str As String = String.Empty Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) If Not (Me._str = Value) Then Me._str = Value Me.SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New D End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class E Inherits B Public Sub New() End Sub Private _str As String = String.Empty Private _m As M = Nothing Private _mOID As String Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) If Not (Me._str = Value) Then Me._str = Value Me.SetDirtyFlag() End If End Set End Property Public Property M1() Get Return Me._m End Get Set(ByVal Value) If Me._m Is Nothing AndAlso Not (Value Is Nothing) Then Me._m = Value Me._mOID = Value.OidValue Else If Value Is Nothing Then Me._m = Nothing Me._mOID = Nothing Else If Not Me._m.Equals(Value) Then Me._m = Value Me._mOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property M1OID() Get If Not Me._m Is Nothing Then Return Me._m.OidValue Else Return Me._mOID End If End Get Set(ByVal Value) If Not Me._m Is Nothing Then If Not Me._m.OidValue.Equals(Value) Then Me._m.OidValue = Value Me.SetDirtyFlag() End If End If Me._mOID = Value End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New E End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class F Inherits E Public Sub New() End Sub Private _i As Integer = 0 Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) If Not (Me._i = Value) Then Me._i = Value Me.SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New F End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class G Inherits E Public Sub New() End Sub Private _i As Integer = 0 Private _m As M = Nothing Private _mOID As String = Nothing Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) If Not (Me._i = Value) Then Me._i = Value Me.SetDirtyFlag() End If End Set End Property Public Property M() Get Return Me._m End Get Set(ByVal Value) If Me._m Is Nothing AndAlso Not (Value Is Nothing) Then Me._m = Value Me._mOID = Value.OidValue Else If Value Is Nothing Then Me._m = Nothing Me._mOID = Nothing Else If Not Me._m.Equals(Value) Then Me._m = Value Me._mOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property MOID() Get If Not Me._m Is Nothing Then Return Me._m.OidValue Else Return Me._mOID End If End Get Set(ByVal Value) If Not Me._m Is Nothing Then If Not Me._m.OidValue.Equals(Value) Then Me._m.OidValue = Value Me.SetDirtyFlag() End If End If Me._mOID = Value End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New G End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class H Inherits C Public Sub New() End Sub Private _str As String = String.Empty Private _m As M = Nothing Private _mOID As String Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) If Not (Me._str = Value) Then Me._str = Value Me.SetDirtyFlag() End If End Set End Property Public Property M1() Get Return Me._m End Get Set(ByVal Value) If Me._m Is Nothing AndAlso Not (Value Is Nothing) Then Me._m = Value Me._mOID = Value.OidValue Else If Value Is Nothing Then Me._m = Nothing Me._mOID = Nothing Else If Not Me._m.Equals(Value) Then Me._m = Value Me._mOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property M1OID() Get If Not Me._m Is Nothing Then Return Me._m.OidValue Else Return Me._mOID End If End Get Set(ByVal Value) If Not Me._m Is Nothing Then If Not Me._m.OidValue.Equals(Value) Then Me._m.OidValue = Value Me.SetDirtyFlag() End If End If Me._mOID = Value End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New H End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class I Inherits C Public Sub New() End Sub Private _str As String = String.Empty Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) If Not (Me._str = Value) Then Me._str = Value Me.SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New I End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class J Inherits H Public Sub New() End Sub Private _i As Integer = 0 Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) If Not (Me._i = Value) Then Me._i = Value Me.SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New J End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class K Inherits H Public Sub New() End Sub Private _i As Integer = 0 Private _m As M = Nothing Private _mOID As String Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) If Not (Me._i = Value) Then Me._i = Value Me.SetDirtyFlag() End If End Set End Property Public Property M() Get Return Me._m End Get Set(ByVal Value) If Me._m Is Nothing AndAlso Not (Value Is Nothing) Then Me._m = Value Me._mOID = Value.OidValue Else If Value Is Nothing Then Me._m = Nothing Me._mOID = Nothing Else If Not Me._m.Equals(Value) Then Me._m = Value Me._mOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property MOID() Get If Not Me._m Is Nothing Then Return Me._m.OidValue Else Return Me._mOID End If End Get Set(ByVal Value) If Not Me._m Is Nothing Then If Not Me._m.OidValue.Equals(Value) Then Me._m.OidValue = Value Me.SetDirtyFlag() End If End If Me._mOID = Value End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New K End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class M Inherits PersistentObject Public Sub New() End Sub Private _i As Integer = 0 Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) If Not (Me._i = Value) Then Me._i = Value Me.SetDirtyFlag() End If End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New M End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class Public Class N Inherits PersistentObject Public Sub New() End Sub Private _i As Integer = 0 Private _b As B = Nothing Private _bOID As String = Nothing Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) If Not (Me._i = Value) Then Me._i = Value Me.SetDirtyFlag() End If End Set End Property Public Property B() As B Get Return Me._b End Get Set(ByVal Value As B) If Me._b Is Nothing AndAlso Not (Value Is Nothing) Then Me._b = Value Me._bOID = Value.OidValue Else If Value Is Nothing Then Me._b = Nothing Me._bOID = Nothing Else If Not Me._b.Equals(Value) Then Me._b = Value Me._bOID = Value.OidValue End If End If End If Me.SetDirtyFlag() End Set End Property Public Property BOID() As String Get If Not (Me._b Is Nothing) Then Return Me._b.OidValue Else Return Me._bOID End If End Get Set(ByVal Value As String) If Not (Me._b Is Nothing) Then If Not (Me._b.OidValue = Value) Then Me._b.OidValue = Value Me.SetDirtyFlag() End If End If Me._bOID = Value End Set End Property Public Overloads Overrides Function GetNewObject() As PersistentObject Return New N End Function Public Overloads Overrides Function IsValid() As Boolean Return True End Function End Class End Namespace Index: RetrieveCriteriaTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/RetrieveCriteriaTests.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- RetrieveCriteriaTests.vb 16 Mar 2005 11:34:12 -0000 1.5 +++ RetrieveCriteriaTests.vb 10 Jul 2005 11:35:38 -0000 1.6 @@ -4,11 +4,11 @@ Namespace InheritedClasses <TestFixture()> Public Class RetrieveCriteriaTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private emp As CEmployee - Private r As CRetrieveCriteria - Private mr As CMultiRetrieveCriteria - Private c As CCursor + Private r As RetrieveCriteria + Private mr As MultiRetrieveCriteria + Private c As ResultCursor <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory @@ -26,7 +26,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -40,7 +40,7 @@ End Sub <Test()> Public Sub SingleClassRetrieve() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = emp.getClassMap c = r.perform Assert.IsTrue(c.hasElements) @@ -50,11 +50,11 @@ End Sub <Test()> Public Sub MultiRetrieveTest1() - Dim si As CSelectInCriteria + Dim si As SelectInCriteria - mr = New CMultiRetrieveCriteria(emp) - mr.WhereCondition.addSelectEqualTo("Name", "ac") - si = New CSelectInCriteria(emp) + 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) @@ -64,7 +64,7 @@ End Sub <Test()> Public Sub RetrieveCriteriaOffset() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = emp.getClassMap r.RowLimit = 1 r.Offset = 1 @@ -74,7 +74,7 @@ End Sub <Test()> Public Sub LoadFullObjects() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ReturnFullObjects = True c = r.perform(emp) Assert.IsFalse(c.HoldsProxies) @@ -91,7 +91,7 @@ End Sub <Test()> Public Sub SimpleOrCriteria() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = emp.getClassMap r.WhereCondition.addSelectEqualTo("Name", "aa") r.WhereCondition.addSelectEqualTo("Name", "b", True) @@ -110,7 +110,7 @@ Dim al As New ArrayList al.Add("aa") al.Add("b") - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = emp.getClassMap r.WhereCondition.addSelectInList("Name", al) c = r.perform @@ -125,12 +125,12 @@ End Sub <Test()> Public Sub SubCriteria() - Dim xx_1 As New CCriteriaCondition - Dim xx_2 As New CCriteriaCondition - Dim xx_3 As New CCriteriaCondition - Dim xx_4 As New CCriteriaCondition + 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 CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = emp.getClassMap xx_1.ClassMap = r.ClassMap xx_2.ClassMap = r.ClassMap Index: ManyToManyClasses_v2.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/ManyToManyClasses_v2.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ManyToManyClasses_v2.vb 16 Mar 2005 11:34:12 -0000 1.3 +++ ManyToManyClasses_v2.vb 10 Jul 2005 11:35:38 -0000 1.4 @@ -3,7 +3,7 @@ Namespace InheritedClasses #Region "M2MA" Public Class M2MA - Inherits CPersistentObject + Inherits PersistentObject Private _description As String Private WithEvents _bCol As M2MBCollection @@ -27,7 +27,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New M2MA End Function @@ -47,7 +47,7 @@ #Region "M2MB" Public Class M2MB - Inherits CPersistentObject + Inherits PersistentObject Private _description As String Private _aCol As M2MACollection @@ -71,7 +71,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New M2MB End Function @@ -88,7 +88,7 @@ #Region "M2MACollection" Public Class M2MACollection - Inherits CPersistentCollection + Inherits PersistentObjectCollection Public Overloads Sub Add(ByVal a As M2MA) list.Add(a) @@ -102,7 +102,7 @@ #Region "M2MBCollection" Public Class M2MBCollection - Inherits CPersistentCollection + Inherits PersistentObjectCollection Public Overloads Sub Add(ByVal b As M2MB) list.Add(b) Index: CEmployee.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/CEmployee.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CEmployee.vb 1 Apr 2005 00:00:10 -0000 1.3 +++ CEmployee.vb 10 Jul 2005 11:35:38 -0000 1.4 @@ -1,18 +1,18 @@ Imports AToMSFramework Namespace InheritedClasses - <AFTable("employee", "MSA", AFTableAttribute.KeyType.useOIDValue, OIDColumn:="oid"), _ - AFAssociation(GetType(CEmployee), "ReportsTo", CUDAMap.CardinalityEnum.ONE_TO_ONE, Name:="boss", Retrieve:=True), _ + <AFTable("employee", "MSA", AFTableAttribute.KeyType.UseOidValue, OIDColumn:="oid"), _ + AFAssociation(GetType(CEmployee), "ReportsTo", AssociationMap.Cardinality.OneToOne, Name:="boss", Retrieve:=True), _ AFAssociationEntry("boss", "ReportsToOID", "OIDValue"), _ - AFAssociation(GetType(CEmployee), "Workers", CUDAMap.CardinalityEnum.ONE_TO_MANY, Retrieve:=True), _ + AFAssociation(GetType(CEmployee), "Workers", AssociationMap.Cardinality.OneToMany, Retrieve:=True), _ AFAssociationEntry("Workers", "OIDValue", "ReportsToOID")> _ Public Class CEmployee - Inherits CPersistentObject + Inherits PersistentObject Private m_name As String Private m_parentoid As String Private m_parent As CEmployee - Private WithEvents m_children As CPersistentCollection + Private WithEvents m_children As PersistentObjectCollection Private m_team As CTeam Private m_teamoid As String Public Event NameChanged As EventHandler @@ -36,7 +36,7 @@ Set(ByVal Value As CEmployee) If Not Value Is Nothing Then m_parent = Value - m_parentoid = Value.OIDValue + m_parentoid = Value.OidValue SetDirtyFlag() End If End Set @@ -48,7 +48,7 @@ If m_parent Is Nothing Then Return m_parentoid Else - Return (m_parent.OIDValue) + Return (m_parent.OidValue) End If End Get Set(ByVal Value As String) @@ -57,11 +57,11 @@ End Set End Property - Public Property Workers() As CPersistentCollection + Public Property Workers() As PersistentObjectCollection Get Return m_children End Get - Set(ByVal Value As CPersistentCollection) + Set(ByVal Value As PersistentObjectCollection) m_children = Value SetDirtyFlag() End Set @@ -74,7 +74,7 @@ Set(ByVal Value As CTeam) If Not Value Is Nothing Then m_team = Value - m_teamoid = Value.OIDValue + m_teamoid = Value.OidValue SetDirtyFlag() End If End Set @@ -86,7 +86,7 @@ If m_team Is Nothing Then Return m_teamoid Else - Return (m_team.OIDValue) + Return (m_team.OidValue) End If End Get Set(ByVal Value As String) @@ -95,7 +95,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AtomsFramework.PersistentObject Return New CEmployee End Function @@ -105,7 +105,7 @@ Public Sub New() MyBase.New() - m_children = New CPersistentCollection + m_children = New PersistentObjectCollection End Sub Private Sub m_children_ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Handles m_children.ListChanged Index: AutoIdClasses.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/AutoIdClasses.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AutoIdClasses.vb 17 Dec 2004 03:27:49 -0000 1.1 +++ AutoIdClasses.vb 10 Jul 2005 11:35:38 -0000 1.2 @@ -1,11 +1,11 @@ Imports AToMSFramework Namespace InheritedClasses - <AFTable("AutoIdParent", "MSA", AFTableAttribute.KeyType.usePrimary), _ - AFAssociation(GetType(AutoIdChild), "Children", CUDAMap.CardinalityEnum.ONE_TO_MANY, Retrieve:=True, Save:=True), _ + <AFTable("AutoIdParent", "MSA", AFTableAttribute.KeyType.UsePrimary), _ + AFAssociation(GetType(AutoIdChild), "Children", AssociationMap.Cardinality.OneToMany, Retrieve:=True, Save:=True), _ AFAssociationEntry("Children", "Id", "ParentId")> _ Public Class AutoIdParent - Inherits CPersistentObject + Inherits PersistentObject Private _Id As Integer <AFColumn("autoId", Identity:=True, iskey:=True)> _ @@ -19,12 +19,12 @@ End Set End Property - Private _Children As New CPersistentCollection - Public Property Children() As CPersistentCollection + Private _Children As New PersistentObjectCollection + Public Property Children() As PersistentObjectCollection Get Return _Children End Get - Set(ByVal Value As CPersistentCollection) + Set(ByVal Value As PersistentObjectCollection) _Children = Value End Set End Property @@ -41,7 +41,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AtomsFramework.PersistentObject Return New AutoIdParent End Function @@ -52,9 +52,9 @@ - <AFTable("AutoIdChild", "MSA", AFTableAttribute.KeyType.usePrimary)> _ + <AFTable("AutoIdChild", "MSA", AFTableAttribute.KeyType.UsePrimary)> _ Public Class AutoIdChild - Inherits CPersistentObject + Inherits PersistentObject Private _Id As Integer <AFColumn("autoId", Identity:=True, iskey:=True)> _ @@ -106,7 +106,7 @@ End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AtomsFramework.PersistentObject Return New AutoIdChild End Function Index: SuperClassTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/SuperClassTests.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- SuperClassTests.vb 16 Mar 2005 11:34:12 -0000 1.7 +++ SuperClassTests.vb 10 Jul 2005 11:35:38 -0000 1.8 @@ -5,7 +5,7 @@ Namespace InheritedClasses <TestFixture()> Public Class SuperClassTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory @@ -23,7 +23,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -37,8 +37,8 @@ <TearDown()> Public Sub TestEnd() pbroker.ClearCache() - Dim col As CPersistentCollection - Dim cpo As CPersistentObject = New A + Dim col As PersistentObjectCollection + Dim cpo As PersistentObject = New A col = cpo.getAll(True) For Each a As A In col @@ -51,7 +51,7 @@ Dim root As New A root.Id = 1 root.Text = "Root object" - root.BCol = New CPersistentCollection + root.BCol = New PersistentObjectCollection ' create G and add it to the collection Dim g As New G g.Id = 5 @@ -74,8 +74,8 @@ 'Now check that A, G and K are in the database pbroker.ClearCache() - Dim col As CPersistentCollection - Dim cpo As CPersistentObject = New A + Dim col As PersistentObjectCollection + Dim cpo As PersistentObject = New A col = cpo.getAll(True) Assert.IsTrue(col.Count > 0) @@ -91,7 +91,7 @@ Dim root As New A root.Id = 1 root.Text = "Root object" - root.BCol = New CPersistentCollection + root.BCol = New PersistentObjectCollection ' create G and add it to the collection Dim g As New G g.Id = 5 @@ -113,8 +113,8 @@ root.Save(True) 'Now check that A, G and K are in the database pbroker.ClearCache() - Dim col As CPersistentCollection - Dim cpo As CPersistentObject = New A + Dim col As PersistentObjectCollection + Dim cpo As PersistentObject = New A col = cpo.getAll(True) Assert.IsTrue(col.Count > 0) @@ -136,14 +136,14 @@ j.Save() j = New J - Dim rc As New CRetrieveCriteria + Dim rc As New RetrieveCriteria rc.ClassMap = j.getClassMap - Dim condition As New CCriteriaCondition + Dim condition As New CriteriaCondition condition.ClassMap = j.getClassMap condition.Tables = rc.Tables condition.addSelectEqualTo("Text", "Class C Text") rc.WhereCondition = condition - Dim cursor As CCursor = rc.perform + Dim cursor As ResultCursor = rc.perform Assert.IsTrue(cursor.hasElements) Assert.AreEqual(1, cursor.TotalRows) cursor.loadObject(j) @@ -161,10 +161,10 @@ j.Save() j = New J - Dim rc As New CRetrieveCriteria + Dim rc As New RetrieveCriteria rc.ClassMap = j.getClassMap rc.WhereCondition.addSelectEqualTo("Text", "Class C Text1") - Dim cursor As CCursor = rc.perform + Dim cursor As ResultCursor = rc.perform Assert.IsTrue(cursor.hasElements) Assert.AreEqual(1, cursor.TotalRows) cursor.loadObject(j) @@ -197,10 +197,10 @@ pbroker.ClearCache() - Dim mrc As New CMultiRetrieveCriteria + Dim mrc As New MultiRetrieveCriteria Dim a1 As New A - Dim cpo As CPersistentObject - Dim c As CCursor + Dim cpo As PersistentObject + Dim c As ResultCursor cpo = CType(a1, A) mrc.addObjectToJoin(a1, Nothing, "") Index: SharedTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/SharedTests.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SharedTests.vb 21 Dec 2004 22:00:01 -0000 1.5 +++ SharedTests.vb 10 Jul 2005 11:35:38 -0000 1.6 @@ -4,7 +4,7 @@ Namespace InheritedClasses <TestFixture()> Public Class SharedTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Dim sc As SharedChild Dim sp As SharedParent @@ -24,7 +24,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub Index: ManyToManyTests_v2.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/ManyToManyTests_v2.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ManyToManyTests_v2.vb 1 Mar 2005 20:51:33 -0000 1.5 +++ ManyToManyTests_v2.vb 10 Jul 2005 11:35:38 -0000 1.6 @@ -4,7 +4,7 @@ Namespace InheritedClasses <TestFixture()> Public Class ManyToManyTests_v2 - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private A As M2MA Private B As M2MB @@ -24,7 +24,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -138,7 +138,7 @@ A.SetDirtyFlag() A.Save() s = "select * from ManyToManyAB where AGuidValue = """ & gvalA & """ and BGuidValue = """ & gvalB & """" - Dim c As CCursor = pbroker.ProcessPureSQL(s, A.getClassMap.RelationalDatabase.getConnection(Nothing)) + Dim c As ResultCursor = pbroker.ProcessPureSql(s, A.GetClassMap.RelationalDatabase.GetConnection()) Assert.AreEqual(0, c.ResultSet.ResultSet.Tables(0).Rows.Count) End Sub Index: CTeam.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/CTeam.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CTeam.vb 19 Oct 2004 00:13:38 -0000 1.1 +++ CTeam.vb 10 Jul 2005 11:35:38 -0000 1.2 @@ -1,22 +1,22 @@ Imports AToMSFramework Namespace InheritedClasses - <AFTable("teams", "MSA", AFTableAttribute.KeyType.useOIDValue, oidcolumn:="oidvalue"), _ - AFAssociation(GetType(CEmployee), "TeamLeader", CUDAMap.CardinalityEnum.ONE_TO_ONE, Retrieve:=True), _ + <AFTable("teams", "MSA", AFTableAttribute.KeyType.UseOidValue, oidcolumn:="oidvalue"), _ + AFAssociation(GetType(CEmployee), "TeamLeader", AssociationMap.Cardinality.OneToOne, Retrieve:=True), _ AFAssociationEntry("TeamLeader", "TeamLeaderOID", "OIDValue"), _ - AFAssociation(GetType(CJob), "Job", CUDAMap.CardinalityEnum.ONE_TO_ONE, Retrieve:=True), _ + AFAssociation(GetType(CJob), "Job", AssociationMap.Cardinality.OneToOne, Retrieve:=True), _ AFAssociationEntry("Job", "jobOID", "OIDValue"), _ - AFAssociation(GetType(CEmployee), "Members", CUDAMap.CardinalityEnum.ONE_TO_MANY, Retrieve:=True, Save:=False), _ + AFAssociation(GetType(CEmployee), "Members", AssociationMap.Cardinality.OneToMany, Retrieve:=True, Save:=False), _ AFAssociationEntry("Members", "OIDValue", "TeamOID")> _ Public Class CTeam - Inherits CPersistentObject + Inherits PersistentObject Private m_leader As CEmployee Private m_leaderoid As String Private m_name As String Private m_job As CJob Private m_joboid As String - Private m_members As CPersistentCollection + Private m_members As PersistentObjectCollection Public Property TeamLeader() As CEmployee Get @@ -24,7 +24,7 @@ End Get Set(ByVal Value As CEmployee) m_leader = Value - m_leaderoid = Value.OIDValue + m_leaderoid = Value.OidValue SetDirtyFlag() End Set End Property @@ -35,7 +35,7 @@ If m_leader Is Nothing Then Return m_leaderoid Else - Return (m_leader.OIDValue) + Return (m_leader.OidValue) End If End Get Set(ByVal Value As String) @@ -50,7 +50,7 @@ End Get Set(ByVal Value As CJob) m_job = Value - m_joboid = Value.OIDValue + m_joboid = Value.OidValue SetDirtyFlag() End Set End Property @@ -61,7 +61,7 @@ If m_job Is Nothing Then Return m_joboid Else - Return (m_job.OIDValue) + Return (m_job.OidValue) End If End Get Set(ByVal Value As String) @@ -81,17 +81,17 @@ End Set End Property - Public Property Members() As CPersistentCollection + Public Property Members() As PersistentObjectCollection Get Return m_members End Get - Set(ByVal Value As CPersistentCollection) + Set(ByVal Value As PersistentObjectCollection) m_members = Value SetDirtyFlag() End Set End Property - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AtomsFramework.PersistentObject Return New CTeam End Function @@ -101,7 +101,7 @@ Public Sub New() MyBase.new() - m_members = New CPersistentCollection + m_members = New PersistentObjectCollection End Sub Protected Overrides Sub Finalize() Index: AutoIdTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/AutoIdTests.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AutoIdTests.vb 21 Dec 2004 22:00:01 -0000 1.2 +++ AutoIdTests.vb 10 Jul 2005 11:35:38 -0000 1.3 @@ -4,11 +4,11 @@ Namespace InheritedClasses <TestFixture()> Public Class AutoIdTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private parent As AutoIdParent Private child As AutoIdChild - Private rc As CRetrieveCriteria - Private c As CCursor + Private rc As RetrieveCriteria + Private c As ResultCursor <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory @@ -26,7 +26,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub Index: CSharedClasses.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/CSharedClasses.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CSharedClasses.vb 1 Nov 2004 21:27:10 -0000 1.2 +++ CSharedClasses.vb 10 Jul 2005 11:35:38 -0000 1.3 @@ -2,10 +2,10 @@ Namespace InheritedClasses Public Class SharedParent - Inherits CPersistentObject + Inherits PersistentObject Private _field1 As String - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New SharedParent End Function @@ -30,7 +30,7 @@ Private _field2 As String - Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject + Public Overrides Function getNewObject() As AToMSFramework.PersistentObject Return New SharedChild End Function Index: MultiRetrieveTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/MultiRetrieveTests.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MultiRetrieveTests.vb 16 Mar 2005 11:34:12 -0000 1.5 +++ MultiRetrieveTests.vb 10 Jul 2005 11:35:38 -0000 1.6 @@ -4,10 +4,10 @@ Namespace InheritedClasses <TestFixture()> Public Class MultiRetrieveTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private mr1 As mr1 - Private mrc As CMultiRetrieveCriteria - Private c As CCursor + Private mrc As MultiRetrieveCriteria + Private c As ResultCursor <TestFixtureSetUp()> Public Sub Init() Environment.CurrentDirectory = System.AppDomain.CurrentDomain.BaseDirectory @@ -25,7 +25,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -38,104 +38,104 @@ Dim mr1 As New mr1 Dim mr2 As New mr2 Dim mr3 As New mr3 - mrc = New CMultiRetrieveCriteria - mrc.addObjectToJoin(mr1, Nothing, "") - mrc.addObjectToJoin(mr2, mr1, "mr1tomr2") - mrc.addObjectToJoin(mr3, mr2, "mr2tomr3") + mrc = New MultiRetrieveCriteria + mrc.AddObjectToJoin(mr1, Nothing, "") + mrc.AddObjectToJoin(mr2, mr1, "mr1tomr2") + mrc.AddObjectToJoin(mr3, mr2, "mr2tomr3") mrc.ReturnFullObjects = True - c = mrc.perform - Assert.IsTrue(c.hasElements) + c = mrc.Perform + Assert.IsTrue(c.HasElements) Assert.IsTrue(Not c.EOF) Assert.IsFalse(c.HoldsProxies) Assert.AreEqual(3, c.TotalRows) End Sub - <Test()> Public Sub ChainedClassesWithWhere() - Dim mr1 As New mr1 - Dim mr2 As New mr2 - Dim mr3 As New mr3 - mrc = New CMultiRetrieveCriteria - mrc.addObjectToJoin(mr1, Nothing, "") - mrc.addObjectToJoin(mr2, mr1, "mr1tomr2") - mrc.addObjectToJoin(mr3, mr2, "mr2tomr3") - mrc.WhereCondition.addSelectNotEqualTo("field1", "xxx") - mrc.ReturnFullObjects = True - c = mrc.perform - Assert.IsTrue(c.hasElements) - Assert.IsTrue(Not c.EOF) - Assert.IsFalse(c.HoldsProxies) - Assert.AreEqual(3, c.TotalRows) - End Sub + <Test()> Public Sub ChainedClassesWithWhere() + Dim mr1 As New mr1 + Dim mr2 As New mr2 + Dim mr3 As New mr3 + mrc = New MultiRetrieveCriteria + mrc.AddObjectToJoin(mr1, Nothing, "") + mrc.AddObjectToJoin(mr2, mr1, "mr1tomr2") + mrc.AddObjectToJoin(mr3, mr2, "mr2tomr3") + mrc.WhereCondition.AddSelectNotEqualTo("field1", "xxx") + mrc.ReturnFullObjects = True + c = mrc.Perform + Assert.IsTrue(c.HasElements) + Assert.IsTrue(Not c.EOF) + Assert.IsFalse(c.HoldsProxies) + Assert.AreEqual(3, c.TotalRows) + End Sub - <Test()> Public Sub ChainedClassesWithOrderBy() - Dim mr1 As New mr1 - Dim mr2 As New mr2 - Dim mr3 As New mr3 - mrc = New CMultiRetrieveCriteria - mrc.addObjectToJoin(mr1, Nothing, "") - mrc.addObjectToJoin(mr2, mr1, "mr1tomr2") - mrc.addObjectToJoin(mr3, mr2, "mr2tomr3") - mrc.addOrderAttribute("mr3.field1") - mrc.ReturnFullObjects = True - c = mrc.perform - Assert.IsTrue(c.hasElements) - Assert.IsTrue(Not c.EOF) - Assert.IsFalse(c.HoldsProxies) - Assert.AreEqual(3, c.TotalRows) - End Sub + <Test()> Public Sub ChainedClassesWithOrderBy() + Dim mr1 As New mr1 + Dim mr2 As New mr2 + Dim mr3 As New mr3 + mrc = New MultiRetrieveCriteria + mrc.AddObjectToJoin(mr1, Nothing, "") + mrc.AddObjectToJoin(mr2, mr1, "mr1tomr2") + mrc.AddObjectToJoin(mr3, mr2, "mr2tomr3") + mrc.AddOrderAttribute("mr3.field1") + mrc.ReturnFullObjects = True + c = mrc.Perform + Assert.IsTrue(c.HasElements) + Assert.IsTrue(Not c.EOF) + Assert.IsFalse(c.HoldsProxies) + Assert.AreEqual(3, c.TotalRows) + End Sub - <Test()> Public Sub SaveMRClasses() - Dim mr1 As New mr1 - mr1.id = "id1" - mr1.field1 = "_a" - mr1.field2 = 1 - Dim mr2 As New mr2 - mr2.id = "id2" - mr2.field1 = "_aa" - mr2.field2 = 2 - mr1.mr2 = mr2 - Dim mr3 As New mr3 - mr3.id = "id3" - mr3.field1 = "zz" - mr3.field2 = 3 - mr2.mr3 = mr3 - mr1.Save() - mr2.field2 = 22 - mr2.Save() - End Sub + <Test()> Public Sub SaveMRClasses() + Dim mr1 As New mr1 + mr1.id = "id1" + mr1.field1 = "_a" + mr1.field2 = 1 + Dim mr2 As New mr2 + mr2.id = "id2" + mr2.field1 = "_aa" + mr2.field2 = 2 + mr1.mr2 = mr2 + Dim mr3 As New mr3 + mr3.id = "id3" + mr3.field1 = "zz" + mr3.field2 = 3 + mr2.mr3 = mr3 + mr1.Save() + mr2.field2 = 22 + mr2.Save() + End Sub - <Test()> Public Sub SummaryChainedClasses() - Dim mr1 As New mr1 - Dim mr2 As New mr2 - Dim mr3 As New mr3 - Dim src As CMultiSummaryCriteria - src = New CMultiSummaryCriteria - src.addObjectToJoin(mr1, Nothing, "") - src.addObjectToJoin(mr2, mr1, "mr1tomr2") - src.addObjectToJoin(mr3, mr2, "mr2tomr3") - src.addSummaryField("mr1tomr2.field1", CMultiSummaryCriteria.SumMethod.Count) - c = src.perform - Assert.IsTrue(c.hasElements) - Assert.IsFalse(c.EOF) - Assert.AreEqual(1, c.TotalRows) - End Sub + <Test()> Public Sub SummaryChainedClasses() + Dim mr1 As New mr1 + Dim mr2 As New mr2 + Dim mr3 As New mr3 + Dim src As MultiSummaryCriteria + src = New MultiSummaryCriteria + src.AddObjectToJoin(mr1, Nothing, "") + src.AddObjectToJoin(mr2, mr1, "mr1tomr2") + src.AddObjectToJoin(mr3, mr2, "mr2tomr3") + src.AddSummaryField("mr1tomr2.field1", MultiSummaryCriteria.SumMethod.Count) + c = src.Perform + Assert.IsTrue(c.HasElements) + Assert.IsFalse(c.EOF) + Assert.AreEqual(1, c.TotalRows) + End Sub - <Test()> Public Sub SummaryChainedClassesWithWhere() - Dim mr1 As New mr1 - Dim mr2 As New mr2 - Dim mr3 As New mr3 - Dim src As CMultiSummaryCriteria - src = New CMultiSummaryCriteria - src.addObjectToJoin(mr1, Nothing, "") - src.addObjectToJoin(mr2, mr1, "mr1tomr2") - src.addObjectToJoin(mr3, mr2, "mr2tomr3") - src.addSummaryField("field1", CMultiSummaryCriteria.SumMethod.Count) - src.WhereCondition.addSelectNotEqualTo("field1", "xxx") - c = src.perform - Assert.IsTrue(c.hasElements) - Assert.IsTrue(Not c.EOF) - Assert.AreEqual(1, c.TotalRows) - End Sub + <Test()> Public Sub SummaryChainedClassesWithWhere() + Dim mr1 As New mr1 + Dim mr2 As New mr2 + Dim mr3 As New mr3 + Dim src As MultiSummaryCriteria + src = New MultiSummaryCriteria + src.AddObjectToJoin(mr1, Nothing, "") + src.AddObjectToJoin(mr2, mr1, "mr1tomr2") + src.AddObjectToJoin(mr3, mr2, "mr2tomr3") + src.AddSummaryField("field1", MultiSummaryCriteria.SumMethod.Count) + src.WhereCondition.AddSelectNotEqualTo("field1", "xxx") + c = src.Perform + Assert.IsTrue(c.HasElements) + Assert.IsTrue(Not c.EOF) + Assert.AreEqual(1, c.TotalRows) + End Sub - End Class + End Class End Namespace \ No newline at end of file Index: AtomsFrameworkTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/AtomsFrameworkTests.vb,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- AtomsFrameworkTests.vb 4 Apr 2005 23:59:52 -0000 1.17 +++ AtomsFrameworkTests.vb 10 Jul 2005 11:35:38 -0000 1.18 @@ -4,11 +4,11 @@ Namespace InheritedClasses <TestFixture()> Public Class _BasicTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private emp As CEmployee Private job As CJob Private team As CTeam - Dim WithEvents coll As CPersistentCollection + Dim WithEvents coll As PersistentObjectCollection Private eventcount As Integer <TestFixtureSetUp()> Public Sub Init() @@ -27,7 +27,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -125,8 +125,8 @@ emp = New CEmployee emp.Name = "DeleteMe3" emp.Save() - Dim dc As CDeleteCriteria - dc = New CDeleteCriteria + Dim dc As DeleteCriteria + dc = New DeleteCriteria dc.ClassMap = emp.getClassMap dc.WhereCondition.addSelectLike("Name", "DeleteMe%") Dim i As Integer = dc.perform() @@ -181,7 +181,7 @@ emp2 = New CEmployee emp2.Name = "aa" emp2.Find() - Assert.IsTrue(CPersistentObject.Equals(emp2.ReportsTo, emp)) + Assert.IsTrue(PersistentObject.Equals(emp2.ReportsTo, emp)) Assert.IsTrue(emp.Equals(emp2.ReportsTo)) End Sub @@ -234,13 +234,13 @@ <Test()> Public Sub AutoDelete() Dim a As New TableA Dim b As New TableB - Dim cc As CCursor + Dim cc As ResultCursor a.Id = "a1" a.Retrieve() Assert.IsTrue(a.Persistent) Assert.AreEqual(2, a.TableBCollection.Count) a.Delete() - Dim rc As New CRetrieveCriteria + Dim rc As New RetrieveCriteria rc.ClassMap = b.getClassMap rc.WhereCondition.addSelectEqualTo("AId", "a1") cc = rc.perform() @@ -251,13 +251,13 @@ <Test()> Public Sub AutoSave() Dim a As New TableA Dim b As New TableB - Dim cc As CCursor + Dim cc As ResultCursor a.Id = "a3" b.Id = "b33" b.TableA = a a.TableBCollection.Add(b) a.Save() - Dim rc As New CRetrieveCriteria + Dim rc As New RetrieveCriteria rc.ClassMap = b.getClassMap rc.WhereCondition.addSelectEqualTo("AId", "a3") cc = rc.perform() @@ -360,7 +360,7 @@ End Sub <Test()> Public Sub CheckCollectionEvents() - coll = New CPersistentCollection + coll = New PersistentObjectCollection eventcount = 0 emp = New CEmployee emp.Name = "somename" @@ -477,7 +477,7 @@ pbroker.startTransaction() a1.Id = "aa1a" a1.Retrieve() - a1.TableBCollection = New CPersistentCollection + a1.TableBCollection = New PersistentObjectCollection b.Id = "b1b" b.TableA = a1 a1.TableBCollection.Add(b) |
From: Dan M. <dan...@us...> - 2005-07-10 11:35:48
|
Update of /cvsroot/jcframework/Nunit/StandardClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6561/Nunit/StandardClasses Modified Files: NonInheritedRetreiveCriteria.vb NonInheritedTests.vb Added Files: NonInheritedSuperClassTests.vb tblAAtoNNClasses.vb Log Message: Add support for standard classes super classes. Add new NUnit test to test standard classes super classes. --- NEW FILE: tblAAtoNNClasses.vb --- Namespace StandardClasses Public Class AA Private _id As String = String.Empty Private _text As String = String.Empty Private _c As CC Private _cId As String = String.Empty Private _bCol As ArrayList Public Sub New() Me._bCol = New ArrayList End Sub Public Property Id() As String Get Return Me._id End Get Set(ByVal value As String) Me._id = value End Set End Property Public Property Text() As String Get Return Me._text End Get Set(ByVal Value As String) Me._text = Value End Set End Property Public Property C() As CC Get Return Me._c End Get Set(ByVal Value As CC) Me._c = Value If Not Value Is Nothing Then Me._cId = Value.Id End If End Set End Property Public Property CId() As String Get If Not Me._c Is Nothing Then Return Me._c.Id Else Return Me._cId End If End Get Set(ByVal Value As String) Me._cId = Value End Set End Property Public Property BCol() As ArrayList Get Return Me._bCol End Get Set(ByVal Value As ArrayList) Me._bCol = Value End Set End Property End Class Public Class BB Public Sub New() _nCol = New ArrayList End Sub Private _id As String = String.Empty Private _text As String = String.Empty Private _a As AA = Nothing Private _aId As String = String.Empty Private _m As MM = Nothing Private _mId As String = String.Empty Private _nCol As ArrayList Public Property Id() As String Get Return Me._id End Get Set(ByVal Value As String) Me._id = Value End Set End Property Public Property Text() As String Get Return Me._text End Get Set(ByVal Value As String) Me._text = Value End Set End Property Public Property A() As AA Get Return Me._a End Get Set(ByVal Value As AA) Me._a = Value If Not Value Is Nothing Then Me._aId = Value.Id End If End Set End Property Public Property AId() As String Get If Not (Me._a Is Nothing) Then Return Me._a.Id Else Return Me._aId End If End Get Set(ByVal Value As String) Me._aId = Value End Set End Property Public Property M() As MM Get Return Me._m End Get Set(ByVal Value As MM) Me._m = Value If Not Value Is Nothing Then Me._mId = Value.Id End If End Set End Property Public Property MId() As String Get If Not Me._m Is Nothing Then Return Me._m.Id Else Return Me._mId End If End Get Set(ByVal Value As String) Me._mId = Value End Set End Property Public Property NCol() As ArrayList Get Return Me._nCol End Get Set(ByVal Value As ArrayList) Me._nCol = Value End Set End Property End Class Public Class CC Public Sub New() End Sub Private _id As String = String.Empty Private _text As String = String.Empty Public Property Id() As String Get Return Me._id End Get Set(ByVal Value As String) Me._id = Value End Set End Property Public Property Text() As String Get Return Me._text End Get Set(ByVal Value As String) Me._text = Value End Set End Property End Class Public Class DD Inherits BB Public Sub New() End Sub Private _str As String = String.Empty Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) Me._str = Value End Set End Property End Class Public Class EE Inherits BB Public Sub New() End Sub Private _str As String = String.Empty Private _m As MM = Nothing Private _mId As String = String.Empty Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) Me._str = Value End Set End Property Public Property M1() As MM Get Return Me._m End Get Set(ByVal Value As MM) Me._m = Value If Not Value Is Nothing Then Me._mId = Value.Id End If End Set End Property Public Property M1Id() As String Get If Not Me._m Is Nothing Then Return Me._m.Id Else Return Me._mId End If End Get Set(ByVal Value As String) Me._mId = Value End Set End Property End Class Public Class FF Inherits EE Public Sub New() End Sub Private _i As Integer = 0 Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) Me._i = Value End Set End Property End Class Public Class GG Inherits EE Public Sub New() End Sub Private _i As Integer = 0 Private _m As MM = Nothing Private _mId As String = String.Empty Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) Me._i = Value End Set End Property Public Property M2() As MM Get Return Me._m End Get Set(ByVal Value As MM) Me._m = Value If Not Value Is Nothing Then Me._mId = Value.Id End If End Set End Property Public Property M2Id() As String Get If Not Me._m Is Nothing Then Return Me._m.Id Else Return Me._mId End If End Get Set(ByVal Value As String) Me._mId = Value End Set End Property End Class Public Class HH Inherits CC Public Sub New() End Sub Private _str As String = String.Empty Private _m As MM = Nothing Private _mId As String = String.Empty Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) Me._str = Value End Set End Property Public Property M1() As MM Get Return Me._m End Get Set(ByVal Value As MM) Me._m = Value If Not Value Is Nothing Then Me._mID = Value.Id End If End Set End Property Public Property M1Id() As String Get If Not Me._m Is Nothing Then Return Me._m.Id Else Return Me._mId End If End Get Set(ByVal Value As String) Me._mId = Value End Set End Property End Class Public Class II Inherits CC Public Sub New() End Sub Private _str As String = String.Empty Public Property Str() As String Get Return Me._str End Get Set(ByVal Value As String) Me._str = Value End Set End Property End Class Public Class JJ Inherits HH Public Sub New() End Sub Private _i As Integer = 0 Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) Me._i = Value End Set End Property End Class Public Class KK Inherits HH Public Sub New() End Sub Private _i As Integer = 0 Private _m As MM = Nothing Private _mId As String = String.Empty Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) Me._i = Value End Set End Property Public Property M() As MM Get Return Me._m End Get Set(ByVal Value As MM) Me._m = Value If Not Value Is Nothing Then Me._mID = Value.Id End If End Set End Property Public Property MId() As String Get If Not Me._m Is Nothing Then Return Me._m.Id Else Return Me._mId End If End Get Set(ByVal Value As String) Me._mId = Value End Set End Property End Class Public Class MM Public Sub New() End Sub Private _id As String = String.Empty Private _i As Integer = 0 Public Property Id() As String Get Return Me._id End Get Set(ByVal value As String) Me._id = value End Set End Property Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) Me._i = Value End Set End Property End Class Public Class NN Public Sub New() End Sub Private _id As String = String.Empty Private _i As Integer = 0 Private _b As BB = Nothing Private _bId As String = String.Empty Public Property Id() As String Get Return Me._id End Get Set(ByVal value As String) Me._id = value End Set End Property Public Property I() As Integer Get Return Me._i End Get Set(ByVal Value As Integer) Me._i = Value End Set End Property Public Property B() As BB Get Return Me._b End Get Set(ByVal Value As BB) Me._b = Value If Not Value Is Nothing Then Me._bId = Value.Id End If End Set End Property Public Property BId() As String Get If Not (Me._b Is Nothing) Then Return Me._b.Id Else Return Me._bId End If End Get Set(ByVal Value As String) Me._bId = Value End Set End Property End Class Public Class LL Inherits NN Public Sub New() End Sub Private _s As String = String.Empty Public Property Str() As String Get Return Me._s End Get Set(ByVal Value As String) Me._s = Value End Set End Property End Class Public Class OO Inherits MM Public Sub New() End Sub Private _s As String = String.Empty Public Property Str() As String Get Return Me._s End Get Set(ByVal Value As String) Me._s = Value End Set End Property End Class End Namespace --- NEW FILE: NonInheritedSuperClassTests.vb --- Imports AToMSFramework Imports NUnit.Framework Namespace StandardClasses <TestFixture()> Public Class NonInheritedSuperClassTests Private pbroker As PersistenceBroker <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 GC.Collect() '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() End Sub <TearDown()> Public Sub TestEnd() End Sub <Test()> Public Sub CheckMultiInheritance1() Dim root As New AA root.Id = "1" root.Text = "Root object" root.BCol = New ArrayList ' create G and add it to the collection Dim g As New GG g.Id = "5" g.Text = "Child class of EE" g.Str = "Added to collection" g.I = 555 g.A = root root.BCol.Add(g) ' create oneToOne object (KK) and add it to root Dim k As New KK k.Id = "6" k.Text = "Child of class HH" k.Str = "Added to oneToOne association" k.I = 666 root.C = k 'save root (class AA) pbroker.GetObject(root) pbroker.PersistChanges() 'Now check that AA, GG and KK are in the database pbroker.ClearCache() Dim col As ArrayList col = pbroker.GetAll(New AA().GetType(), True) Assert.IsTrue(col.Count > 0) For Each injObj As InjectedObject In col Assert.IsTrue(injObj.ReferencedObject.C.GetType Is GetType(KK)) Assert.AreEqual(root.C.Text, injObj.ReferencedObject.C.Text) Assert.IsTrue(injObj.ReferencedObject.BCol.Count > 0) For Each b As BB In injObj.ReferencedObject.BCol Assert.IsTrue(b.GetType Is GetType(GG)) Next Next End Sub <Test()> Public Sub CheckMultiInheritance2() Dim root As New AA root.Id = "1" root.Text = "Root object" root.BCol = New ArrayList ' create G and add it to the collection Dim g As New GG g.Id = "5" g.Text = "Child class of EE" g.Str = "Added to collection" g.I = 555 g.A = root root.BCol.Add(g) ' create oneToOne object (K) and add it to root Dim k As New KK k.Id = "6" k.Text = "Child of class HH" k.Str = "Added to oneToOne association" k.I = 666 root.C = k 'save root (class AA) pbroker.GetObject(root) pbroker.PersistChanges() 'Now check that AA, GG and KK are in the database pbroker.ClearCache() Dim col As ArrayList col = pbroker.GetAll(New AA().GetType(), True) Assert.IsTrue(col.Count > 0) For Each injObj As InjectedObject In col Assert.IsNull(CType(CType(injObj.ReferencedObject.C, KK).M, MM), "Object is not NULL") Assert.IsTrue(injObj.ReferencedObject.BCol.Count > 0) For Each b As BB In injObj.ReferencedObject.BCol Assert.IsTrue(b.GetType Is GetType(GG)) Assert.IsNull(CType(CType(b, GG).M1, MM), "Object is not NULL") Next Next End Sub <Test()> Public Sub CheckMultiInheritance3() Dim col As ArrayList = pbroker.GetAll(New AA().GetType(), True) For Each injObj As InjectedObject In col pbroker.MarkForDeletion(injObj.ReferencedObject, True) pbroker.PersistChanges() Next Dim root As New AA root.Id = "1" root.Text = "Root object" root.BCol = New ArrayList ' create GG and add it to the collection Dim g As New GG g.Id = "5" g.Text = "Child class of GG" g.Str = "test" g.I = 1234 g.A = root root.BCol.Add(g) ' create LL and add it to the collection Dim l As New LL l.Id = "6" l.Str = "Child of class LL" l.I = 666 l.B = g g.NCol.Add(l) Dim o As New OO o.Id = "7" o.I = 9876 o.Str = "Child of class OO" g.M = o 'save root (class AA) pbroker.GetObject(root) pbroker.PersistChanges() 'Now check that AA, GG and KK are in the database pbroker.ClearCache() col = pbroker.GetAll(New AA().GetType(), True) Assert.IsTrue(col.Count > 0) For Each injObj As InjectedObject In col Assert.IsTrue(injObj.ReferencedObject.BCol.Count > 0) For Each b As BB In injObj.ReferencedObject.BCol Assert.IsTrue(b.GetType Is GetType(GG)) Assert.IsTrue(CType(b, GG).M.GetType Is GetType(OO)) Assert.IsTrue(b.NCol.Count > 0) For Each n As NN In b.NCol Assert.IsTrue(n.GetType Is GetType(LL)) Next Next Next End Sub <Test()> Public Sub RetrievalViaParentAttributes() Dim j As New JJ j.I = 1 j.Id = "123" j.Text = "Class CC Text" j.Str = "Class HH Str" pbroker.GetObject(j) pbroker.PersistChanges() j = New JJ Dim rc As New RetrieveCriteria rc.ClassMap = pbroker.GetClassMap(GetType(JJ)) Dim condition As New CriteriaCondition condition.ClassMap = pbroker.GetClassMap(GetType(JJ)) condition.Tables = rc.Tables condition.AddSelectEqualTo("Text", "Class CC Text") rc.WhereCondition = condition Dim cursor As ResultCursor = rc.Perform Assert.IsTrue(cursor.HasElements) Assert.AreEqual(1, cursor.TotalRows) cursor.LoadObject(j) Assert.AreEqual("Class CC Text", j.Text) Assert.AreEqual("Class HH Str", j.Str) Assert.AreEqual("123", j.Id) End Sub <Test()> Public Sub RetrievalViaParentAttributes2() Dim j As New JJ j.I = 1 j.Id = "124" j.Text = "Class CC Text1" j.Str = "Class HH Str" pbroker.GetObject(j) pbroker.PersistChanges(True) j = New JJ Dim rc As New RetrieveCriteria rc.ClassMap = pbroker.GetClassMap(GetType(JJ)) rc.WhereCondition.AddSelectEqualTo("Text", "Class CC Text1") Dim cursor As ResultCursor = rc.Perform Assert.IsTrue(cursor.HasElements) Assert.AreEqual(1, cursor.TotalRows) cursor.LoadObject(j) Assert.AreEqual("Class CC Text1", j.Text) Assert.AreEqual("Class HH Str", j.Str) Assert.AreEqual("124", j.Id) End Sub <Test()> Public Sub MultiRetreiveCreteria() Dim a As AA Dim b As BB Dim n As NN Dim f As FF a = New AA a.Id = "5" a.Text = "Instance of class AA" b = New BB b.Id = "1" b.Text = "Instance of class BB" b.A = a a.BCol.Add(b) n = New NN n.Id = "8" n.I = 7 n.B = b b.NCol.Add(n) pbroker.GetObject(a) pbroker.PersistChanges() pbroker.ClearCache() Dim mrc As MultiRetrieveCriteria Dim a1 As New AA Dim c As ResultCursor mrc = New MultiRetrieveCriteria(a1) mrc.ClassMap = pbroker.GetClassMap(GetType(AA)) mrc.ReturnFullObjects = True mrc.WhereCondition.ClassMap = pbroker.GetClassMap(GetType(AA)) mrc.WhereCondition.AddSelectEqualTo("Id", "5") c = mrc.Perform c.LoadObject(a1) pbroker.GetObject(a1) Assert.AreEqual(1, a1.BCol.Count, "Number of objects in collection are different then 1") End Sub <Test()> Public Sub MultiRetreiveCreteria1() Dim gg As GG = New GG gg.Id = "1" gg.I = 26 gg.Str = "test" gg.Text = "Child of class GG" pbroker.GetObject(gg) pbroker.PersistChanges(gg) gg.Id = "2" gg.I = 55 gg.Str = "test" gg.Text = "Child of class GG" pbroker.GetObject(gg) pbroker.PersistChanges(gg) gg.Id = "3" gg.I = 987 gg.Str = "test1" gg.Text = "Child of class GG" pbroker.GetObject(gg) pbroker.PersistChanges(gg) pbroker.ClearCache() gg = New GG Dim mrc As MultiRetrieveCriteria = New MultiRetrieveCriteria(gg) mrc.ClassMap = pbroker.GetClassMap(GetType(GG)) mrc.ReturnFullObjects = True mrc.WhereCondition.ClassMap = pbroker.GetClassMap(GetType(EE)) mrc.WhereCondition.AddSelectEqualTo("Str", "Test") Dim c As ResultCursor = mrc.Perform Dim list As ArrayList = New ArrayList While (Not c.EOF) c.LoadObject(gg) pbroker.GetObject(gg) list.Add(gg) gg = New GG c.NextCursor() End While Assert.AreEqual(2, list.Count, "Wrong number of objects") End Sub <Test()> Public Sub DeleteObjectAndSuperClass() Dim e As New EE e.Id = "1" e.Str = "test" e.Text = "test2" Dim n As New NN n.Id = "2" n.I = 51 e.NCol.Add(n) n.B = e Me.pbroker.PersistChanges(e) Me.pbroker.ClearCache() Dim col As ArrayList = pbroker.GetAll(New EE().GetType(), True) Assert.IsTrue(col.Count > 0) For Each injObj As InjectedObject In col Me.pbroker.MarkForDeletion(injObj.ReferencedObject, True) Me.pbroker.PersistChanges(injObj.ReferencedObject) Next End Sub <Test()> Public Sub CheckObjectType() Dim e As New EE e.Id = "1" e.Str = "test" e.Text = "test2" Dim n As New NN n.Id = "1" n.I = 51 n.B = e e.NCol.Add(n) n = New NN n.Id = "2" n.I = 52 n.B = e e.NCol.Add(n) Me.pbroker.PersistChanges(e) Me.pbroker.ClearCache() Dim col As ArrayList = pbroker.GetAll(New EE().GetType(), True) Assert.IsTrue(col.Count > 0) For Each injObj As InjectedObject In col Assert.IsNotNull(CType(injObj.ReferencedObject, EE), "Object is of wrong type") Next col = pbroker.GetAll(New EE().GetType(), True) Assert.IsTrue(col.Count > 0) For Each injObj As InjectedObject In col Assert.IsNotNull(CType(injObj.ReferencedObject, EE), "Object is of wrong type") Next End Sub End Class End Namespace Index: NonInheritedTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/StandardClasses/NonInheritedTests.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- NonInheritedTests.vb 1 Apr 2005 00:00:11 -0000 1.9 +++ NonInheritedTests.vb 10 Jul 2005 11:35:38 -0000 1.10 @@ -4,7 +4,7 @@ Namespace StandardClasses <TestFixture()> Public Class NonInheritedTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private job As NPJob Private emp As NPEmployee @@ -23,7 +23,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -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() @@ -257,5 +257,24 @@ Assert.AreEqual(emp1.ReportsToName, emp1.ReportsTo.Name) Assert.AreEqual(0, emp1.ReportsTo.Workers.Count) End Sub + + <Test()> Public Sub GetAll() + Dim list As ArrayList + + list = pbroker.GetAll(emp.GetType(), True) + Assert.IsTrue(list.Count > 0, "No objects have been read from the database") + Assert.AreEqual((CType(list(0), InjectedObject)).ReferencedObject.Name, "ab") + Assert.AreEqual((CType(list(0), InjectedObject)).ReferencedObject.ReportsToName, (CType(list(0), InjectedObject)).ReferencedObject.ReportsTo.Name) + Assert.AreEqual((CType(list(1), InjectedObject)).ReferencedObject.Name, "ac") + Assert.IsTrue((CType(list(1), InjectedObject)).ReferencedObject.Workers.Count > 0) + Assert.AreEqual((CType(list(2), InjectedObject)).ReferencedObject.Name, "aa") + Assert.AreEqual((CType(list(2), InjectedObject)).ReferencedObject.ReportsToName, (CType(list(2), InjectedObject)).ReferencedObject.ReportsTo.Name) + Assert.AreEqual((CType(list(3), InjectedObject)).ReferencedObject.Name, "b") + Assert.AreEqual((CType(list(3), InjectedObject)).ReferencedObject.ReportsToName, (CType(list(3), InjectedObject)).ReferencedObject.ReportsTo.Name) + Assert.AreEqual((CType(list(4), InjectedObject)).ReferencedObject.Name, "a") + Assert.AreEqual((CType(list(4), InjectedObject)).ReferencedObject.ReportsToName, (CType(list(4), InjectedObject)).ReferencedObject.ReportsTo.Name) + Assert.AreEqual((CType(list(5), InjectedObject)).ReferencedObject.Name, "c") + Assert.IsTrue((CType(list(5), InjectedObject)).ReferencedObject.Workers.Count > 0) + End Sub End Class End Namespace \ No newline at end of file Index: NonInheritedRetreiveCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/StandardClasses/NonInheritedRetreiveCriteria.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- NonInheritedRetreiveCriteria.vb 16 Mar 2005 11:34:13 -0000 1.3 +++ NonInheritedRetreiveCriteria.vb 10 Jul 2005 11:35:38 -0000 1.4 @@ -4,12 +4,12 @@ Namespace StandardClasses <TestFixture()> Public Class NonInheritedRetreiveCriteria - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private emp As NPEmployee - Private r As CRetrieveCriteria - Private mr As CMultiRetrieveCriteria - Private c As CCursor - Private injObj As CInjectedObject + 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 @@ -26,7 +26,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -40,7 +40,7 @@ End Sub <Test()> Public Sub SingleClassRetrieve() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(GetType(NPEmployee)) c = r.perform Assert.IsTrue(c.hasElements) @@ -50,7 +50,7 @@ End Sub <Test()> Public Sub LoadFullObjects() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ReturnFullObjects = True r.ClassMap = pbroker.getClassMap(emp.GetType) c = r.perform @@ -69,7 +69,7 @@ End Sub <Test()> Public Sub SimpleOrCriteria() - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(emp.GetType) r.WhereCondition.addSelectEqualTo("Name", "aa") r.WhereCondition.addSelectEqualTo("Name", "b", True) @@ -88,7 +88,7 @@ Dim al As New ArrayList al.Add("aa") al.Add("b") - r = New CRetrieveCriteria + r = New RetrieveCriteria r.ClassMap = pbroker.getClassMap(emp.GetType) r.WhereCondition.addSelectInList("Name", al) c = r.perform @@ -103,23 +103,23 @@ End Sub <Test()> Public Sub SubCriteria() - Dim xx_1 As New CCriteriaCondition - Dim xx_2 As New CCriteriaCondition - Dim xx_3 As New CCriteriaCondition - Dim xx_4 As New CCriteriaCondition + 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 CRetrieveCriteria + 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) + 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 @@ -134,11 +134,11 @@ End Sub <Test()> Public Sub MultiRetrieveTest1() - Dim si As CSelectInCriteria + Dim si As SelectInCriteria - mr = New CMultiRetrieveCriteria(emp) + mr = New MultiRetrieveCriteria(emp) mr.WhereCondition.addSelectEqualTo("Name", "ac") - si = New CSelectInCriteria(emp) + si = New SelectInCriteria(emp) si.WhereCondition.addSelectEqualTo("Name", "ac") si.SetSelectAttribute("Name") mr.WhereCondition.addSelectNotIn("Name", si) |
From: Dan M. <dan...@us...> - 2005-07-10 11:35:47
|
Update of /cvsroot/jcframework/Nunit/Interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6561/Nunit/Interfaces Modified Files: EmployeeInterfaceTests.vb ManyToManyTests.vb TimestampTests.vb Log Message: Add support for standard classes super classes. Add new NUnit test to test standard classes super classes. Index: EmployeeInterfaceTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/Interfaces/EmployeeInterfaceTests.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- EmployeeInterfaceTests.vb 6 Apr 2005 06:32:47 -0000 1.7 +++ EmployeeInterfaceTests.vb 10 Jul 2005 11:35:38 -0000 1.8 @@ -4,7 +4,7 @@ Namespace Interfaces <TestFixture()> Public Class EmployeeInterfaceTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private emp As IEmployee Private eventcount As Integer = 0 @@ -23,7 +23,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub Index: ManyToManyTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/Interfaces/ManyToManyTests.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ManyToManyTests.vb 1 Apr 2005 00:00:10 -0000 1.3 +++ ManyToManyTests.vb 10 Jul 2005 11:35:38 -0000 1.4 @@ -4,7 +4,7 @@ Namespace Interfaces <TestFixture()> Public Class ManyToManyTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private A As iM2MA Private B As iM2MB @@ -24,7 +24,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub @@ -141,7 +141,7 @@ A.GUIDValue = Guid.NewGuid.ToString("N") pbroker.PersistChanges(A) s = "select * from ManyToManyAB where AGuidValue = """ & gvalA & """ and BGuidValue = """ & gvalB & """" - Dim c As CCursor = pbroker.ProcessPureSQL(s, pbroker.getClassMap(GetType(NunitTests.Interfaces.iM2MA)).RelationalDatabase.getConnection(Nothing)) + 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 Index: TimestampTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/Interfaces/TimestampTests.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TimestampTests.vb 1 Apr 2005 00:00:10 -0000 1.1 +++ TimestampTests.vb 10 Jul 2005 11:35:38 -0000 1.2 @@ -4,7 +4,7 @@ Namespace Interfaces <TestFixture()> Public Class TimestampTests - Private pbroker As CPersistenceBroker + Private pbroker As PersistenceBroker Private opt As IOptimistic <TestFixtureSetUp()> Public Sub Init() @@ -22,7 +22,7 @@ End Try End While System.IO.File.Copy(".\original db1.mdb", ".\db1.mdb") - pbroker = New CPersistenceBroker + pbroker = New PersistenceBroker pbroker.init() End Sub |
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5782 Modified Files: AFCustomAttributes.vb AtomsFramework.ndoc AtomsFramework.xml CAssociationTable.vb CCacheEntry.vb CClassMap.vb CColumnMap.vb CCriteriaCondition.vb CCursor.vb CPersistenceBroker.vb CPersistentCollection.vb CQueuedDelete.vb CRelationalDatabase.vb CResultset.vb CRetrieveCriteria.vb CSelectInCriteria.vb CSelectInListCriteria.vb CSummaryCriteria.vb CTableMap.vb CXMLConfigLoader.vb IClassFactory.vb IPersistentObject.vb Log Message: Documentation updates Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- CPersistenceBroker.vb 24 May 2005 07:43:42 -0000 1.111 +++ CPersistenceBroker.vb 25 May 2005 01:26:11 -0000 1.112 @@ -1032,16 +1032,22 @@ statement = cm.GetInsertSqlFor(obj) conn.ProcessStatement(statement) usedInsert = True - PCSQLHits.Increment() - PCUpdates.Increment() + Try + PCSQLHits.Increment() + PCUpdates.Increment() + Catch + End Try Catch Debug.WriteLine("Couldn't insert object in unknown state, trying to update...") Try statement = cm.GetUpdateSqlFor(obj) conn.ProcessStatement(statement) usedInsert = False - PCSQLHits.Increment() - PCUpdates.Increment() + Try + PCSQLHits.Increment() + PCUpdates.Increment() + Catch + End Try Catch Debug.WriteLine("Couldn't update object in unknown state, throwing initial exception") Throw Index: IPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IPersistentObject.vb,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- IPersistentObject.vb 24 May 2005 07:43:44 -0000 1.16 +++ IPersistentObject.vb 25 May 2005 01:26:13 -0000 1.17 @@ -796,10 +796,10 @@ '''<remarks>The event indicates that the object has been dirtied by changing one of it's properties or that the dirty flag has been manually set.</remarks> Event MarkedAsDirty As EventHandler '''<summary>Fires when object retrieval commences</summary> - ''<remarks> </remarks> + '''<remarks> </remarks> Event LoadStarted As EventHandler '''<summary>Fires when object retrieval has completed</summary> - ''<remarks> </remarks> + '''<remarks> </remarks> Event LoadFinished As EventHandler End Interface Index: CSelectInListCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CSelectInListCriteria.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CSelectInListCriteria.vb 20 May 2005 06:03:42 -0000 1.4 +++ CSelectInListCriteria.vb 25 May 2005 01:26:12 -0000 1.5 @@ -17,6 +17,17 @@ Public Class SelectInListCriteria Inherits SelectionCriteria + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Adds an IN() clause to an SQL Statement. + ''' </summary> + ''' <param name="statement">The statement to modify</param> + ''' <remarks>Adds an sql clause in the form of "IN (x,y,z)" where the comma separated values are obtained from the collection referenced by ValueA. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overrides Sub FillSqlStatement(ByVal statement As AtomsSqlStatement) If TableAlias.Length = 0 Then statement.AddSqlClause(AttrMap.ColumnMap.GetFullyQualifiedName & ClassMap.RelationalDatabase.GetClauseStringInList(ValueA)) Index: CAssociationTable.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CAssociationTable.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CAssociationTable.vb 24 May 2005 07:43:42 -0000 1.4 +++ CAssociationTable.vb 25 May 2005 01:26:11 -0000 1.5 @@ -44,7 +44,7 @@ ''' <summary> ''' The database owner of the table. If not specified the database provider will normally default to "dbo" ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> Index: IClassFactory.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IClassFactory.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- IClassFactory.vb 20 May 2005 06:03:42 -0000 1.2 +++ IClassFactory.vb 25 May 2005 01:26:13 -0000 1.3 @@ -2,7 +2,7 @@ ''' <summary> ''' Interface for class factories used by the framework ''' </summary> -''' <returns></returns> +''' <returns> </returns> ''' <remarks>For each interface you wish to persist to the database a class factory must be provided. Those class factories must impement ''' this interface in order to work. ''' <para>The interface itself is pretty simple and contains a single function called CreateObject that must be implemented.</para> Index: CQueuedDelete.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CQueuedDelete.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CQueuedDelete.vb 11 Apr 2005 00:31:44 -0000 1.2 +++ CQueuedDelete.vb 25 May 2005 01:26:12 -0000 1.3 @@ -13,6 +13,17 @@ Friend Class QueuedDelete Private m_object As IPersistableObject + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The object that is to be deleted. + ''' </summary> + ''' <returns> </returns> + ''' <remarks>A simple property to keep track of the object we need to delete. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property ObjectToDelete() As IPersistableObject Get Return m_object Index: AtomsFramework.ndoc =================================================================== RCS file: /cvsroot/jcframework/dotnet/AtomsFramework.ndoc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- AtomsFramework.ndoc 24 May 2005 07:43:31 -0000 1.4 +++ AtomsFramework.ndoc 25 May 2005 01:26:10 -0000 1.5 @@ -23,14 +23,8 @@ <property name="Title" value="AtomsFramework Persistence Layer Reference Guide" /> <property name="ShowVisualBasic" value="True" /> <property name="SdkLinksOnWeb" value="True" /> - <property name="FooterHtml" value="(c) Copyright, Richard Banks, 2005. Licensed using the LGPL License<br>This project is hosted by Sourceforge <a href="http://sourceforge.net/projects/jcframework"> <IMG src="http://sourceforge.net/sflogo.php?group_id=61771&type=5" width="105" height="31" border="0" alt="SourceForge.net Logo" /></a>" /> - <property name="ShowMissingSummaries" value="True" /> - <property name="ShowMissingRemarks" value="True" /> - <property name="ShowMissingParams" value="True" /> - <property name="ShowMissingReturns" value="True" /> - <property name="ShowMissingValues" value="True" /> + <property name="FooterHtml" value="<p>(c) Copyright, Richard Banks, 2005. Licensed for use under the <a href="http://www.gnu.org/copyleft/lesser.html">LGPL License</a></p><p>The AtomsFramework project is hosted by Sourceforge <a href="http://sourceforge.net/projects/jcframework"> <IMG src="http://sourceforge.net/sflogo.php?group_id=61771&type=5" width="105" height="31" border="0" alt="SourceForge.net Logo" align="absMiddle"/></a></p><p>Documentation for %ASSEMBLY_NAME% [%ASSEMBLY_VERSION%] is built with <a href="http://ndoc.sourceforge.net/">NDoc</a></p>" /> <property name="AssemblyVersionInfo" value="AssemblyVersion" /> - <property name="CopyrightText" value="(c) Copyright, Richard Banks, 2005. Licensed using the LGPL License" /> <property name="FeedbackEmailAddress" value="rba...@ms..." /> <property name="UseNamespaceDocSummaries" value="True" /> <property name="Preliminary" value="True" /> @@ -44,10 +38,13 @@ </documenter> <documenter name="VS.NET 2003"> <property name="OutputDirectory" value=".\doc2\" /> - <property name="HtmlHelpName" value="AtomsFramework Documentation" /> + <property name="HtmlHelpName" value="AtomsFramework" /> <property name="Title" value="AtomsFramework Documentation" /> - <property name="CollectionNamespace" value="Atoms.Framework" /> + <property name="CollectionNamespace" value="AtomsFramework" /> <property name="GenerateCollectionFiles" value="True" /> + <property name="PlugInNamespace" value="ms.vscc.2003" /> + <property name="Version" value="2.2.0.0" /> + <property name="FooterHtml" value="<p>(c) Copyright, Richard Banks, 2005. Licensed for use under the <a href="http://www.gnu.org/copyleft/lesser.html">LGPL License</a></p><p>The AtomsFramework project is hosted by Sourceforge <a href="http://sourceforge.net/projects/jcframework"> <IMG src="http://sourceforge.net/sflogo.php?group_id=61771&type=5" width="105" height="31" border="0" alt="SourceForge.net Logo" align="absMiddle"/></a></p><p>Documentation for %ASSEMBLY_NAME% [%ASSEMBLY_VERSION%] is built with <a href="http://ndoc.sourceforge.net/">NDoc</a></p>" /> <property name="AssemblyVersionInfo" value="AssemblyVersion" /> <property name="UseNamespaceDocSummaries" value="True" /> </documenter> Index: CRelationalDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CRelationalDatabase.vb,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CRelationalDatabase.vb 24 May 2005 07:43:44 -0000 1.25 +++ CRelationalDatabase.vb 25 May 2005 01:26:12 -0000 1.26 @@ -1263,7 +1263,8 @@ ''' See <see cref="P:AtomsFramework.IRelationalDatabase.GetClauseStringTableAlias">IRelationalDatabase</see>. ''' </summary> ''' <param name="table"> </param> - ''' <param name="aliasName"> </param> + ''' <param name="owner"> </param> + ''' <param name="aliasValue"> </param> ''' <returns> </returns> ''' <remarks> </remarks> ''' <history> @@ -1384,8 +1385,29 @@ GC.SuppressFinalize(Me) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes the database + ''' </summary> + ''' <param name="disposing"> </param> + ''' <remarks>Must be overriden by subclasses. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected MustOverride Overloads Sub Dispose(ByVal disposing As Boolean) + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Finalizes the database after disposal. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub Finalize() Dispose(False) MyBase.Finalize() Index: CCriteriaCondition.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCriteriaCondition.vb,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- CCriteriaCondition.vb 24 May 2005 07:43:42 -0000 1.23 +++ CCriteriaCondition.vb 25 May 2005 01:26:11 -0000 1.24 @@ -51,7 +51,7 @@ ''' <summary> ''' Indicates wether the condition should be appended to the parent condition using OR or AND ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> Index: CSelectInCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CSelectInCriteria.vb,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- CSelectInCriteria.vb 24 May 2005 07:43:44 -0000 1.11 +++ CSelectInCriteria.vb 25 May 2005 01:26:12 -0000 1.12 @@ -145,6 +145,16 @@ Me.ClassMap = obj.GetClassMap(obj) End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Creates a new instance of the SelectInCriteria and sets the primary object. + ''' </summary> + ''' <param name="obj">The object to use in the sub-query.</param> + ''' <remarks> </remarks> + ''' <history> + ''' [rbanks] 17/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub New(ByVal obj As Object) Me.New() Dim injObj As InjectedObject @@ -283,7 +293,7 @@ If m_joins Is Nothing Then statement.AddSqlClause(Me.Tables(1).Name) Else - statement.AddSqlClause(m_joins.GetSQLString) + statement.AddSqlClause(m_joins.GetSqlString) End If 'Need to set correct table aliases for the selection criteria in the where condition Index: CXMLConfigLoader.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CXMLConfigLoader.vb,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- CXMLConfigLoader.vb 24 May 2005 07:43:44 -0000 1.36 +++ CXMLConfigLoader.vb 25 May 2005 01:26:13 -0000 1.37 @@ -93,7 +93,7 @@ ''' <summary> ''' Creates a new instance of the Class and sets the FileName property. ''' </summary> - ''' <param name="xmlFile"></param> + ''' <param name="xmlFile">The file containing the XML mappings</param> ''' <remarks> </remarks> ''' <history> ''' [rbanks] 18/12/2003 Created Index: AFCustomAttributes.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/AFCustomAttributes.vb,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- AFCustomAttributes.vb 20 May 2005 06:03:36 -0000 1.10 +++ AFCustomAttributes.vb 25 May 2005 01:26:09 -0000 1.11 @@ -90,7 +90,7 @@ ''' <summary> ''' Gets the database table name of the mapped class ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -107,7 +107,7 @@ ''' <summary> ''' Gets the database name for the mapped class ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The returned value is the name of the database from the XML file and is ''' not the physical database server name ''' </remarks> @@ -125,7 +125,7 @@ ''' <summary> ''' Returns the database key type. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -142,7 +142,7 @@ ''' <summary> ''' The table owner for the mapped class. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The table owner defaults to "dbo" and is only used in databases where ''' ownership information is included in the table naming (ie MSSQL, etc) ''' </remarks> @@ -163,7 +163,7 @@ ''' <summary> ''' The parent class for this class ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>Database mappings will be inherited from the parent class. ''' </remarks> ''' <history> @@ -183,7 +183,7 @@ ''' <summary> ''' Indicates that the class is readonly. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>Attempting to save objects of this class will cause an exception to ''' be thrown. ''' </remarks> @@ -205,7 +205,7 @@ ''' Indicates that the class allows existing objects to be saved, but that no new objects ''' can be created. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>If an object of this class is created and then saved and exception will be ''' thrown. Objects that are already persistent can be saved without error. ''' </remarks> @@ -226,7 +226,7 @@ ''' <summary> ''' The database column used to store the created date timestamp ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -246,7 +246,7 @@ ''' <summary> ''' The database column used to store the modified date timestamp. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -266,7 +266,7 @@ ''' <summary> ''' The database column used to store to object ID value. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This is only required when the key type for the table is useOIDValue ''' </remarks> ''' <history> @@ -286,7 +286,7 @@ ''' <summary> ''' The database column used to store to GUID value. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This is only required when the key type for the table is useGUIDValue ''' </remarks> ''' <history> @@ -306,7 +306,7 @@ ''' <summary> ''' The key field to reference in the parent class. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>When a class inherits from a super class there must be a link between the ''' two classes. This attribute is used to define the linkage between the sub class and the ''' parent class @@ -329,7 +329,7 @@ ''' <summary> ''' The database column used to differentiate between parent and child classes. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>When a parent and child class share the same database table instead ''' of having separate tables a column in the table is used to flag wether the ''' record in question is an instance of the parent class or the child class. @@ -353,7 +353,7 @@ ''' <summary> ''' The value to check for in the SharedTableField ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>When a parent and child classes share the same database table the ''' SharedTableField is checked and if the value of the column matches the value ''' specified here then the record belongs to this class. @@ -420,7 +420,7 @@ ''' <summary> ''' The database column an attribute maps to. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -437,7 +437,7 @@ ''' <summary> ''' Indicates if this column is part of the tables key fields. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This flag only needs to be set if the table key is not an OID or GUID column. ''' Also, this flag may be set against multiple properties to build a multipart key. ''' </remarks> @@ -458,7 +458,7 @@ ''' <summary> ''' The field in the parent class that this attribute references ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>To maintain the linkage between a sub class and a super class a reference ''' from the subclasses properties to the parent class must be present. This attribute property ''' maps the sub class property to the super class property. @@ -480,7 +480,7 @@ ''' <summary> ''' Indicates that the field participates in Find operations. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -522,7 +522,7 @@ ''' <summary> ''' Indicates that the mapped column is an identity column ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -591,7 +591,7 @@ ''' <summary> ''' ReadOnly. The class the association links to. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -608,7 +608,7 @@ ''' <summary> ''' ReadOnly. The property in this class that stores the association. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>For 1:1 associations the property is typically a reference to an object ''' of the target class. ''' <para>For 1:M associations the property must be an reference to a PersistentObjectCollection @@ -628,7 +628,7 @@ ''' <summary> ''' ReadOnly. The cardinality of the association. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>Possible values are OneToOne or OneToMany. To support Many to Many (N:M) ''' associations you should create two OneToMany associations, one for each class linking ''' to the other. @@ -647,7 +647,7 @@ ''' <summary> ''' The name of the association ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>When there are multiple associations between two classes this property can ''' be used to distinguish between the associations. If the value is not set then the name ''' of the targetproperty is used as the name for the association. @@ -670,7 +670,7 @@ ''' Inidicates that any associated objects should be automatically deleted when an object of this ''' class is deleted. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -691,7 +691,7 @@ ''' Indicates that any associated objects should be automatically saved when an object ''' of this class is saved. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -712,7 +712,7 @@ ''' Indicates that any associated objects should be automatically retrieved when an object ''' of this class is retrieved. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -733,7 +733,7 @@ ''' Indicates that proxy objects should be retrieved when an object's ''' associated objects are retrieved. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -798,7 +798,7 @@ ''' <summary> ''' ReadOnly. The name of the association this pairing belongs to. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -815,7 +815,7 @@ ''' <summary> ''' ReadOnly. The name of a property in this class. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -832,7 +832,7 @@ ''' <summary> ''' ReadOnly. The name of a property in the target class. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> Index: CCacheEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCacheEntry.vb,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- CCacheEntry.vb 24 May 2005 07:43:42 -0000 1.35 +++ CCacheEntry.vb 25 May 2005 01:26:11 -0000 1.36 @@ -204,7 +204,7 @@ ''' <summary> ''' Creates a string representation of the cache entry ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The string returned by this method shows the state of the cache entry, and provides ''' and indication of the referenced object using the objects type name and the key properties of the object. ''' </remarks> @@ -1056,7 +1056,7 @@ ''' <summary> ''' Indicates if the cache is currently loading new objects. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This flag controls the behaviour of the cache when returning objects. If the flag is true then the cache will return object references to the cached object. ''' When the flag is false, copies of the cached object are made and a reference to the copied object is returned. ''' </remarks> @@ -1111,7 +1111,7 @@ ''' <summary> ''' Produces a string that represents the current state of the cache. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The method is useful for debugging purposes. ''' </remarks> ''' <history> @@ -1164,7 +1164,7 @@ ''' <summary> ''' Get an ArrayList containing the objects currently in the cache. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This method is useful for debugging purposes if you wish to see what the current contents of the cache are. ''' It is not recommended that this method be used for any other purpose. ''' </remarks> @@ -1185,7 +1185,7 @@ ''' <summary> ''' Get an ArrayList containing the keys of the cache entries currently in the cache. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This method is useful for debugging purposes but is not recommended for any other use. ''' </remarks> ''' <history> Index: CTableMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CTableMap.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CTableMap.vb 24 May 2005 07:43:44 -0000 1.9 +++ CTableMap.vb 25 May 2005 01:26:13 -0000 1.10 @@ -67,7 +67,7 @@ ''' <summary> ''' The database usercode of the table owner ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This value is used in databases that can specify tables using the owner ''' (ie MSSQL, etc but not MSAccess). ''' </remarks> Index: CPersistentCollection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentCollection.vb,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- CPersistentCollection.vb 24 May 2005 10:35:34 -0000 1.22 +++ CPersistentCollection.vb 25 May 2005 01:26:12 -0000 1.23 @@ -26,8 +26,42 @@ Private m_container As PersistentObject + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Event to indicate the collection has been changed (dirtied) + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event ItemDirtied As EventHandler + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Occurs when an object is removed from the collection. + ''' </summary> + ''' <param name="index">Index of the object that was removed</param> + ''' <param name="value">The removed object</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event ObjectRemoved(ByVal index As Integer, ByRef value As Object) + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Occurs when an object is added to the collection. + ''' </summary> + ''' <param name="index">Index where the object was added</param> + ''' <param name="value">The object that was added</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event ObjectAdded(ByVal index As Integer, ByRef value As Object) #Region "Collection Properties and Methods" @@ -74,7 +108,7 @@ ''' <summary> ''' Adds an item to the collection. ''' </summary> - ''' <param name="cp">A PersistentObject to be added.</param> + ''' <param name="value">A PersistentObject to be added.</param> ''' <remarks>The persistent object is added to the collection. If the container ''' object reference is set then the dirty flag on the container object is set.</remarks> ''' <history> @@ -157,10 +191,10 @@ ''' ----------------------------------------------------------------------------- ''' <summary> - ''' + ''' Inserts a PersistentObject into the collection ''' </summary> - ''' <param name="index"></param> - ''' <param name="value"></param> + ''' <param name="index">The position in the collection to insert into</param> + ''' <param name="value">The object to insert</param> ''' <remarks> ''' </remarks> ''' <history> @@ -171,13 +205,11 @@ list.Insert(index, value) End Sub - - '''----------------------------------------------------------------------------- ''' <summary> ''' Attempts to save each item in the collection ''' </summary> - ''' <value>An integer containing the number of objects that were actually saved.</value> + ''' <returns>An integer containing the number of objects that were actually saved.</returns> ''' <remarks>Each item in the collection is saved. If an error occurs during the saving ''' of any object the process is immediately aborted and an exception is thrown. ''' All objects are saved as part of a single transaction and the transaction is rolled back @@ -248,10 +280,32 @@ #End Region #Region "IBindlingList" + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.AddIndex + ''' </summary> + ''' <param name="property"> </param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Sub AddIndex(ByVal [property] As System.ComponentModel.PropertyDescriptor) Implements System.ComponentModel.IBindingList.AddIndex End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.AddNew + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Function AddNew() As Object Implements System.ComponentModel.IBindingList.AddNew End Function @@ -273,66 +327,212 @@ End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of IBindingList.AllowNew + ''' </summary> + ''' <returns>False</returns> + ''' <remarks>To allow new items to be added to your collection through data binding override this method and return true. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property AllowNew() As Boolean Implements System.ComponentModel.IBindingList.AllowNew Get Return False End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of IBindingList.AllowRemove + ''' </summary> + ''' <returns>False</returns> + ''' <remarks>To allow existing items to be removed from your collection through data binding, override this method and return true. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property AllowRemove() As Boolean Implements System.ComponentModel.IBindingList.AllowRemove Get Return False End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindlingList.ApplySort + ''' </summary> + ''' <param name="property"> </param> + ''' <param name="direction"> </param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Sub ApplySort(ByVal [property] As System.ComponentModel.PropertyDescriptor, ByVal direction As System.ComponentModel.ListSortDirection) Implements System.ComponentModel.IBindingList.ApplySort End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.Find + ''' </summary> + ''' <param name="property"> </param> + ''' <param name="key"> </param> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Function Find(ByVal [property] As System.ComponentModel.PropertyDescriptor, ByVal key As Object) As Integer Implements System.ComponentModel.IBindingList.Find End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindlingList.IsSorted. + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property IsSorted() As Boolean Implements System.ComponentModel.IBindingList.IsSorted Get End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Event definition for IBindingList.ListChanged + ''' </summary> + ''' <param name="sender">The object that fired the event</param> + ''' <param name="e">ListChangedEventArgs arguments</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Implements System.ComponentModel.IBindingList.ListChanged + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.RemoveIndex + ''' </summary> + ''' <param name="property"> </param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Sub RemoveIndex(ByVal [property] As System.ComponentModel.PropertyDescriptor) Implements System.ComponentModel.IBindingList.RemoveIndex End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.RemoveSort + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Sub RemoveSort() Implements System.ComponentModel.IBindingList.RemoveSort End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.SortDirection + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property SortDirection() As System.ComponentModel.ListSortDirection Implements System.ComponentModel.IBindingList.SortDirection Get End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Stub method for IBindingList.SortProperty + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property SortProperty() As System.ComponentModel.PropertyDescriptor Implements System.ComponentModel.IBindingList.SortProperty Get End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of IBindingList.SupportsChangeNotification + ''' </summary> + ''' <returns>True</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property SupportsChangeNotification() As Boolean Implements System.ComponentModel.IBindingList.SupportsChangeNotification Get Return True End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of IBindingList.SupportsSearching + ''' </summary> + ''' <returns>False</returns> + ''' <remarks>If you implement searching in your collection, override this method to return True. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property SupportsSearching() As Boolean Implements System.ComponentModel.IBindingList.SupportsSearching Get Return False End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of IBindingList.SupportsSorting + ''' </summary> + ''' <returns>False</returns> + ''' <remarks>If you implement sorting in your collection, override this method to return True. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property SupportsSorting() As Boolean Implements System.ComponentModel.IBindingList.SupportsSorting Get Return False @@ -341,6 +541,19 @@ #End Region #Region "Collection Events" + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Overrides CollectionBase.OnInsertComplete + ''' </summary> + ''' <param name="index">The index inserted</param> + ''' <param name="value">The object inserted</param> + ''' <remarks>Adds event handlers for the RemoveMe and ItemDirtied events for the inserted object. Also fires to ListChanged and ObjectAdded events and sets + ''' the container object to dirty (if it exists). + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub OnInsertComplete(ByVal index As Integer, ByVal value As Object) AddHandler CType(value, PersistentObject).RemoveMe, AddressOf Remove AddHandler CType(value, PersistentObject).MarkedAsDirty, AddressOf ItemDirtiedHandler @@ -351,10 +564,32 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Overrides the CollectionBase.OnClearComplete method + ''' </summary> + ''' <remarks>Fires the ListChanged event with appropriate arguments + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub OnClearComplete() RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.Reset, 0)) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Overrides the CollectionBase.OnRemovedComplete method + ''' </summary> + ''' <param name="index">The index where the object was removed</param> + ''' <param name="value">The object that was removed</param> + ''' <remarks>Fires the ListChanged and ObectRemoved events and sets the container object dirty flag. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub OnRemoveComplete(ByVal index As Integer, ByVal value As Object) RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemDeleted, index)) RaiseEvent ObjectRemoved(index, value) @@ -363,10 +598,33 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Overrides the CollectionBase.OnSetComplete + ''' </summary> + ''' <param name="index">The zero-based index at which oldValue can be found.</param> + ''' <param name="oldValue">The value to replace with newValue.</param> + ''' <param name="newValue">The new value of the element at index.</param> + ''' <remarks>Fires the ListChanged event + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub OnSetComplete(ByVal index As Integer, ByVal oldValue As Object, ByVal newValue As Object) RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemChanged, index)) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Overrides the CollectionBase.OnClear method + ''' </summary> + ''' <remarks>Removes the MarkedAsDirty event handler for every object in the list. + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub OnClear() For Each cp As PersistentObject In list RemoveHandler cp.MarkedAsDirty, AddressOf ItemDirtiedHandler @@ -375,19 +633,53 @@ #End Region #Region "IComponent Interface" + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implements the IComponent.Disposed method + ''' </summary> + ''' <param name="sender">The object being disposed</param> + ''' <param name="e">EventArgs (empty)</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Implements IComponent.Disposed Private m_curCPCSite As ISite + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of the IComponent.Site property + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Property Site() As System.ComponentModel.ISite Implements IComponent.Site Get Return m_curCPCSite End Get Set(ByVal value As System.ComponentModel.ISite) - m_curCPCSite = Value + m_curCPCSite = value End Set End Property Private m_disposed As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes the collection. + ''' </summary> + ''' <param name="disposing"> </param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then @@ -396,6 +688,16 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes the collection. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub Dispose() Implements System.IDisposable.Dispose Dispose(True) GC.SuppressFinalize(Me) Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- CClassMap.vb 24 May 2005 07:43:42 -0000 1.60 +++ CClassMap.vb 25 May 2005 01:26:11 -0000 1.61 @@ -194,7 +194,7 @@ ''' <summary> ''' The number of associations originating with this class ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The association map count includes the count of all association types and includes associations fo any super classes. ''' </remarks> ''' <history> @@ -217,7 +217,7 @@ ''' <summary> ''' Retrieves an association map based on it's name. ''' </summary> - ''' <param name="mapname">The name of the association map to retrieve</param> + ''' <param name="mapName">The name of the association map to retrieve</param> ''' <returns>An association map (if found) or nothing</returns> ''' <remarks>Returns the association map based on the name supplied. If no matching ''' association map can be found then Nothing is returned. @@ -460,7 +460,7 @@ ''' <summary> ''' The field that is used to differentiate between parent classes and sub classes ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This property is used when a parent class and sub classes share the same ''' database table. The value from the SharedTableValue property is checked against the ''' SharedTableField and if the value matches then the record in the database belongs @@ -483,7 +483,7 @@ ''' <summary> ''' The value of the SharedTableField that indicates a record belongs to this class ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -1951,7 +1951,7 @@ ''' </summary> ''' <param name="broker">An instance of the persistence broker.</param> ''' <param name="parameters">A collection of parameters to pass</param> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>A shell SQL find is built and saved in the class map. ''' <para>This SQL shell is then processed and parameter placeholders and values are substituted into the AtomsSqlStatement..</para> ''' </remarks> @@ -2089,7 +2089,7 @@ ''' </summary> ''' <param name="broker">An instance of the persistence broker.</param> ''' <param name="parameters">A collection of parameters to pass</param> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>A shell SQL find is built and saved in the class map. ''' <para>This SQL shell is then processed and parameter placeholders and values are substituted into the AtomsSqlStatement..</para> ''' </remarks> @@ -2233,7 +2233,7 @@ ''' <summary> ''' A reference to the first Join object in a Join Set. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This is used for internal purposes only. ''' </remarks> ''' <history> @@ -2250,7 +2250,7 @@ ''' <summary> ''' Creates an instance of the class mapped by the ClassMap object. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -2266,7 +2266,7 @@ ''' Creates an instance of the class mapped by the ClassMap object ''' </summary> ''' <param name="setStrongReference">Wether a strong reference to the object should be created.</param> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The strong reference was to be used for better control of non-inherited objects during persistence however this functionality ''' was cancelled. The method remains for now. ''' </remarks> Index: CResultset.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CResultset.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CResultset.vb 24 May 2005 07:43:44 -0000 1.7 +++ CResultset.vb 25 May 2005 01:26:12 -0000 1.8 @@ -76,6 +76,17 @@ End Sub Private m_disposed As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes the object + ''' </summary> + ''' <param name="disposing"> </param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Private Overloads Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then @@ -89,6 +100,16 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes the object + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub Dispose() Implements System.IDisposable.Dispose Me.Dispose(True) GC.SuppressFinalize(Me) Index: CRetrieveCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CRetrieveCriteria.vb,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CRetrieveCriteria.vb 24 May 2005 07:43:44 -0000 1.15 +++ CRetrieveCriteria.vb 25 May 2005 01:26:12 -0000 1.16 @@ -144,7 +144,7 @@ ''' <summary> ''' Returns a new CriteriaCondition. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The current objects classmap, tables and associations are referenced in the returned CriteriaCondition object.</remarks> ''' <history> ''' [rbanks] 17/12/2003 Created @@ -163,7 +163,7 @@ ''' <summary> ''' Generates an SQL statement based on the properties of this object. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The SQL statement returned will be a select statement for full objects ''' based on the criteria specified in this object.</remarks> ''' <history> @@ -179,7 +179,7 @@ ''' Generates an SQL statement based on the properties of this object. ''' </summary> ''' <param name="fullObjects">flag to return full objects or proxy objects.</param> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>The SQL statement returned will be a select statement based on the criteria ''' specified in this object. ''' <para>The data returned will contain all neccesary columns for instantiating Index: CCursor.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCursor.vb,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CCursor.vb 24 May 2005 07:43:42 -0000 1.20 +++ CCursor.vb 25 May 2005 01:26:11 -0000 1.21 @@ -160,7 +160,7 @@ ''' <summary> ''' ReadOnly. The number of datarows contained in the Cursors ResultSet. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -199,7 +199,7 @@ ''' <summary> ''' The PersistentCriteria that was used to create this cursor. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>If the cursor is created by using ProcessDirectSQL then this property ''' will return Nothing. ''' </remarks> @@ -216,6 +216,24 @@ End Set End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Populates an object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <remarks>This method will fully populate an object regardless of the wether + ''' the ResultCursor references only proxy data or not. If the ResultCursor contains + ''' proxy only data, then the proxy version of the object is populated. The full object is then + ''' retrieved using the normal retrieve method for CPersistentObjects. + ''' <para>If the resultset contains complete object information then the method will + ''' populate all of the mapped attributes for the object and no further database + ''' interaction will occur.</para> + ''' <para>Note: Objects retrieved in this manner will not be added to the cache. Also, + ''' object associations will not be traversed, including those marked as automatic retrieve.</para></remarks> + ''' <history> + ''' [rbanks] 4/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub LoadObject(ByRef obj As Object) If obj.GetType.IsSubclassOf(GetType(PersistentObject)) Then LoadPersistentObject(obj) @@ -252,6 +270,25 @@ End If End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Populates an object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <param name="offset">The index of the object to use as a data source. Only used in MultiRetrieveCriteria.</param> + ''' <remarks>This method will fully populate an object regardless of the wether + ''' the ResultCursor references only proxy data or not. If the ResultCursor contains + ''' proxy only data, then the proxy version of the object is populated. The full object is then + ''' retrieved using the normal retrieve method for CPersistentObjects. + ''' <para>If the resultset contains complete object information then the method will + ''' populate all of the mapped attributes for the object and no further database + ''' interaction will occur.</para> + ''' <para>Note: Objects retrieved in this manner will not be added to the cache. Also, + ''' object associations will not be traversed, including those marked as automatic retrieve.</para></remarks> + ''' <history> + ''' [rbanks] 4/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub LoadObject(ByRef obj As InjectedObject, ByVal offset As Integer) Dim _alias As String = "" Dim mr As MultiRetrieveCriteria @@ -302,6 +339,28 @@ End If End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Populates an object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <remarks>This method will fully populate an object regardless of the wether + ''' the ResultCursor references only proxy data or not. If the ResultCursor contains + ''' proxy only data, then the proxy version of the object is populated. The full object is then + ''' retrieved using the normal retrieve method for CPersistentObjects. + ''' <para>If the resultset contains complete object information then the method will + ''' populate all of the mapped attributes for the object and no further database + ''' interaction will occur.</para> + ''' <para>Note: Objects retrieved in this manner will not be added to the cache. Also, + ''' object associations will not be traversed, including those marked as automatic retrieve.</para> + ''' <para>The offset allows for the retrieval of the nth instance of an object and + ''' is useful when there is are multiple instances of the same class in a single cursor + ''' data row (ie when there are circular references in the retrieve criteria).</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 4/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub LoadPersistentObject(ByRef obj As PersistentObject) LoadPersistentObject(obj, 0) End Sub @@ -395,6 +454,28 @@ LoadObject(obj, broker, 0) End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Populates an object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <param name="broker">A reference to the persistence broker.</param> + ''' <param name="offset">The offset for the object to load. Used in MultiRetrieveCriteria when the same class is referenced mutliple times.</param> + ''' <remarks>This method will fully populate an object regardless of the wether + ''' the ResultCursor references only proxy data or not. If the ResultCursor contains + ''' proxy only data, then the proxy version of the object is populated. The full object is then + ''' retrieved using the normal retrieve method for CPersistentObjects. + ''' <para>If the resultset contains complete object information then the method will + ''' populate all of the mapped attributes for the object and no further database + ''' interaction will occur.</para> + ''' <para>Note: Since we have a reference to the persistence broker retrieved objects will be + ''' added to the cache. Further to this, all object associations will also be processed as per + ''' a normal retrieve operation.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 4/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub LoadObject(ByRef obj As PersistentObject, ByRef broker As PersistenceBroker, ByVal offset As Integer) Dim _alias As String = "" @@ -458,6 +539,18 @@ LoadProxy(injobj) End If End Sub + + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Loads a proxy version of the object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <remarks>Populates the attributes in the object that are marked as proxy="True" + ''' in the XML mapping.</remarks> + ''' <history> + ''' [rbanks] 4/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub LoadProxy(ByRef obj As IPersistableObject) If Not obj.IsIPersistentObject Then LoadProxy(obj, 0) @@ -465,6 +558,19 @@ LoadPersistentProxy(obj, 0) End If End Sub + + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Loads a proxy version of the object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <param name="offset">The index of the source data. Used when the same class is used in a MultiRetrieveCriteria multiple times.</param> + ''' <remarks>Populates the attributes in the object that are marked as proxy="True" + ''' in the XML mapping.</remarks> + ''' <history> + ''' [rbanks] 4/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub LoadProxy(ByRef obj As InjectedObject, ByVal offset As Integer) Dim _alias As String = "" Dim cm As MultiRetrieveCriteria @@ -486,6 +592,18 @@ End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Loads a proxy version of the object based on the data at the current cursor position. + ''' </summary> + ''' <param name="obj">The object to populate. Must already be instantiated.</param> + ''' <param name="offset">The index of the source data. Used when the same class is used in a MultiRetrieveCri... [truncated message content] |
From: Richard B. <rb...@us...> - 2005-05-24 10:36:02
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12359 Modified Files: CPersistentCollection.vb Log Message: Documentation update Index: CPersistentCollection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentCollection.vb,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- CPersistentCollection.vb 20 May 2005 06:03:41 -0000 1.21 +++ CPersistentCollection.vb 24 May 2005 10:35:34 -0000 1.22 @@ -53,6 +53,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Count of the objects in the collection + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [Richard Banks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Shadows ReadOnly Property Count() As Integer Get Return MyBase.Count @@ -128,10 +139,34 @@ End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Copies the contents of the collection to an array + ''' </summary> + ''' <param name="array">The array to copy to</param> + ''' <param name="index">The starting point in the array</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [Richard Banks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub CopyTo(ByVal array As PersistentObject(), ByVal index As Integer) list.CopyTo(array, index) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' + ''' </summary> + ''' <param name="index"></param> + ''' <param name="value"></param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [Richard Banks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub Insert(ByVal index As Integer, ByVal value As PersistentObject) list.Insert(index, value) End Sub @@ -167,7 +202,7 @@ End If End If Catch ex As Exception - pb.RollBack() + pb.Rollback() Throw New SaveException(ex.Message, ex) End Try Next @@ -196,7 +231,7 @@ Try cp.Delete() Catch ex As Exception - pb.RollBack() + pb.Rollback() Throw New DeleteException(ex.Message, ex) End Try Next @@ -221,6 +256,17 @@ End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Implementation of IBindingList.AllowEdit + ''' </summary> + ''' <returns>False</returns> + ''' <remarks>Override for specific collections if you wish to enable editing in your strongly typed collections + ''' </remarks> + ''' <history> + ''' [Richard Banks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- <Browsable(False)> Public Overridable ReadOnly Property AllowEdit() As Boolean Implements System.ComponentModel.IBindingList.AllowEdit Get Return False |
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8086 Modified Files: AtomsFramework.ndoc AtomsFramework.xml CAssociationKey.vb CAssociationTable.vb CCacheEntry.vb CClassMap.vb CColumnMap.vb CConnection.vb CCriteriaCondition.vb CCursor.vb CDatabaseMap.vb CInjectedObject.vb CJoin.vb CMultiRetrieveCriteria.vb CMultiSummaryCriteria.vb COID.vb COrderEntry.vb CPersistenceBroker.vb CPersistentCriteria.vb CPersistentObject.vb CRelationalDatabase.vb CResultset.vb CRetrieveCriteria.vb CSelectInCriteria.vb CSelectionCriteria.vb CSqlStatement.vb CSummaryCriteria.vb CTableMap.vb CUDAMap.vb CXMLConfigLoader.vb IPersistentObject.vb modAliasNull.vb modPersistenceBrokerSingleton.vb Log Message: More documentation updates Index: modAliasNull.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modAliasNull.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- modAliasNull.vb 20 May 2005 06:03:42 -0000 1.9 +++ modAliasNull.vb 24 May 2005 07:43:44 -0000 1.10 @@ -29,25 +29,124 @@ ' 4-Usar "AliasToNull" cuando grabamos los datos del objeto a la base de datos '----------------------------------------------------------- - + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null Alias for Integers. + ''' </summary> + ''' <remarks>Value us -32767 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullInteger As Short = -32767 '-32768 + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Longs + ''' </summary> + ''' <remarks>Value is -2147483647.0# (double) + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullLong As Double = -2147483647.0# '-2147483648# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Singles + ''' </summary> + ''' <remarks>Value is -3.402823E+38 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullSingle As Double = -3.402823E+38 + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Doubles. + ''' </summary> + ''' <remarks>Value is -1.7976931348623E+308 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullDouble As Double = -1.7976931348623E+308 + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Currency. + ''' </summary> + ''' <remarks>Value is -922337203685477.0# + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullCurrency As Double = -922337203685477.0# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Strings. + ''' </summary> + ''' <remarks>Value is "" + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullString As String = "" + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Dates + ''' </summary> + ''' <remarks>Value is 1/1/0100 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullDate As Date = #1/1/0100# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Bytes + ''' </summary> + ''' <remarks>Value is 0 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullByte As Short = 0 'Constantes para devolver DATE y NOW + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Default date value. + ''' </summary> + ''' <remarks>Value is 1/1/0101 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const DefaultDate As Date = #1/1/0101# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Default value for Now. + ''' </summary> + ''' <remarks>Value is 1/1/0101 1:01:01 AM + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const DefaultNow As Date = #1/1/0101 1:01:01 AM# '''----------------------------------------------------------------------------- ''' <summary> ''' Check is a value should be mapped to a NULL. ''' </summary> - ''' <param name="InValue">The value to be checked</param> + ''' <param name="inValue">The value to be checked</param> ''' <returns>True if the object values is a NULL alias value</returns> ''' <remarks>Returns True is the value is an aliased null number. For example ''' if the value is a date of #01/01/100# the method will return true, whilst @@ -91,6 +190,17 @@ Return blnValue End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Replaces a NULL with a defined value (the aliased NULL value). + ''' </summary> + ''' <param name="inValue">The value to check</param> + ''' <param name="outValue">The returned value</param> + ''' <remarks>The the value is NULL (IsDBNull) then the appropriate aliased version is returned.</remarks> + ''' <history> + ''' [rbanks] 18/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub NullToAlias(ByVal inValue As Object, ByRef outValue As Object) Call NullToAlias(inValue, outValue, Nothing) End Sub @@ -107,9 +217,9 @@ ''' <summary> ''' Replaces a NULL with a defined value (the aliased NULL value). ''' </summary> - ''' <param name="InValue">The value to check</param> - ''' <param name="OutValue">The returned value</param> - ''' <param name="Override">A value to return if something other than the alias value should be returned.</param> + ''' <param name="inValue">The value to check</param> + ''' <param name="outValue">The returned value</param> + ''' <param name="override">A value to return if something other than the alias value should be returned.</param> ''' <remarks>The the value is NULL (IsDBNull) then the appropriate aliased version is returned. ''' If the override value was specified, then that value is returned instead.</remarks> ''' <history> @@ -157,6 +267,18 @@ outValue = vntOutValue End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Converts an Aliased Value to NULL + ''' </summary> + ''' <param name="inValue">The value to check</param> + ''' <returns>NULL if value is an alias for null, or the inValue</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function AliasToNull(ByVal inValue As Object) As Object Return AliasToNull(inValue, Nothing) End Function @@ -170,8 +292,8 @@ ''' <summary> ''' Converts an Aliased value to a NULL ''' </summary> - ''' <param name="InValue">The value to check</param> - ''' <param name="NullValue">The value to use for NULL (default is DBNull)</param> + ''' <param name="inValue">The value to check</param> + ''' <param name="nullValue">The value to use for NULL (default is DBNull)</param> ''' <returns>Either the InValue or a NULL</returns> ''' <remarks>If InValue is a NULL alias value then a proper DBNull is returned otherwise the ''' original value is returned.</remarks> @@ -218,7 +340,7 @@ ''' <summary> ''' Returns the number digits after the decimal point. ''' </summary> - ''' <param name="InNumber">The number to check.</param> + ''' <param name="inNumber">The number to check.</param> ''' <returns>The number of digits after the decimal.</returns> ''' <remarks>The calculation is based on a period (".") and will need ''' reworking in locales where the decimal is the thousands separator and @@ -250,7 +372,7 @@ ''' <summary> ''' Returns the number digits before the decimal point. ''' </summary> - ''' <param name="InNumber">The number to check.</param> + ''' <param name="inNumber">The number to check.</param> ''' <returns>The number of digits before the decimal.</returns> ''' <remarks>The calculation is based on a period (".") and will need ''' reworking in locales where the decimal is the thousands separator and Index: modPersistenceBrokerSingleton.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modPersistenceBrokerSingleton.vb,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- modPersistenceBrokerSingleton.vb 20 May 2005 06:03:42 -0000 1.12 +++ modPersistenceBrokerSingleton.vb 24 May 2005 07:43:44 -0000 1.13 @@ -109,7 +109,7 @@ ''' <summary> ''' Gets a reference to the persistence broker. ''' </summary> - ''' <param name="xmlfile">The file name where the XML O/R mappings reside.</param> + ''' <param name="xmlFile">The file name where the XML O/R mappings reside.</param> ''' <returns>A reference to the persistence broker</returns> ''' <remarks>The existing persistence broker object is located. If no ''' configuration information has been loaded then the persistence broker Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- CPersistenceBroker.vb 20 May 2005 06:03:40 -0000 1.110 +++ CPersistenceBroker.vb 24 May 2005 07:43:42 -0000 1.111 @@ -16,7 +16,7 @@ ''' The persistence broker provides the major functionality for the interaction of ''' objects with the database(s). ''' </summary> -''' <remarks></remarks> +''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -38,6 +38,20 @@ Private m_injectedObjects As New InjectedObjectCache Private m_objectsToDelete As New ArrayList + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Fires when the database mapping does not contain sufficient information to establish a connection + ''' ''' </summary> + ''' <param name="sender">The database that is attempting to create a connection</param> + ''' <param name="user">The user name to use</param> + ''' <param name="password">The password to use</param> + ''' <remarks>If the user and/or password is not supplied in the XML mapping file (for security reasons) this event must be + ''' handled by the application in order to establish a connection to the database. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event LogOnDetailsNeeded(ByVal sender As Object, ByRef user As String, ByRef password As String) Private m_disposed As Boolean @@ -80,7 +94,7 @@ ''' The singleton instance of the persistence broker. ''' </summary> ''' <value>A reference to the singleton instance of the persistence broker.</value> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -158,6 +172,7 @@ ''' <param name="obj">The skeleton of the object to retrieve.</param> ''' <param name="useFind">Flag to indicate wether object retrieval should be based on the find attributes or key attributes.</param> ''' <param name="useCache">Flag to indicate wether the in-memory object cache should be checked.</param> + ''' <returns>Boolean indicating success or failure</returns> ''' <remarks>This method takes an object and uses the values contained in either ''' it's key attributes or it's find attributes to locate and retrieve data from the ''' database. @@ -1336,9 +1351,9 @@ ''' <summary> ''' Retrieves a ClassMap object by name. ''' </summary> - ''' <param name="ClassName">The name of the class map to retrieve.</param> + ''' <param name="className">The name of the class map to retrieve.</param> ''' <returns>A class map object if it exists, otherwise Nothing.</returns> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -1349,6 +1364,17 @@ GetClassMap = ClassMap End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Retrieves a ClassMap object by name. + ''' </summary> + ''' <param name="inType">The class type of the class map to retrieve.</param> + ''' <returns>A class map object if it exists, otherwise Nothing.</returns> + ''' <remarks> </remarks> + ''' <history> + ''' [rbanks] 16/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Function GetClassMap(ByVal inType As Type) As ClassMap Dim ClassMap As ClassMap Dim tmpCMap As ClassMap @@ -1395,9 +1421,9 @@ ''' <summary> ''' Retrieves a IRelationalDatabase object by name ''' </summary> - ''' <param name="Name">The name of the database object to retrieve.</param> + ''' <param name="name">The name of the database object to retrieve.</param> ''' <returns>The database object, if it is in the Databases collection, otherwise Nothing.</returns> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -1412,7 +1438,7 @@ ''' <summary> ''' Initialises the persistence broker. ''' </summary> - ''' <param name="xmlfile">The name of the XML file containing the object/database mappings.</param> + ''' <param name="xmlFile">The name of the XML file containing the object/database mappings.</param> ''' <remarks>This will create the persistence broker singleton object and ''' read the XMl mapping file to build all of the class, attribute, database and ''' association maps that will be used by the persistence broker. @@ -1453,7 +1479,7 @@ ''' <summary> ''' Initialises the persistence broker. ''' </summary> - ''' <param name="xmlfile">The XML file that contains the mappings.</param> + ''' <param name="xmlFile">The XML file that contains the mappings.</param> ''' <param name="useCache">Flag indicating wether the in-memory cache should ''' be used.</param> ''' <remarks>Calls the main init method and then specifically sets the usage of the @@ -1576,6 +1602,21 @@ Return ProcessRetrieveCriteria(clMap, criteria, fullObjects) End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Processes a selection criteria to retrieve multiple objects from the database. + ''' </summary> + ''' <param name="classMap">A class map to process.</param> + ''' <param name="criteria">The selection criteria to use.</param> + ''' <param name="fullObjects">Flag indicating wether proxy objects or full objects are to be retrieved.</param> + ''' <returns>A ResultCursor object referencing the retrieved data.</returns> + ''' <remarks>Generates the SQL statement required to retrieve the data from the + ''' database and populates a ResultCursor object. The ResultCursor object is used by the + ''' application to actually instantiate the objects.</remarks> + ''' <history> + ''' [rbanks] 16/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Function ProcessRetrieveCriteria(ByRef classMap As ClassMap, ByRef criteria As RetrieveCriteria, ByVal fullObjects As Boolean) As ResultCursor Dim conn As IConnection Dim cursor As ResultCursor @@ -1716,7 +1757,7 @@ ''' <param name="criteria">Criteria to use for retrieval.</param> ''' <param name="fullObjects">Flag indicating wether full objects or proxy objects should be returned.</param> ''' <returns>A ResultCursor containing data from the database.</returns> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -1894,7 +1935,7 @@ ''' <summary> ''' Method to allow SQL statements based on objects and attributes to be processed. ''' </summary> - ''' <param name="inSQL">The SQL statement to be processed.</param> + ''' <param name="inSql">The SQL statement to be processed.</param> ''' <returns>A ResultCursor containing the data from the query.</returns> ''' <remarks>The SQL statement that is passed in should not use any table or field ''' names, but rather should be based on classes and attributes. Eg "Select Ccustomer.Name from CCustomer". @@ -2036,6 +2077,20 @@ End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Method to allow SQL statements to be processed directly. + ''' </summary> + ''' <param name="inSql">The SQL statement to be processed.</param> + ''' <param name="connection">The connection to use for execution</param> + ''' <returns>A ResultCursor containing the data from the query.</returns> + ''' <remarks>The SQL statement that is passed in will be executed with no interpretation. + ''' <para>Use of this method is not recommended for normal operations, however some + ''' circumstances may require it.</para></remarks> + ''' <history> + ''' [rbanks] 16/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Function ProcessPureSql(ByVal inSql As String, ByVal connection As IConnection) As ResultCursor Dim statement As New AtomsSqlStatement statement.SqlString = inSql @@ -2086,9 +2141,11 @@ ''' <summary> ''' Initiates a transaction on all database connections using the specified isolation level. ''' </summary> + ''' <param name="isolationLevel">The isolation level for the transaction</param> ''' <remarks>This function initiates a transaction on all databases defined ''' in the mapping file. Transactions commenced in this manner must be completed using ''' the matching commit/rollback functions from the persistence broker. + ''' <para>Use the isolation level for pessimistic locking if required</para> ''' </remarks> ''' <history> ''' [rbanks] 20/01/2004 Created @@ -2580,7 +2637,7 @@ ''' </summary> ''' <param name="obj">The obj to check</param> ''' <param name="includeBaseObject">Indicates is obj is included in the returned stack</param> - ''' <param name="checkAssociationsRecursivly">Indicates whether to check if all associations needs saving + ''' <param name="checkAssociationsRecursively">Indicates whether to check if all associations needs saving ''' if obj is not dirty</param> ''' <returns>Stack. The all the objects that needs to be saved.</returns> ''' <remarks> The function traverse the all associated objects and checks whether it needs saving. @@ -2811,7 +2868,7 @@ ''' Function to get all objects to save. Includes checks of associated objects. ''' </summary> ''' <param name="obj">The object to checl</param> - ''' <param name="checkAssociationsRecursivly">Boolean indicating whether associations + ''' <param name="checkAssociationsRecursively">Boolean indicating whether associations ''' should be checked.</param> ''' <returns>Queue. The all the objects that need to be saved.</returns> ''' <remarks>The function traverses all associated objects and checks whether they need saving. @@ -2825,28 +2882,104 @@ Return GetObjectsToSave(obj, True, checkAssociationsRecursively) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Fires the LogOnDetailsNeeded event with the specified paraneters. + ''' </summary> + ''' <param name="sender">The database that needs the logon values</param> + ''' <param name="user">A reference to the user property</param> + ''' <param name="password">A reference to the password property</param> + ''' <remarks>Fires the event and updates the user and password properties. If there are no listeners to the event nothing happens. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub GetLogOnDetails(ByVal sender As IRelationalDatabase, ByRef user As String, ByRef password As String) RaiseEvent LogOnDetailsNeeded(sender, user, password) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Initialise a transaction on the cache. + ''' </summary> + ''' <param name="db">The database the transaction is being performed on.</param> + ''' <remarks>All objects in the cache for the specified database are copied. This provides a rollback point should the transaction be + ''' aborted. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub StartCacheTransaction(ByVal db As IRelationalDatabase) m_cache.StartTransaction(db) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Commits the changes in a transaction on the cache. + ''' </summary> + ''' <param name="db">The database the transaction is being performed on.</param> + ''' <remarks>Since objects are updated in the cache as the transaction progresses this method does very little other than change + ''' state for new objects, and removed objects marked as deleted. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub CommitCache(ByVal db As IRelationalDatabase) m_cache.CommitChanges(db) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Returns the cache to it's pre-transaction state. + ''' </summary> + ''' <param name="db">The database the transaction is being performed on</param> + ''' <remarks>Restores the copies of the objects made at the start of the transaction. Only objects belonging to the specified + ''' database are restored. Any objects added to the cache during the transaction are removed, and any obejcts removed from the cache are + ''' restored. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub RollbackCache(ByVal db As IRelationalDatabase) m_cache.AbortChanges(db) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Executes a stored procedure on the database. + ''' </summary> + ''' <param name="databaseName">The name of the database to execute the procedure on.</param> + ''' <param name="sqlString">The name of the stored procedure.</param> + ''' <returns>A ResultCursor with the results of the execution</returns> + ''' <remarks>Parameter passing is not supported with this method. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function ProcessStoredProcedure(ByVal databaseName As String, ByVal sqlString As String) As ResultCursor Dim db As IRelationalDatabase db = GetRelationalDatabase(databaseName) Return ProcessStoredProcedure(db, sqlString) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Executes a stored procedure on the database. + ''' </summary> + ''' <param name="database">Thedatabase to execute the procedure on.</param> + ''' <param name="sqlString">The name of the stored procedure.</param> + ''' <returns>A ResultCursor with the results of the execution</returns> + ''' <remarks>Parameter passing is not supported with this method. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function ProcessStoredProcedure(ByVal database As IRelationalDatabase, ByVal sqlString As String) As ResultCursor Dim cursor As New ResultCursor Dim st As New AtomsSqlStatement @@ -2863,6 +2996,16 @@ Return cursor End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes of the PersistenceBroker. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub Dispose() Implements System.IDisposable.Dispose Dispose(True) GC.SuppressFinalize(Me) @@ -2870,8 +3013,9 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' Disposed of an instance of the PersistenceBroker class. + ''' Disposes of an instance of the PersistenceBroker class. ''' </summary> + ''' <param name="disposing"> </param> ''' <remarks>Clears all of the collections and the in-memory cache, regardless ''' of wether it was used or not.</remarks> ''' <history> @@ -2930,6 +3074,16 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub Finalize() ' Simply call Dispose(False). Dispose(False) @@ -2942,6 +3096,16 @@ End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Clears the cache. + ''' </summary> + ''' <remarks>Clears all entries from the cache, regardless of their current state. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub ClearCache() m_cache.Clear() Try @@ -2950,10 +3114,36 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Retrieves an object. + ''' </summary> + ''' <param name="obj">An object to retrieve</param> + ''' <remarks>Do not use this method with PersistentObject based classes - use the Retrieve/Find methods. + ''' <para>This method will attempt to retrieve an object using the primary key values in much the same way as the PersistentObject.Retrieve method works</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub GetObject(ByRef obj As Object) GetObject(obj, True) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Retrieves an object. + ''' </summary> + ''' <param name="obj">An object to retrieve</param> + ''' <param name="useCache">Flag to control cache behavour</param> + ''' <remarks>Do not use this method with PersistentObject based classes - use the Retrieve/Find methods. + ''' <para>This method will attempt to retrieve an object using the primary key values in much the same way as the PersistentObject.Retrieve method works</para> + ''' <para>If the useCache flag is off, the cache is not checked and the object is read directly from the database.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub GetObject(ByRef obj As Object, ByVal useCache As Boolean) Dim injObj As InjectedObject injObj = LocateOrCacheInjObject(obj, False, True) @@ -3005,14 +3195,57 @@ obj = injObj.GetSourceObject End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets an InjectedObject from the injection cache. + ''' </summary> + ''' <param name="obj">The object to locate.</param> + ''' <returns>An injected object if the object is found. Otherwise null.</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetInjectedObject(ByVal obj As Object) As InjectedObject Return LocateOrCacheInjObject(obj, False, False) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets an InjectedObject from the injection cache. + ''' </summary> + ''' <param name="obj">The object to locate.</param> + ''' <param name="createTemporary">Flag to create a temporary InjectedObject if the object is not found</param> + ''' <returns>An injected object if the object is found.</returns> + ''' <remarks>If the object cannot be found and createTemporary is True a new InjectedObject is created for the passed in obj Object. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetInjectedObject(ByVal obj As Object, ByVal createTemporary As Boolean) As InjectedObject Return LocateOrCacheInjObject(obj, True, createTemporary) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Locates and object in the Injection cache, or adds the object to the cache if it is not present. + ''' </summary> + ''' <param name="obj">The object to locate.</param> + ''' <param name="replaceCachedValues">Flag to control what happens when the object exists.</param> + ''' <param name="addToCache">Flag to control wether a new object should be added to the cache.</param> + ''' <returns>The InjectedObject (if found) or nothing.</returns> + ''' <remarks>This method is used in multiple ways. Primarily it used to check for the existence of the obj Object in the cache. If it is + ''' not found the object can be optionally added to the cache for future use. + ''' <para>If the object is found then the cache copy of the object can (optionally) have its values updated with the values from + ''' the passed in obj Object.</para> + ''' <para>It is not recommended that this method be used directly by your code</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function LocateOrCacheInjObject(ByVal obj As Object, ByVal replaceCachedValues As Boolean, ByVal addToCache As Boolean) As InjectedObject Dim injObj As InjectedObject injObj = m_injectedObjects.Find(obj) @@ -3040,15 +3273,50 @@ Return injObj End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Determines if an object is beign tracked in the Injection cache. + ''' </summary> + ''' <param name="obj">The object to check</param> + ''' <returns>Boolean indicating status</returns> + ''' <remarks>Checks if the object is in the injection cache or not. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function ObjectIsTracked(ByVal obj) As Boolean Debug.WriteLine(m_injectedObjects) Return m_injectedObjects.IsTracked(obj) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Marks an object for deletion. + ''' </summary> + ''' <param name="obj">The object to delete.</param> + ''' <remarks>The object is not actually deleted, just flagged for deletion. The object will only be deleted when the PersistChanges method is called. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub MarkForDeletion(ByVal obj As Object) MarkForDeletion(obj, False) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Marks an object for deletion. + ''' </summary> + ''' <param name="obj">The object to delete.</param> + ''' <param name="deleteParents">Delete the objects parents as well</param> + ''' <remarks>The object is not actually deleted, just flagged for deletion. The object will only be deleted when the PersistChanges method is called. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub MarkForDeletion(ByVal obj As Object, ByVal deleteParents As Boolean) Dim injObj As InjectedObject injObj = m_injectedObjects.Find(obj) @@ -3060,10 +3328,32 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Commits all object changes for every object in the Injection Cache. + ''' </summary> + ''' <remarks>All objects in the injection cache are saved or deleted (depending on status). + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges() PersistChanges(True) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Commits all object changes for every object in the Injection Cache. + ''' </summary> + ''' <param name="checkAssociationsRecursively">Save the associated objects even if the main object hasn't changed</param> + ''' <remarks>All objects in the injection cache are saved or deleted (depending on status). + ''' <para>Objects to be saved are processed first, and then objects to be deleted are processed. All changes are performed in a single transaction</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges(ByVal checkAssociationsRecursively As Boolean) Me.StartTransaction() Try @@ -3106,10 +3396,36 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Persist the changes for a single object + ''' </summary> + ''' <param name="obj">The object to process</param> + ''' <remarks>obj must be an InjectedObject. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges(ByVal obj As Object) PersistChanges(obj, True) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Persist teh changes for a single object + ''' </summary> + ''' <param name="obj">The object to process</param> + ''' <param name="checkAssociationsRecursively">Check the objects associations</param> + ''' <remarks>The obj object should not inherit from the PersistentObject class. + ''' <para>Any changes to the object are persisted (including deletion). If the object is unchanged associated object will be checked only + ''' if the checkAssociationsRecursively flag is set</para> + ''' </remarks> + ''' <exception name="AtomsFramework.SaveException">obj inherits from PersistentObject or implements IPersistentObject</exception> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges(ByVal obj As Object, ByVal checkAssociationsRecursively As Boolean) Dim value As IPersistableObject Dim q As Queue @@ -3313,6 +3629,22 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Copies the collections of one object to another. + ''' </summary> + ''' <param name="source">The object to copy collections from.</param> + ''' <param name="target">The object to copy collections to.</param> + ''' <remarks>The two objects must be of the same type. + ''' <para>Only IList or IDictionary based collections are copied. If the collection supports the clone interface then the clone method is used + ''' to copy the collection, otherwise the collections are copied one element at a time.</para> + ''' <para>This is a one-level deep copy of the collection, objects referenced in the source collection are copied to new objects and + ''' added to the target collection. Event listeners attached to the first collection are also wired up to the new collection.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Shared Sub CopyCollections(ByVal source As Object, ByRef target As Object) Dim t, t1, iListType, iDicType As Type Dim fromColl, toColl, collItem As Object @@ -3532,6 +3864,17 @@ obj = injObj.GetSourceObject End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Provides direct access to the cache. + ''' </summary> + ''' <value> </value> + ''' <remarks>Should really only be used for debugging purposes, but you never know - you may have a better use for it. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public ReadOnly Property Cache() As CacheEntryDictionary Get Return m_cache Index: IPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IPersistentObject.vb,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- IPersistentObject.vb 11 Apr 2005 00:31:44 -0000 1.15 +++ IPersistentObject.vb 24 May 2005 07:43:44 -0000 1.16 @@ -1,84 +1,906 @@ +''' ----------------------------------------------------------------------------- +''' <summary> +''' Base interface for persistable objects. +''' </summary> +''' <value> </value> +''' <remarks>This interface represents the core functionality that must be provided by each of the persistable object classes used internall +''' in the framework. That is, both the PersistentObject class and the InjectedObject class implement this interface. +''' <para>It is possible to implement this interface in your own classes but it is not recommended and there may be other problems</para> +''' </remarks> +''' <history> +''' [rbanks] 24/05/2005 Created +''' </history> +''' ----------------------------------------------------------------------------- Public Interface IPersistableObject + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag indicating wether the object is persistent or not + ''' </summary> + ''' <value>Boolean indicating if the object is persistent</value> + ''' <remarks>Objects that are retrieved from the persistent broker are either + ''' marked as persistent or not. If the object was successfully retrieved using values from the + ''' database then the object will be marked as persistent. If no relevant database records + ''' could be found the object is instantiated, but marked as non persistent. + ''' <para>An new object that is created is initially marked as non-persistent, however + ''' once the object is successfully saved to the database it will be marked as + ''' persistent</para> + ''' <para>Setting this value manually is not recommended and can result in unexpected behaviour</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property Persistent() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates if the all atributes are populated or only those marked as proxy attributes + ''' </summary> + ''' <value>Boolean indicating only proxy attributes are populated</value> + ''' <remarks>When an object is retrieved via a ResultCursor the returned object can either + ''' be a proxy object or a full object. This behaviour is determined by the ResultCursor. + ''' <para>If the ResultCursor returns proxy objects, only information related to the proxy + ''' attributes will be returned and only a partially populated object can be + ''' instantiated. The proxy flag will be set to indicate to the application that the + ''' object is not complete, and also to prevent the framework from performing any + ''' persistence operations such as save and delete.</para> + ''' <para>Once a proxy object is fully retrieved the proxy flag will be turned off and + ''' normal object operations can be performed</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property IsProxy() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag indicating that the object has been modified + ''' </summary> + ''' <value>Boolean indicating that the object has been modified</value> + ''' <remarks>This flag must be set by the object whenever one of it's properties changes. + ''' Failing to do so will prevent the AtomsFramework from updating the database when + ''' the save method is performed. + ''' <para>When an object is initially received this flag will be False.</para> + ''' <para>Note: Changes to objects in a PersistentObjectCollection can result in this flag being set.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property IsDirty() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The minimum time (in minutes) that the object will remain in the cache before it is + ''' re-read from the database. + ''' </summary> + ''' <value>The expiry time period in minutes</value> + ''' <remarks>When an object is initially retrieved it is typically stored in the + ''' local object cache. Each object has a default expiry time of 30 minutes. During this + ''' time any attempts to retrieve the object will result in the cached copy being returned + ''' instead of the database being hit. + ''' <para>For some objects the 30 minute interval is too long or too short. By setting + ''' this value you can control when the cached version of the object will expire and + ''' thus force the database to be queried the next time the object is retrieved.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property ExpiryInterval() As Double + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The ObjectID of the current object + ''' </summary> + ''' <value>The text representation of the object's OID</value> + ''' <remarks>Each object has an object ID regardless of wether those OID's are + ''' actually used in the database or not. This property will return the current + ''' OID value for the object. + ''' <para>If the object is persistent and OID's are used in the database the property + ''' will be the current OID value of the object. If the object is not persistent then + ''' the OID Value will be generated automatically.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property OidValue() As String + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The GUID (Globally Unique Identifier) of the current object + ''' </summary> + ''' <value>The string representation of the object's GUID</value> + ''' <remarks>Each object has a GUID regardless of wether GUIDs are + ''' actually used in the database or not. This property will return the current + ''' GUID as a string. + ''' <para>If the object is persistent and GUIDs are used in the database the property + ''' will be the current GUID value of the object. If the object is not persistent then + ''' the GUID Value will be generated automatically.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property GuidValue() As String + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag indicating that an objects AutoRetrieve associations have been retrieved. + ''' </summary> + ''' <value>Boolean indicating that associations have been retrieved</value> + ''' <remarks>If this flag is set then the object has been retrieved and all associations + ''' marked as AutoRetrieve-"true" have been processed and retrieved. + ''' <para>This flag is only used internally bu the framework and it should not be set manually.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property AssociationsLoaded() As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates if the object is currently being loaded by the persistence broker. + ''' </summary> + ''' <returns>Boolean indicating if the object is currently loading</returns> + ''' <remarks>When the persistence broker loads an object this flag will be set to + ''' indicate the object is currently loading. This flag can then be used inside + ''' subclasses to adjust behaviour accordingly. + ''' </remarks> + ''' <history> + ''' [rbanks] 16/08/2004 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property IsLoading() As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indictaes if the object has been queued for saving + ''' </summary> + ''' <value> </value> + ''' <remarks>During the saving of objects using the PersistenceBroker.PersistChanges method objects are added to a + ''' queue for saving. Since it is possible that there are circular references in the object hierarchy this flag is used to prevent + ''' an object being added multiple times, and to help prevent infinite loops. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property IsQueued() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag to indicate if the object is read only. + ''' </summary> + ''' <value>Boolean indicating whether the object is read only or not.</value> + ''' <remarks>Objects that are read only can still be modified by the application + ''' however when any of the persistence methods are called (such as save and delete) + ''' an exception will be thrown indicating that the object is read only. + ''' <para>Read only objects are typically used to map database views.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- ReadOnly Property IsReadOnly() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag to indicate that objects cannot be created or deleted. + ''' </summary> + ''' <value>Boolean to indicate wether the object only permits modification.</value> + ''' <remarks>When this flag is on it indicates that the persistent object is only + ''' able to be modified. Any attempt to delete or save a newly created object will + ''' result in an exception being thrown. + ''' <para>This flag is different to the isReadOnly property in that it also allows + ''' an object to be changed.</para> + ''' <para>Typical uses include mapping an object to a view that also permits updates + ''' to occur, but for which creation and deletion of records is not permitted.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- ReadOnly Property IsModifyOnly() As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' A CacheKey object used to hold the original key values for an object + ''' </summary> + ''' <value> </value> + ''' <remarks>After an object is retrieved it is possible for the key values of the object to be modified. If this occurs, we + ''' need a way to store the original values so that SQL update statements can correctly populate the values for the where clause. + ''' This property is used to store and retrieve those values. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property OriginalCacheKey() As CacheKey + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The PesistenceState of the object + ''' </summary> + ''' <value> </value> + ''' <remarks>A simple indication of wether an object is known to be persistent + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property State() As PersistenceState + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the class map for an object + ''' </summary> + ''' <returns>A ClassMap object for calling object</returns> + ''' <remarks>Returns the class map of the calling object. If no class map can + ''' be found an exception is thrown.</remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetClassMap() As ClassMap + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the length of a mapped attribute in the database + ''' </summary> + ''' <param name="propertyName">The name of the attribute to examine</param> + ''' <returns>The length of the mapped field</returns> + ''' <remarks>Returns the length of the field in the database that an attribute + ''' is mapped to. For numeric fields the length will be the storage size, and for + ''' string fields the length will be the maximum length permitted by the database. + ''' </remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetFieldLengthByName(ByVal propertyName As String) As Integer + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the database type of a mapped attribute + ''' </summary> + ''' <param name="propertyName">The name of the attribute to examine</param> + ''' <returns>The type of the mapped field</returns> + ''' <remarks>Returns the type of the field that the named attribute maps to.</remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetFieldTypeByName(ByVal propertyName As String) As Type + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets a PersistentObjectCollection from an object attribute by name + ''' </summary> + ''' <param name="name">The name of the attribute referencing a PersistentObjectCollection</param> + ''' <returns>A PersistentObjectCollection object</returns> + ''' <remarks>Returns a PersistentObjectCollection object from the named attribute in the object. If there + ''' is an error an exception will be thrown.</remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetCollectionByAttribute(ByVal name As String) As IList + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Returns a persistent object using a named attribute. + ''' </summary> + ''' <param name="name">The attribute name that stores a reference to a persistent object</param> + ''' <returns>A persistent object (PersistentObject)</returns> + ''' <remarks>If the attribute does not reference a PersistentObject then a type mismatch + ''' exception will be thrown. + ''' <para>Internal use only.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetObjectByAttribute(ByVal name As String) As IPersistableObject + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Returns the value of any attribute in the object + ''' </summary> + ''' <param name="name">The name of the attribute being queried. Case sensitive.</param> + ''' <returns>The value of the attribute as an Object.</returns> + ''' <remarks>The name of the attribute can be specified as a direct property name or it can + ''' be a period separated path name such as <c>ObjectAttribute.SubAttribute</c> + ''' <para>This is primarily for internal use only</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetValueByAttribute(ByVal name As String) As Object + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Set the value of any attribute in an object. + ''' </summary> + ''' <param name="name">The name of the attribute to modify. Case sensitive.</param> + ''' <param name="value">The value to apply to the attribute</param> + ''' <remarks>Sets the value of any attribute in an object based on the name of the attribute. + ''' <para>Most atomic types are supported and any unsupported types will result + ''' in an exception being thrown.</para> + ''' <para>This is primarily for internal use but can be useful in some application instances</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Sub SetAttributeValue(ByVal name As String, ByRef value As Object) + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Returns a collection of objects that have been removed from a property since the object was retrieved. + ''' </summary> + ''' <param name="propertyName">The property to check.</param> + ''' <returns>A collection containing the objects that have been removed from the collection</returns> + ''' <remarks>The propertyName must be the name of an IList or IDictionary based property otherwise an exception is likely to + ''' be thrown. + ''' <para>This function is used to determine what objects have been removed since an object was retrieved. The implementation should + ''' be based on a comparison of the original collection and the current collection.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function GetRemovedCollectionItems(ByVal propertyName As String) As Collection + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Copies collections used in One-To-Many associations. + ''' </summary> + ''' <remarks>This Method is called by the framework after an object has been retrieved so that there is an original starting point + ''' for data for the GetRemovedCollectionItems method. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Sub CopyOneToManyCollections() + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Obtains the type of the current source object + ''' </summary> + ''' <returns>A Type object</returns> + ''' <remarks>This will get the Type of the referenced/source object. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function GetObjectType() As Type + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Determines if another object is equivalent to the current object. + ''' </summary> + ''' <param name="obj">The object to compare with</param> + ''' <returns>A boolean indicating equality</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function Equals(ByVal obj As IPersistableObject) As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Make a copy of the current object + ''' </summary> + ''' <returns>A value copy of the current object</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function Copy() As IPersistableObject + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Replaces member values of the current object with values from the supplied object + ''' </summary> + ''' <param name="obj">The object to copy from</param> + ''' <param name="copyEventHandlers">Copy eventHandlers or not</param> + ''' <remarks>Both objects must be of the same type. All public and private member values are copied. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Sub ReplaceWith(ByVal obj As IPersistableObject, ByVal copyEventHandlers As Boolean) + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Get an object by a class map + ''' </summary> + ''' <param name="classMap">The class map to get</param> + ''' <returns>PersistentObject The object.</returns> + ''' <remarks>The method creates an object based on the class m... [truncated message content] |
From: Richard B. <rb...@us...> - 2005-05-23 07:24:07
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv561 Modified Files: AtomsFramework.xml CInjectedObject.vb CInjectedObjects.vb Log Message: More documentation Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- CInjectedObject.vb 20 May 2005 06:03:40 -0000 1.29 +++ CInjectedObject.vb 23 May 2005 07:23:55 -0000 1.30 @@ -91,7 +91,7 @@ ''' <summary> ''' An original copy of the object before changes were made. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -302,6 +302,7 @@ ''' <param name="name">The attribute name (property name)</param> ''' <returns>An object or nothing</returns> ''' <remarks>Uses the CallByName method to get the value for a property of the object. + ''' </remarks> ''' <history> ''' [rbanks] 20/05/2005 Created ''' </history> @@ -317,6 +318,7 @@ ''' <param name="name">The attribute name (property name)</param> ''' <returns>An object or nothing</returns> ''' <remarks>Uses the CallByName method to get the value for a property of the object. + ''' </remarks> ''' <history> ''' [rbanks] 20/05/2005 Created ''' </history> @@ -328,7 +330,7 @@ ''' <summary> ''' Indicates wether Associations have been loaded for the ReferencedObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -340,7 +342,7 @@ If Me.GetClassMap.AssociationMapCount > 0 Then Return m_associationsLoaded Else - 'If the class has no associations then associations are already "loaded" + '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 Return Me.Persistent End If @@ -354,7 +356,7 @@ ''' <summary> ''' The expiry interval for the InjectedObject in the Cache ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>This is the expiry interval of the object in the persistence cache, not the Injected Object Cache. ''' </remarks> ''' <history> @@ -374,7 +376,7 @@ ''' <summary> ''' Indicates wether the object has been marked for deletion. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks>InjectedObjects must be marked for deletion before the PersistChanges method of the PersistenceBroker is called if they are ''' to be removed from the database. ''' </remarks> @@ -395,7 +397,7 @@ ''' <summary> ''' Indicates if deleting this object will also delete any of it's parent objects. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -416,7 +418,7 @@ ''' See IPersistableObject ''' </summary> ''' <param name="propertyName"> </param> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -432,7 +434,7 @@ ''' See IPersistableObject ''' </summary> ''' <param name="propertyName"> </param> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -519,7 +521,7 @@ ''' <summary> ''' Indicates that the ReferencedObject has changed and requires saving to the database. ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -545,7 +547,7 @@ ''' <summary> ''' Inidicates if the ReferencedObject is being loaded from the database ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -568,7 +570,7 @@ ''' <summary> ''' See IPersistableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -588,7 +590,7 @@ ''' <summary> ''' See IPersistableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -605,7 +607,7 @@ ''' <summary> ''' See IPersistableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -625,7 +627,7 @@ ''' <summary> ''' See IPersistableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -642,7 +644,7 @@ ''' <summary> ''' See IPersiatableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -670,7 +672,7 @@ ''' <summary> ''' See IPersistableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> @@ -690,7 +692,7 @@ ''' <summary> ''' See IPersistableObject ''' </summary> - ''' <returns></returns> + ''' <returns> </returns> ''' <remarks> ''' </remarks> ''' <history> Index: AtomsFramework.xml =================================================================== RCS file: /cvsroot/jcframework/dotnet/AtomsFramework.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- AtomsFramework.xml 20 May 2005 06:03:36 -0000 1.12 +++ AtomsFramework.xml 23 May 2005 07:23:55 -0000 1.13 @@ -4111,7 +4111,7 @@ <summary> An original copy of the object before changes were made. </summary> - <returns /> + <returns> </returns> <remarks> </remarks> <history> @@ -4194,68 +4194,86 @@ <param name="name">The attribute name (property name)</param> <returns>An object or nothing</returns> [...4838 lines suppressed...] </summary> <remarks>Manages the references to the singleton <see cref="T:AtomsFramework.OIDFactory" /> object.</remarks> <history> [rbanks] 18/12/2003 Created - </history></member><member name="M:AtomsFramework.modObjectIdFactorySingleton.GetOidFactoryInstance"><summary> + </history></member> + <member name="M:AtomsFramework.modObjectIdFactorySingleton.GetOidFactoryInstance"> + <summary> Gets a reference to the OIDFactory instance. </summary> <returns>A reference to the OIDFactory object.</returns> @@ -8010,6 +9140,6 @@ exist it is created.</remarks> <history> [rbanks] 18/12/2003 Created - </history></member></remarks></member></remarks></member> + </history></member> </members> </doc> \ No newline at end of file Index: CInjectedObjects.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObjects.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CInjectedObjects.vb 11 Apr 2005 00:31:43 -0000 1.9 +++ CInjectedObjects.vb 23 May 2005 07:23:55 -0000 1.10 @@ -3,12 +3,43 @@ 'Injected object keys are hashed on the object itself, not the value of the object '(unlike the persistence brokers cache which works via key values) +''' ----------------------------------------------------------------------------- +''' Project : AtomsFramework +''' Class : InjectedObjectKey +''' +''' ----------------------------------------------------------------------------- +''' <summary> +''' Maintains information about the key fields of each injected object +''' </summary> +''' <remarks>This class stores information from the key properties of the objects in the +''' cache. Since objects can have multiple key fields of different types the InjectedObjectKey class +''' is written in a fairly generic manner. +''' <para>It maintains a collection of key values (all of which must be non-null) and +''' uses them to generate a hashcode. This hashcode is then used as the key to +''' the particular cache entry in question.</para> +''' <para>It is very similar to the CacheKey used for persistence caching.</para> +''' </remarks> +''' <history> +''' [rbanks] 23/05/2005 Created +''' </history> +''' ----------------------------------------------------------------------------- Public Class InjectedObjectKey Private m_hashCode As Integer Private m_type As Type Private m_keyvalues As Collection Private m_istemporary As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Creates a new instance of the InjectedObjectKey class + ''' </summary> + ''' <param name="obj">The object we are generating a key for.</param> + ''' <remarks>Creates a new injected object key entry based on the key fields in the object. Works + ''' regardless of wether the object uses ObjectID's or has it's own key fields.</remarks> + ''' <history> + ''' [rbanks] 27/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub New(ByVal obj As Object) If obj Is Nothing Then Throw New AtomsFrameworkException("Cannot create injected objects using Null objects") @@ -22,6 +53,19 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates wether this injected object is transient + ''' </summary> + ''' <value>True if the cache key is short lived.</value> + ''' <remarks>Some persistence transaction require the creation and tracking objects that are + ''' not explicitly tracked by the developer. The framework will track these objcets internally and mark them as + ''' Temporary objects. Once the transaction is completed the temporary entries are removed. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property Temporary() As Boolean Get Return m_istemporary @@ -31,6 +75,17 @@ End Set End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Populates a new instance of the InjectedObjectKey class with an existing injected object. + ''' </summary> + ''' <param name="injObj">The object we are generating a key for.</param> + ''' <remarks>Populates or replaces the contents of the InjectedObjectKey with the values from the passed in InjectedObject. + ''' </remarks> + ''' <history> + ''' [rbanks] 27/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub NewInjObj(ByVal injObj As InjectedObject) If injObj Is Nothing Then Throw New AtomsFrameworkException("Cannot track null objects") @@ -42,35 +97,34 @@ PopulateKey(injObj) End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Obtains a hash code for the current object + ''' </summary> + ''' <returns>A hash code for the current object</returns> + ''' <remarks>The hash code is identical to the hash code of the source object. + ''' </remarks> + ''' <history> + ''' [rbanks] 27/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Overrides Function GetHashCode() As Integer Return m_hashCode End Function - 'Private Sub CalculateHashCode() - ' Dim i As Long - ' Dim count As Integer - ' Dim obj As Object - ' Dim t As Type - ' i = m_type.Name.GetHashCode - ' count = 1 - ' For Each obj In m_keyvalues - ' If Not obj Is Nothing Then - ' If TypeOf obj Is Integer Then - ' i += CInt(obj).GetHashCode - ' ElseIf TypeOf obj Is String Then - ' i += CStr(obj).GetHashCode - ' ElseIf TypeOf obj Is Double Then - ' i += CDbl(obj).GetHashCode - ' Else - ' t = obj.GetType - ' i += t.Name.GetHashCode - ' End If - ' count += 1 - ' End If - ' Next - ' m_hashCode = CInt(i / count) - 'End Sub - + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Populates the InjectedObjectKey with values from an IPersistableObject + ''' </summary> + ''' <param name="injObj">The source object</param> + ''' <remarks>The key values from the source object are copied to the InjectedObjectKey and used for tracking the object. + ''' </remarks> + ''' <exception cref="AtomsFramework.AtomsFrameworkException">A key value is null. All key values must have non-null values. + ''' </exception> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Sub PopulateKey(ByVal injObj As IPersistableObject) Dim cm As ClassMap Dim i As Short @@ -93,9 +147,20 @@ m_keyvalues.Add(x) Next m_hashCode = injObj.GetSourceObject.GetHashCode - 'CalculateHashCode() End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Determines if two InjectedObjectKey objects are equivalent. + ''' </summary> + ''' <param name="obj1">The first object to compare</param> + ''' <param name="obj2">The second object to compare</param> + ''' <returns>Boolean indicating equivalence</returns> + ''' <remarks>Comparison is made based on hash code values.</remarks> + ''' <history> + ''' [rbanks] 27/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Overloads Shared Function Equals(ByVal obj1 As Object, ByVal obj2 As Object) As Boolean Dim key1, key2 As InjectedObjectKey key1 = CType(obj1, InjectedObjectKey) @@ -103,6 +168,18 @@ Return key1.Equals(key2) End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Determines if the key for an object is equivalent to the current cache key. + ''' </summary> + ''' <param name="obj">The object to be compared</param> + ''' <returns>Boolean indicating equality</returns> + ''' <remarks>The comparison is made based on the referenced object type and on the + ''' hash key values.</remarks> + ''' <history> + ''' [rbanks] 27/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Overloads Overrides Function Equals(ByVal obj As Object) As Boolean Dim key As InjectedObjectKey key = obj @@ -115,6 +192,17 @@ Return True End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' A string representation of the InjectedObjectKey object + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overrides Function ToString() As String Dim s As String Dim obj As Object @@ -145,12 +233,43 @@ End Function End Class - +''' ----------------------------------------------------------------------------- +''' Project : AtomsFramework +''' Class : InjectedObjectCache +''' +''' ----------------------------------------------------------------------------- +''' <summary> +''' The Cache for InjectedObjects. +''' </summary> +''' <remarks>The InjectedObjectCache is a collection of InjectedObjects and matching InjectedObjectKeys based on a +''' standard hash table. +''' <para>The InjectedObject cache is a little difficult to explain, but in simple terms we need to keep track of each object +''' we wish to persist regardless of wether it is inheriting from PersistentObject or not. If it not (a non-inheited object) then we wrap +''' it up in an InjectedObject class and keep track of it using this cache.</para> +''' <para>By doing so we are able to keep track of it's state, dirtiness, etc and we can treat it internally much the same as an +''' inherited object.</para> +''' </remarks> +''' <history> +''' [rbanks] 23/05/2005 Created +''' </history> +''' ----------------------------------------------------------------------------- Public Class InjectedObjectCache Inherits System.Collections.Hashtable Private m_lastFoundKey As InjectedObjectKey + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Adds an InjectedObject to the cache, allowing the setting of the temporary flag. + ''' </summary> + ''' <param name="obj">The object to add</param> + ''' <param name="temporary">A flag to indicate if the object is only being added temporarily</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub AddTemp(ByVal obj As InjectedObject, ByVal temporary As Boolean) Dim injKey As InjectedObjectKey @@ -172,10 +291,33 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Add an InjectedObject to the cache. + ''' </summary> + ''' <param name="obj">The object to add.</param> + ''' <remarks>The object is added permanently. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub Add(ByVal obj As InjectedObject) Me.AddTemp(obj, False) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Checks if an InjectedObject is already present in the cache. + ''' </summary> + ''' <param name="obj">The object to find.</param> + ''' <returns>Boolean indicating if the object is in the cache.</returns> + ''' <remarks>The find() method is called to try and locate the object and the result is interpreted as a boolean return value. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function IsTracked(ByVal obj As Object) As Boolean Dim injObj As InjectedObject injObj = Find(obj) @@ -186,6 +328,20 @@ End If End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Determine if an InjectedObject exists in the cache. + ''' </summary> + ''' <param name="obj">The object to find</param> + ''' <param name="useFindAttributes">Wether to use Find attributes or Key attributes.</param> + ''' <returns>A boolean indicating success or failure</returns> + ''' <remarks>The useFindAttributes parameter determines if the object should be searched for using Find attributes or KeY + ''' attribtues. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function Exists(ByVal obj As InjectedObject, ByVal useFindAttributes As Boolean) As Boolean If Find(obj, useFindAttributes) Is Nothing Then Return False @@ -194,10 +350,35 @@ End If End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Find an object in the cache + ''' </summary> + ''' <param name="obj">An object to find</param> + ''' <returns>Boolean indicating success or failure</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function Find(ByVal obj As Object) As InjectedObject Return Find(obj, False) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Find an object in the cache + ''' </summary> + ''' <param name="obj">An object to find</param> + ''' <param name="useFindAttributes">Wether to use Find attributes or Key attributes</param> + ''' <returns>Boolean indicating success or failure</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function Find(ByVal obj As Object, ByVal useFindAttributes As Boolean) As InjectedObject Dim injObj As InjectedObject If Not TypeOf (obj) Is InjectedObject Then @@ -208,10 +389,38 @@ Return Find(injObj, useFindAttributes) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Find an InjectedObject in the cache + ''' </summary> + ''' <param name="obj">The InjectedObject to find.</param> + ''' <param name="useFindAttributes">Wether to use Find attributes or Key attributes</param> + ''' <returns>Boolean indicating success or failure.</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function Find(ByVal obj As InjectedObject, ByVal useFindAttributes As Boolean) As InjectedObject Return Find(obj, useFindAttributes, True) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Find an InjectedObject in the cache + ''' </summary> + ''' <param name="obj">The InjectedObject to find</param> + ''' <param name="useFindAttributes">Wether to use Find attributes or Key attributes</param> + ''' <param name="checkSubclasses">Wether to check child classes for a match.</param> + ''' <returns>A boolean indicating success or failure.</returns> + ''' <remarks>Comparisons are made using the indicated attributes only, not using non-key attributes. It is possible for two objects that are + ''' different to still produce a match if the key/find values are equivalent. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function Find(ByVal obj As InjectedObject, ByVal useFindAttributes As Boolean, ByVal checkSubclasses As Boolean) As InjectedObject Dim injObj As InjectedObject Dim x As DictionaryEntry @@ -248,7 +457,7 @@ ' m_Enumerator.Reset() 'Reset enumerator after removing item 'Else found = True - If t Is obj.GetObjectType OrElse (checkSubClasses AndAlso t.IsSubclassOf(obj.GetObjectType)) Then + If t Is obj.GetObjectType OrElse (checkSubclasses AndAlso t.IsSubclassOf(obj.GetObjectType)) Then Try If useFindAttributes Then For i = 1 To cm.GetFindSize @@ -282,6 +491,17 @@ Return Nothing End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Remove an InjectedObject from the cache + ''' </summary> + ''' <param name="obj">The object to remove</param> + ''' <remarks>If the object is not found no exception is thrown. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub Remove(ByVal obj As InjectedObject) If obj Is Nothing Then Exit Sub @@ -297,6 +517,16 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Clean the cache after a transaction + ''' </summary> + ''' <remarks>Removes temporary cache entries and resets the IsQueued flag for all entries. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub CleanUp() 'Clean up cache by resetting isqueued flags, removing temp entries, and clearing strong references Dim toRemove As New Collection @@ -339,6 +569,17 @@ Next End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' String representation of the InjectedObjectCache contents + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overrides Function ToString() As String Dim x As DictionaryEntry Dim injObj As InjectedObject @@ -361,6 +602,17 @@ Return outString End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Get an ArrayList copy of the cache. + ''' </summary> + ''' <returns> </returns> + ''' <remarks>Useful for debugging purposes only. Should not be used for anything else. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetValueArray() As ArrayList Dim al As ArrayList If Me.Values.Count = 0 Then Return New ArrayList @@ -370,6 +622,17 @@ Return al End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Get an ArrayList copy of the InjectedObjectKeys for the cache + ''' </summary> + ''' <returns> </returns> + ''' <remarks>Useful for debugging only. Should not be used for anything else. + ''' </remarks> + ''' <history> + ''' [rbanks] 23/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetKeyArray() As ArrayList Dim al As ArrayList If Me.Keys.Count = 0 Then Return New ArrayList |
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15927 Modified Files: AFCustomAttributes.vb AFExceptions.vb AssemblyInfo.vb AtomsFramework.ndoc AtomsFramework.xml CAssociationKey.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 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 CRelationalDatabase.vb CResultset.vb CRetrieveCriteria.vb CSelectInCriteria.vb CSelectInListCriteria.vb CSelectionCriteria.vb CSqlStatement.vb CSummaryCriteria.vb CTableMap.vb CUDAMap.vb CUDAMapEntry.vb CXMLConfigLoader.vb IClassFactory.vb IConfigLoader.vb modAliasNull.vb modPersistenceBrokerSingleton.vb Log Message: Documentation updates Index: modAliasNull.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modAliasNull.vb,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- modAliasNull.vb 11 Apr 2005 00:31:44 -0000 1.8 +++ modAliasNull.vb 20 May 2005 06:03:42 -0000 1.9 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Module : modAliasNull ''' '''----------------------------------------------------------------------------- @@ -223,7 +223,7 @@ ''' <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 Atoms.Framework.</para></remarks> + ''' <para>The function is unused by the AtomsFramework.</para></remarks> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> @@ -255,7 +255,7 @@ ''' <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 Atoms.Framework.</para></remarks> + ''' <para>The function is unused by the AtomsFramework.</para></remarks> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> Index: COIDFactory.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/COIDFactory.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- COIDFactory.vb 11 Apr 2005 00:31:43 -0000 1.5 +++ COIDFactory.vb 20 May 2005 06:03:40 -0000 1.6 @@ -1,14 +1,14 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : OIDFactory ''' '''----------------------------------------------------------------------------- ''' <summary> ''' Class used to generate object ID's ''' </summary> -''' <remarks>This class is used to generate new <see cref="T:Atoms.Framework.OID">object ids</see> +''' <remarks>This class is used to generate new <see cref="T:AtomsFramework.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> Index: CSelectionCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CSelectionCriteria.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CSelectionCriteria.vb 11 Apr 2005 00:31:44 -0000 1.9 +++ CSelectionCriteria.vb 20 May 2005 06:03:42 -0000 1.10 @@ -17,7 +17,7 @@ End Interface '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : SelectionCriteria ''' '''----------------------------------------------------------------------------- Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- CInjectedObject.vb 21 Apr 2005 23:00:28 -0000 1.28 +++ CInjectedObject.vb 20 May 2005 06:03:40 -0000 1.29 @@ -1,10 +1,25 @@ Imports System.Reflection Imports System.Runtime.Remoting -'Class to manage objects injected into the persistence broker -'These will be objects that do not inherit from the cperistentobject class, but which -'still need to be saved/retrieved from the database. - +''' ----------------------------------------------------------------------------- +''' Project : AtomsFramework +''' Class : InjectedObject +''' +''' ----------------------------------------------------------------------------- +''' <summary> +''' Class to manage objects that have been added (injected) into the persistence broker. +''' </summary> +''' <remarks>For persisting objects for classes that are not inheriting from the PersistentObject class we need a method to track and manage +''' the state of those objects. This is done through the InjectedObject class. +''' <para>The InjectedObject class acts a wrapper around a user-defined object in order to extend it's functionality and to provide meta +''' data information such as the objects class mapping, and status details.</para> +''' <para>The InjectedObject implements the IPersistableObject interface to provide a common referencing mechanism between +''' both inherited and non-inherited objects internally in the framework</para> +''' </remarks> +''' <history> +''' [rbanks] 20/05/2005 Created +''' </history> +''' ----------------------------------------------------------------------------- Public Class InjectedObject Implements IPersistableObject @@ -26,6 +41,19 @@ Private m_oneToManyCollections As New Collection 'Private m_strongReference As Object + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Creates a new InjectedObject instance to wrap aound the referenced object. + ''' </summary> + ''' <param name="obj">The object to reference</param> + ''' <remarks>When an instance is created both the ReferencedObject and OriginalObject properties are + ''' initialised. The ReferencedObject references the pass in object, while the OriginalObject is initialised + ''' with a new instance of the objects class. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub New(ByVal obj As Object) MyBase.New() If TypeOf obj Is IPersistableObject Then @@ -35,6 +63,17 @@ m_originalObject = Activator.CreateInstance(obj.GetType) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The object referenced by the InjectedObject instance. + ''' </summary> + ''' <value></value> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property ReferencedObject() As Object Get 'If m_object.IsAlive Then @@ -48,6 +87,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' An original copy of the object before changes were made. + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property OriginalObject() As Object Get Return m_originalObject @@ -57,11 +107,34 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Resets the current object to it's original state. + ''' </summary> + ''' <remarks>Values of the original objects properties are copied over the top of the current object, without changing any references. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub ResetToOriginal() ReplaceValues(m_originalObject, m_object, False) End Sub - Sub ReplaceWith(ByVal obj As IPersistableObject, ByVal copyEventHandlers As Boolean) Implements IPersistableObject.ReplaceWith + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Replaces the current object with the referenced object + ''' </summary> + ''' <param name="obj">The object to get values from</param> + ''' <param name="copyEventHandlers">Flag to indicate wether any EventHandlers should be copied as well.</param> + ''' <remarks>Replaces the values of the ReferencedObject with the values from the passed in object. If copyEventHandlers is True then + ''' any eventlisteners for the passed in object are also wired up to the ReferencedObject. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- + Public Sub ReplaceWith(ByVal obj As IPersistableObject, ByVal copyEventHandlers As Boolean) Implements IPersistableObject.ReplaceWith If Not obj.GetObjectType Is Me.GetObjectType Then Throw New AtomsFrameworkException("Objects must be of the same type") End If @@ -74,6 +147,24 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Copies the property values of one object to another via reflection + ''' </summary> + ''' <param name="source">The source object</param> + ''' <param name="target">The target object</param> + ''' <param name="copyEventHandlers">Indicates if event handlers should also be copied.</param> + ''' <remarks>Objects must be of the same type, or the source object must be a subclass of the target object. + ''' <para>Copies all public, instance and private fields and properties from the source object to the target object using reflection. + ''' If the copyEventHandlers parameter is True then any EventHandlers listening to events on the source object will also listen + ''' to events on the Target object (they are wired up).</para> + ''' <para>If the object contains any IList or IDictionary based collections then those collections are also copied. Note that this copy + ''' is not a shallow reference only copy, but a deep copy so that the two collections can be updated independantly.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- 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 source Is Nothing OrElse target Is Nothing Then Return @@ -115,6 +206,17 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Obtain a class map for the ReferencedObject. + ''' </summary> + ''' <returns>A class map for the referenced object</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetClassMap() As ClassMap Implements IPersistableObject.getClassMap 'Dim tmpCMap As ClassMap If m_classmap Is Nothing Then @@ -143,6 +245,17 @@ Return m_classmap End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the Type for the ReferencedObject + ''' </summary> + ''' <returns>A Type object for the ReferencedObject</returns> + ''' <remarks>If the object is null (nothing) then the type returned is System.Object. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetObjectType() As Type Implements IPersistableObject.GetObjectType If m_object Is Nothing Then 'OrElse Not m_object.IsAlive Then Return GetType(Object) @@ -150,6 +263,19 @@ Return m_object.GetType End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the value for a particular attribute of an object + ''' </summary> + ''' <param name="obj">The object to process. Can be in "a.b" format if desired</param> + ''' <param name="name">The attribute name (property name)</param> + ''' <returns>An object or nothing</returns> + ''' <remarks>Uses the CallByName method to get the value for a property of the object. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Shared Function GetValueByAttribute(ByVal obj As Object, ByVal name As String) As Object Dim dotPos As Integer dotPos = name.IndexOf(".") @@ -169,14 +295,46 @@ End If End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the value for the name attribute from the ReferencedObject + ''' </summary> + ''' <param name="name">The attribute name (property name)</param> + ''' <returns>An object or nothing</returns> + ''' <remarks>Uses the CallByName method to get the value for a property of the object. + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetValueByAttribute(ByVal name As String) As Object Implements IPersistableObject.getValueByAttribute Return GetValueByAttribute(m_object, name) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the value for the name attribute from the OriginalObject + ''' </summary> + ''' <param name="name">The attribute name (property name)</param> + ''' <returns>An object or nothing</returns> + ''' <remarks>Uses the CallByName method to get the value for a property of the object. + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> Public Function GetOriginalValueByAttribute(ByVal name As String) As Object Return GetValueByAttribute(m_originalObject, name) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates wether Associations have been loaded for the ReferencedObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property AssociationsLoaded() As Boolean Implements IPersistableObject.AssociationsLoaded Get If Me.GetClassMap.AssociationMapCount > 0 Then @@ -192,6 +350,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The expiry interval for the InjectedObject in the Cache + ''' </summary> + ''' <returns></returns> + ''' <remarks>This is the expiry interval of the object in the persistence cache, not the Injected Object Cache. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property ExpiryInterval() As Double Implements IPersistableObject.ExpiryInterval Get Return m_cacheExpiry @@ -201,6 +370,18 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates wether the object has been marked for deletion. + ''' </summary> + ''' <returns></returns> + ''' <remarks>InjectedObjects must be marked for deletion before the PersistChanges method of the PersistenceBroker is called if they are + ''' to be removed from the database. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property MarkedForDeletion() As Boolean Get Return m_markedForDeletion @@ -210,6 +391,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates if deleting this object will also delete any of it's parent objects. + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property WillDeleteParents() As Boolean Get Return m_deleteParents @@ -219,14 +411,49 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="propertyName"> </param> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetFieldLengthByName(ByVal propertyName As String) As Integer Implements IPersistableObject.getFieldLengthByName Return GetClassMap.GetAttributeMapByString(propertyName, True).ColumnMap.StorageSize() End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="propertyName"> </param> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetFieldTypeByName(ByVal propertyName As String) As System.Type Implements IPersistableObject.getFieldTypeByName Return GetClassMap.GetAttributeMapByString(propertyName, True).ColumnMap.StorageType End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets or generates a Guid for the ReferencedObject + ''' </summary> + ''' <returns>A string representation of the Guid</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property GuidValue() As String Implements IPersistableObject.GUIDValue Get If m_guid.Equals(Guid.Empty) Then @@ -239,6 +466,20 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Check wether two objects are identical (in terms of value, not references) + ''' </summary> + ''' <param name="source">The first object</param> + ''' <param name="target">The second object</param> + ''' <returns>Boolean indicating success</returns> + ''' <remarks>Each mapped attribute in the objects are checked against each other. Success is determined when all mapped attributes + ''' are found to be equal. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- 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 @@ -274,6 +515,17 @@ End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates that the ReferencedObject has changed and requires saving to the database. + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property IsDirty() As Boolean Implements IPersistableObject.IsDirty Get Return Not ObjectsMatch(m_object, m_originalObject) @@ -289,6 +541,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Inidicates if the ReferencedObject is being loaded from the database + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property IsLoading() As Boolean Implements IPersistableObject.IsLoading Get Return m_loading @@ -301,6 +564,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property IsQueued() As Boolean Implements IPersistableObject.IsQueued Get Return m_queued @@ -310,12 +584,34 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public ReadOnly Property IsModifyOnly() As Boolean Implements IPersistableObject.isModifyOnly Get Return GetClassMap.IsModifyOnly End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property IsProxy() As Boolean Implements IPersistableObject.IsProxy Get Return m_proxy @@ -325,12 +621,34 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public ReadOnly Property IsReadOnly() As Boolean Implements IPersistableObject.isReadOnly Get Return GetClassMap.IsReadOnly End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersiatableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property OidValue() As String Implements IPersistableObject.OIDValue Get Dim oidfactory As ObjectIdFactory @@ -348,6 +666,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property Persistent() As Boolean Implements IPersistableObject.Persistent Get Return m_persistent @@ -357,6 +686,17 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns></returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property State() As PersistenceState Implements IPersistableObject.State Get Return m_state @@ -366,6 +706,18 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="name"> </param> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetCollectionByAttribute(ByVal name As String) As IList Implements IPersistableObject.getCollectionByAttribute Return GetCollectionByAttribute(m_object, name) End Function @@ -393,6 +745,18 @@ End Try End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="name"> </param> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetObjectByAttribute(ByVal name As String) As IPersistableObject Implements IPersistableObject.getObjectByAttribute Return GetObjectByAttribute(m_object, name) End Function @@ -433,10 +797,35 @@ Return injobj End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="name"> </param> + ''' <param name="value"> </param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub SetAttributeValue(ByVal name As String, ByRef value As Object) Implements IPersistableObject.setAttributeValue SetAttributeValue(m_object, name, value) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Set the value of an attribute on an arbitrary object + ''' </summary> + ''' <param name="obj">The object to update</param> + ''' <param name="name">The attribute name (property name)</param> + ''' <param name="value">The value to set</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- 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 @@ -501,6 +890,18 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="obj"> </param> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Function Equals(ByVal obj As IPersistableObject) As Boolean Implements IPersistableObject.Equals Dim ck1, ck2 As CacheKey If Me Is Nothing And Not obj Is Nothing Then @@ -514,6 +915,17 @@ Return ck1.Equals(ck2) And Me.Persistent = obj.Persistent End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function Copy() As IPersistableObject Implements IPersistableObject.Copy Dim injobj As InjectedObject injobj = Me.GetClassMap.CreateObjectInstance @@ -527,6 +939,18 @@ Return injobj End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="classMap"> </param> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function GetObjectByClassMap(ByVal classMap As ClassMap) As IPersistableObject Implements IPersistableObject.getObjectByClassMap Dim obj As IPersistableObject 'Dim col As IList @@ -596,6 +1020,17 @@ Return obj End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Produces a string representation of the ReferencedObject + ''' </summary> + ''' <returns>A string containing the object type and key values.</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overrides Function ToString() As String Dim s As String Dim i As Short @@ -647,10 +1082,32 @@ Return s End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetSourceObject() As Object Implements IPersistableObject.GetSourceObject Return m_object End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overridable Function HasValidKey() As Boolean Implements IPersistableObject.HasValidKey 'Check for any non-null key attributes Dim am As AttributeMap @@ -664,6 +1121,16 @@ Return False End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Private Sub CopyOneToManyCollections() Implements IPersistableObject.CopyOneToManyCollections Dim cm As ClassMap Dim coll As Object @@ -682,6 +1149,18 @@ End While End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <param name="propertyName"> </param> + ''' <returns> </returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetRemovedCollectionItems(ByVal propertyName As String) As Collection Implements IPersistableObject.GetRemovedCollectionItems Dim iListType, iDicType As Type Dim origColl, collItem As Object @@ -762,6 +1241,17 @@ End Try End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' See IPersistableObject + ''' </summary> + ''' <returns>Always returns false for InjectedObjects</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function IsIPersistentObject() As Boolean Implements IPersistableObject.IsIPersistentObject Return False End Function Index: modPersistenceBrokerSingleton.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modPersistenceBrokerSingleton.vb,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- modPersistenceBrokerSingleton.vb 11 Apr 2005 00:31:44 -0000 1.11 +++ modPersistenceBrokerSingleton.vb 20 May 2005 06:03:42 -0000 1.12 @@ -3,7 +3,7 @@ Imports System.Reflection '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Module : modPersistenceBrokerSingleton ''' '''----------------------------------------------------------------------------- @@ -139,14 +139,14 @@ End Module '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Module : modOIDFactorySingleton ''' '''----------------------------------------------------------------------------- ''' <summary> ''' Module for managing the ObjectID Factory singleton object ''' </summary> -''' <remarks>Manages the references to the singleton <see cref="T:Atoms.Framework.OIDFactory"/> object.</remarks> +''' <remarks>Manages the references to the singleton <see cref="T:AtomsFramework.OIDFactory"/> object.</remarks> ''' <history> ''' [rbanks] 18/12/2003 Created ''' </history> @@ -157,7 +157,7 @@ ''' Gets a reference to the OIDFactory instance. ''' </summary> ''' <returns>A reference to the OIDFactory object.</returns> - ''' <remarks>If the <see cref="T:Atoms.Framework.OIDFactory"/> instance does not yet + ''' <remarks>If the <see cref="T:AtomsFramework.OIDFactory"/> instance does not yet ''' exist it is created.</remarks> ''' <history> ''' [rbanks] 18/12/2003 Created Index: IConfigLoader.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IConfigLoader.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- IConfigLoader.vb 11 Apr 2005 00:31:44 -0000 1.5 +++ IConfigLoader.vb 20 May 2005 06:03:42 -0000 1.6 @@ -5,16 +5,29 @@ '''----------------------------------------------------------------------------- ''' <summary> ''' Interface that must be implemented by various configuration loaders. -''' <para>Currently only the XmlConfigLoader implements this interface. There is a -''' IConfigLoader object but it is uncoded and a place holder for future expansion.</para> ''' </summary> +''' <remarks><para>Currently only the XmlConfigLoader implements this interface. There is a +''' ConfigLoader object but it is just a shell and is a place holder for future expansion.</para> +''' </remarks> '''----------------------------------------------------------------------------- Public Interface IConfigLoader + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Loads a O/R mapping conguration + ''' </summary> + ''' <param name="dbMap">A database map to populate</param> + ''' <param name="clMap">A classmap to populate</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Sub LoadConfig(ByRef dbMap As HybridDictionary, ByRef clMap As HybridDictionary) End Interface '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : IConfigLoader ''' '''----------------------------------------------------------------------------- @@ -37,6 +50,18 @@ 'This is the reason for the interface '************************************************** + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Empty declaration + ''' </summary> + ''' <param name="dbMap">Unused</param> + ''' <param name="clMap">Unused</param> + ''' <remarks>This is a placeholder declaration only and serves no purpose currently. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub LoadConfig(ByRef dbMap As HybridDictionary, ByRef clMap As HybridDictionary) Implements IConfigLoader.loadConfig End Sub Index: CBetweenCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CBetweenCriteria.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CBetweenCriteria.vb 11 Apr 2005 00:31:42 -0000 1.4 +++ CBetweenCriteria.vb 20 May 2005 06:03:39 -0000 1.5 @@ -1,7 +1,7 @@ Option Strict Off Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : CBetweenCriteria ''' '''----------------------------------------------------------------------------- Index: CMultiRetrieveCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMultiRetrieveCriteria.vb,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- CMultiRetrieveCriteria.vb 11 Apr 2005 00:31:43 -0000 1.21 +++ CMultiRetrieveCriteria.vb 20 May 2005 06:03:40 -0000 1.22 @@ -4,7 +4,7 @@ Imports System.Collections.Specialized '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : MultiRetrieveCriteria ''' '''----------------------------------------------------------------------------- Index: COrderEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/COrderEntry.vb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- COrderEntry.vb 11 Apr 2005 00:31:43 -0000 1.6 +++ COrderEntry.vb 20 May 2005 06:03:40 -0000 1.7 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : OrderEntry ''' '''----------------------------------------------------------------------------- Index: CNotEqualToCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CNotEqualToCriteria.vb,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CNotEqualToCriteria.vb 11 Apr 2005 00:31:43 -0000 1.8 +++ CNotEqualToCriteria.vb 20 May 2005 06:03:40 -0000 1.9 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : NotEqualToCriteria ''' '''----------------------------------------------------------------------------- Index: CEqualToCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CEqualToCriteria.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CEqualToCriteria.vb 11 Apr 2005 00:31:43 -0000 1.7 +++ CEqualToCriteria.vb 20 May 2005 06:03:40 -0000 1.8 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : EqualToCriteria ''' '''----------------------------------------------------------------------------- Index: AtomsFramework.ndoc =================================================================== RCS file: /cvsroot/jcframework/dotnet/AtomsFramework.ndoc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AtomsFramework.ndoc 11 Apr 2005 00:31:41 -0000 1.2 +++ AtomsFramework.ndoc 20 May 2005 06:03:36 -0000 1.3 @@ -1,6 +1,6 @@ <project SchemaVersion="1.3"> <assemblies> - <assembly location=".\bin\Atoms.Framework.dll" documentation=".\bin\Atoms.Framework.xml" /> + <assembly location=".\bin\AtomsFramework.dll" documentation=".\bin\AtomsFramework.xml" /> </assemblies> <documenters> <documenter name="JavaDoc"> @@ -22,8 +22,17 @@ <property name="HtmlHelpName" value="AtomsFramework" /> <property name="Title" value="AtomsFramework Persistence Layer Reference Guide" /> <property name="ShowVisualBasic" value="True" /> + <property name="SdkLinksOnWeb" value="True" /> + <property name="ShowMissingSummaries" value="True" /> + <property name="ShowMissingRemarks" value="True" /> + <property name="ShowMissingParams" value="True" /> + <property name="ShowMissingReturns" value="True" /> + <property name="ShowMissingValues" value="True" /> <property name="AssemblyVersionInfo" value="AssemblyVersion" /> + <property name="CopyrightText" value="(c) Copyright, Richard Banks, 2005. Licensed using the LGPL License" /> + <property name="FeedbackEmailAddress" value="rba...@ms..." /> <property name="UseNamespaceDocSummaries" value="True" /> + <property name="Preliminary" value="True" /> </documenter> <documenter name="MSDN 2003"> <property name="OutputDirectory" value=".\doc\" /> Index: COID.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/COID.vb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- COID.vb 11 Apr 2005 00:31:43 -0000 1.6 +++ COID.vb 20 May 2005 06:03:40 -0000 1.7 @@ -1,7 +1,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : OID ''' '''----------------------------------------------------------------------------- @@ -16,7 +16,7 @@ ''' <para>Each time a new object id is created the B-Value is generated by incrementing the previous ''' B-Value.</para> ''' </remarks> -''' <seealso cref="T:Atoms.Framework.OIDFactory"/> +''' <seealso cref="T:AtomsFramework.OIDFactory"/> ''' <history> ''' [rbanks] 12/12/2003 Created ''' </history> Index: CCacheEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCacheEntry.vb,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- CCacheEntry.vb 11 Apr 2005 00:31:42 -0000 1.33 +++ CCacheEntry.vb 20 May 2005 06:03:39 -0000 1.34 @@ -4,7 +4,7 @@ Imports System.Reflection '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : CacheEntry ''' '''----------------------------------------------------------------------------- @@ -80,10 +80,20 @@ End Get End Property - 'When loading objects, the cache contains a partially loaded object. - 'Instead of returning a copy of the object we need to return the object itself - 'Otherwise circular references during loading will refer to partial object copies instead of - 'the real object. + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' A copy of the object as it was when it was before any changes occurred. + ''' </summary> + ''' <value></value> + ''' <remarks>When starting a transaction the framework will make a copy of the current object as the original object so that any + ''' cache transaction rollbacks can restore the object back to it's original state. + ''' <para>During object retrieval the cache often contains partially loaded objects. Instead of returning a copy of the object we + ''' need to return the object itself to prevent infinited loops. This property contains the partially loaded object.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property OriginalObject() As IPersistableObject Get Return m_originalObject @@ -124,6 +134,16 @@ End Set End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Makes a copy of the object referenced by the cache entry. + ''' </summary> + ''' <remarks>The copies are placed in internal properties for later use. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub CopyObject() 'Need two object copies 'One for the copy made at the very start of the transaction @@ -133,14 +153,45 @@ m_objectCopyAtTransactionStart = m_object.Copy End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Makes a copy of an object in it's current state and stores it in an internal property. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub UpdateObject() m_objectCopy = m_object.Copy End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Restores an object back to it's state at the start of a transaction. + ''' </summary> + ''' <remarks>This method is only used during the rollback of a cache transaction. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub RestoreObject() m_object = m_objectCopyAtTransactionStart End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Creates a new instance of the CacheEntry class with a specified lifetime. + ''' </summary> + ''' <param name="lifetime">The lifetime (in minutes) of the cache entry</param> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub New(ByVal lifetime As Double) m_expiryTime = DateAdd(DateInterval.Minute, lifetime, Now) End Sub @@ -149,6 +200,18 @@ m_expiryTime = DateAdd(DateInterval.Minute, lifetime, Now) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Creates a string representation of the cache entry + ''' </summary> + ''' <returns></returns> + ''' <remarks>The string returned by this method shows the state of the cache entry, and provides + ''' and indication of the referenced object using the objects type name and the key properties of the object. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overrides Function ToString() As String Dim s As String Dim i As Short @@ -194,8 +257,8 @@ s &= [String].Format(formatString, "---------", "-------------", "--------------") i = 0 cm = m_object.GetClassMap() - For i = 1 To cm.getKeySize - am = cm.getKeyAttributeMap(i) + For i = 1 To cm.GetKeySize + am = cm.GetKeyAttributeMap(i) x = m_object.GetValueByAttribute(am.Name) Try xstring = x.ToString @@ -227,7 +290,7 @@ End Class '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : CacheKey ''' '''----------------------------------------------------------------------------- @@ -253,26 +316,46 @@ Private m_hasLegitValues As Boolean Private m_hashCode As Integer + '''----------------------------------------------------------------------------- ''' <summary> ''' Creates a new instance of a CacheKey object ''' </summary> - ''' <param name="obj">The persistent object we are generating a cache key for.</param> - ''' <remarks>Creates a new cache key entry based on the key fields in the object. Works - ''' regardless of wether the object uses ObjectID's or has it's own key fields.</remarks> + ''' <remarks>Until an object is provided and key values populated the object may behave incorrectly.</remarks> ''' <history> ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub New() m_keyvalues = New Collection End Sub + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Creates a new instance of a CacheKey object + ''' </summary> + ''' <param name="obj">The persistent object we are generating a cache key for.</param> + ''' <remarks>Creates a new cache key entry based on the key fields in the object. Works + ''' regardless of wether the object uses ObjectID's or has it's own key fields.</remarks> + ''' <history> + ''' [rbanks] 27/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub New(ByVal obj As IPersistableObject) PopulateWith(obj) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Populates the cache key with values from the referenced object + ''' </summary> + ''' <param name="obj">The object to use as a source of data</param> + ''' <remarks>The cache key values are generated by processing the key values of the referenced object. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Sub PopulateWith(ByVal obj As IPersistableObject) Dim cm As ClassMap Dim i As Integer @@ -351,8 +434,8 @@ ''' <summary> ''' Gets a specific key value ''' </summary> - ''' <param name="i">The index of the key value to return</param> - ''' <value>The value of the key entry in position "i"</value> + ''' <param name="index">The index of the key value to return</param> + ''' <value>The value of the key entry in position "index"</value> ''' <remarks>Returns the value of the "i"th key entry used in the cache key.</remarks> ''' <history> ''' [rbanks] 27/11/2003 Created @@ -368,7 +451,7 @@ ''' <summary> ''' Determines if the key of an object is equivalent to the current cache key. ''' </summary> - ''' <param name="obj1">The object to be compared</param> + ''' <param name="obj">The object to be compared</param> ''' <returns>Boolean indicating equality</returns> ''' <remarks>A cache key is generated for the passed in object and this is compared ''' to the current cache key. The values of each of the individual key entries are @@ -466,7 +549,7 @@ ''' <summary> ''' Converts a cache key to a string. ''' </summary> - ''' <returns></returns> + ''' <returns>A string containing the cache key data.</returns> ''' <remarks>The string that is produced lists each of the key attributes and then ''' shows the values of each attribute. If the attribute cannot be diplayed then ''' an unprintable message is shown @@ -503,7 +586,7 @@ End Class '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : CacheEntryCollection ''' '''----------------------------------------------------------------------------- @@ -532,9 +615,49 @@ Private m_expiryInterval As Double Private m_objectsLoading As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Status types for cache operations. + ''' </summary> + ''' <remarks>These status values are used to determine the result of the last retrieval operation on the cache. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Enum CacheStatus + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The requested object was found. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Found + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The requested object could not be found + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- NotFound + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The requested object was found but is marked for deletion. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Deleted End Enum Private m_status As CacheStatus @@ -686,7 +809,7 @@ ''' <summary> ''' Default Property. Returns the object from the cache with the specified ObjectID. ''' </summary> - ''' <param name="OIDValue">The ObjectID of the object to locate.</param> + ''' <param name="oidValue">The ObjectID of the object to locate.</param> ''' <value>Returns a copy of the matching cached object, or nothing if no match could be found.</value> ''' <remarks>Locates an entry in the cache based on the object ID. If an entry is found ''' a copy of the matching persistent object is returned, otherwise Nothing is returned. @@ -699,7 +822,7 @@ Default Public Overloads ReadOnly Property Item(ByVal oidValue As String) As IPersistableObject Get Dim ce As CacheEntry - ce = MyBase.Item(OidValue) + ce = MyBase.Item(oidValue) If ce Is Nothing Then m_status = CacheStatus.NotFound Return Nothing @@ -929,6 +1052,18 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates if the cache is currently loading new objects. + ''' </summary> + ''' <returns></returns> + ''' <remarks>This flag controls the behaviour of the cache when returning objects. If the flag is true then the cache will return object references to the cached object. + ''' When the flag is false, copies of the cached object are made and a reference to the copied object is returned. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Property ObjectsAreLoading() As Boolean Get Return m_objectsLoading @@ -972,6 +1107,17 @@ End If End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Produces a string that represents the current state of the cache. + ''' </summary> + ''' <returns></returns> + ''' <remarks>The method is useful for debugging purposes. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overrides Function ToString() As String Dim x As DictionaryEntry Dim ce As CacheEntry @@ -996,12 +1142,36 @@ End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The result status of the last cache operation + ''' </summary> + ''' <value></value> + ''' <remarks>The status can be useful to differentiate between a failure to retrieve an object because it isn't cached, or a failure to + ''' retrieve because the object has been marked as deleted. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public ReadOnly Property Status() As CacheStatus Get Return m_status End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Get an ArrayList containing the objects currently in the cache. + ''' </summary> + ''' <returns></returns> + ''' <remarks>This method is useful for debugging purposes if you wish to see what the current contents of the cache are. + ''' It is not recommended that this method be used for any other purpose. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetValueArray() As ArrayList Dim al As ArrayList If Me.Values.Count = 0 Then Return New ArrayList @@ -1011,6 +1181,17 @@ Return al End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Get an ArrayList containing the keys of the cache entries currently in the cache. + ''' </summary> + ''' <returns></returns> + ''' <remarks>This method is useful for debugging purposes but is not recommended for any other use. + ''' </remarks> + ''' <history> + ''' [rbanks] 20/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetKeyArray() As ArrayList Dim al As ArrayList If Me.Keys.Count = 0 Then Return New ArrayList Index: CTableMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CTableMap.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CTableMap.vb 11 Apr 2005 00:31:44 -0000 1.7 +++ CTableMap.vb 20 May 2005 06:03:42 -0000 1.8 @@ -2,7 +2,7 @@ Option Explicit On '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : TableMap ''' '''----------------------------------------------------------------------------- Index: CPersistentCollection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentCollection.vb,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CPersistentCollection.vb 11 Apr 2005 00:31:44 -0000 1.20 +++ CPersistentCollection.vb 20 May 2005 06:03:41 -0000 1.21 @@ -3,7 +3,7 @@ Imports System.Reflection '''----------------------------------------------------------------------------- -''' Project : Atoms.Framework +''' Project : AtomsFramework ''' Class : PersistentObjectCollection ''' '''----------------------------------------------------------------------------- Index: CMultiSummaryCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMultiSummaryCriteria.vb,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- CMultiSummaryCriteria.vb 11 Apr 2005 00:31:43 -0000 1.18 +++ CMultiSummaryCriteria.vb 20 May 2005 06:03:40 -0000 1.19 @@ -2,7 +2,7 @@ Option Explicit On '''-----------------... [truncated message content] |
From: Richard B. <rb...@us...> - 2005-05-19 04:06:56
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16426 Modified Files: userguide.sh5 Log Message: Extra doco for transactions, performance counters, and retrieve criteria Index: userguide.sh5 =================================================================== RCS file: /cvsroot/jcframework/dotnet/userguide.sh5,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 Binary files /tmp/cvsFwdThK and /tmp/cvsFUPPhb differ |
From: Richard B. <rb...@us...> - 2005-05-10 23:27:36
|
Update of /cvsroot/jcframework/dotnet/ADOKits In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24267/ADOKits Added Files: FirebirdNETProvider-1.7-RC1-NET1.1.exe Informix Client SDK 2.81 TC3.url Npgsql0.7beta3-bin.zip mysql-connector-net-1.0.4.zip Log Message: Added install kits for ADO.NET providers. --- NEW FILE: Informix Client SDK 2.81 TC3.url --- [InternetShortcut] URL=http://www14.software.ibm.com/webapp/download/preconfig.jsp?id=2004-12-28+15%3A33%3A23.153339R&cat=&fam=&s=z&S_TACT=104AH%20W42&S_CMP= Modified=8058446AB655C50157 --- NEW FILE: mysql-connector-net-1.0.4.zip --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Npgsql0.7beta3-bin.zip --- (This appears to be a binary file; contents omitted.) --- NEW FILE: FirebirdNETProvider-1.7-RC1-NET1.1.exe --- (This appears to be a binary file; contents omitted.) |
From: Richard B. <rb...@us...> - 2005-05-10 23:27:36
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24267 Modified Files: userguide.sh5 Log Message: Added install kits for ADO.NET providers. Index: userguide.sh5 =================================================================== RCS file: /cvsroot/jcframework/dotnet/userguide.sh5,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 Binary files /tmp/cvsgZhxey and /tmp/cvsyo2GkM differ |
From: Richard B. <rb...@us...> - 2005-05-10 23:20:40
|
Update of /cvsroot/jcframework/dotnet/ADOKits In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23375/ADOKits Log Message: Directory /cvsroot/jcframework/dotnet/ADOKits added to the repository |
From: Richard B. <rb...@us...> - 2005-05-09 00:29:26
|
Update of /cvsroot/jcframework/dotnet/Nunit/InheritedClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31743/Nunit/InheritedClasses Modified Files: RetrieveCriteriaTests.vb Log Message: Fixed sorted GetAll and added extra unit test Index: RetrieveCriteriaTests.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Nunit/InheritedClasses/RetrieveCriteriaTests.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- RetrieveCriteriaTests.vb 11 Apr 2005 00:31:49 -0000 1.1 +++ RetrieveCriteriaTests.vb 9 May 2005 00:29:15 -0000 1.2 @@ -39,11 +39,19 @@ emp = New CEmployee End Sub + <Test()> Public Sub SortedGetAll() + Dim poc As New PersistentObjectCollection + Dim attribute As New Collection + attribute.Add("Name") + poc = emp.GetAll(attribute, attribute) + Assert.IsTrue(poc.Count > 0) + End Sub + <Test()> Public Sub SingleClassRetrieve() r = New RetrieveCriteria - r.ClassMap = emp.getClassMap - c = r.perform - Assert.IsTrue(c.hasElements) + r.ClassMap = emp.GetClassMap + 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) @@ -53,56 +61,56 @@ Dim si As SelectInCriteria mr = New MultiRetrieveCriteria(emp) - mr.WhereCondition.addSelectEqualTo("Name", "ac") + mr.WhereCondition.AddSelectEqualTo("Name", "ac") si = New SelectInCriteria(emp) - si.WhereCondition.addSelectEqualTo("Name", "ac") + si.WhereCondition.AddSelectEqualTo("Name", "ac") si.SetSelectAttribute("Name") - mr.WhereCondition.addSelectNotIn("Name", si) - c = mr.perform - Assert.IsFalse(c.hasElements) + mr.WhereCondition.AddSelectNotIn("Name", si) + c = mr.Perform + Assert.IsFalse(c.HasElements) Assert.IsTrue(c.EOF) End Sub <Test()> Public Sub RetrieveCriteriaOffset() r = New RetrieveCriteria - r.ClassMap = emp.getClassMap + r.ClassMap = emp.GetClassMap r.RowLimit = 1 r.Offset = 1 - c = r.perform - Assert.IsTrue(c.hasElements) + c = r.Perform + Assert.IsTrue(c.HasElements) Assert.AreEqual(1, c.TotalRows) End Sub <Test()> Public Sub LoadFullObjects() r = New RetrieveCriteria r.ReturnFullObjects = True - c = r.perform(emp) + c = r.Perform(emp) Assert.IsFalse(c.HoldsProxies) - While c.hasElements And Not c.EOF + While c.HasElements And Not c.EOF emp = New CEmployee - c.loadObject(emp) + c.LoadObject(emp) Assert.IsTrue(emp.Persistent) - c.nextCursor() + c.NextCursor() End While c.SetCursor(0) emp = New CEmployee - c.loadObject(emp) + c.LoadObject(emp) Assert.AreEqual(emp.Name, "ab") End Sub <Test()> Public Sub SimpleOrCriteria() r = New RetrieveCriteria - r.ClassMap = emp.getClassMap - r.WhereCondition.addSelectEqualTo("Name", "aa") - r.WhereCondition.addSelectEqualTo("Name", "b", True) - c = r.perform - Assert.IsTrue(c.hasElements) + r.ClassMap = emp.GetClassMap + 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) + c.LoadObject(emp) Assert.AreEqual(emp.Name, "aa") - c.nextCursor() + c.NextCursor() emp = New CEmployee - c.loadObject(emp) + c.LoadObject(emp) Assert.AreEqual(emp.Name, "b") End Sub @@ -111,16 +119,16 @@ al.Add("aa") al.Add("b") r = New RetrieveCriteria - r.ClassMap = emp.getClassMap - r.WhereCondition.addSelectInList("Name", al) - c = r.perform - Assert.IsTrue(c.hasElements) + r.ClassMap = emp.GetClassMap + 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) + c.LoadObject(emp) Assert.AreEqual(emp.Name, "aa") - c.nextCursor() + c.NextCursor() emp = New CEmployee - c.loadObject(emp) + c.LoadObject(emp) Assert.AreEqual(emp.Name, "b") End Sub @@ -131,27 +139,27 @@ Dim xx_4 As New CriteriaCondition r = New RetrieveCriteria - r.ClassMap = emp.getClassMap + r.ClassMap = emp.GetClassMap 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) + 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 + While c.HasElements And Not c.EOF emp = New CEmployee - c.loadObject(emp) + c.LoadObject(emp) Assert.AreEqual(emp.Name, "ab") - c.nextCursor() + c.NextCursor() End While End Sub End Class |
From: Richard B. <rb...@us...> - 2005-05-09 00:29:26
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31743 Modified Files: CPersistentObject.vb Log Message: Fixed sorted GetAll and added extra unit test Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- CPersistentObject.vb 21 Apr 2005 23:00:29 -0000 1.68 +++ CPersistentObject.vb 9 May 2005 00:29:15 -0000 1.69 @@ -1476,11 +1476,26 @@ For inIndex = 1 To orderCollection.Count boAscend = True If Not IsNothing(orderAscendCollection) Then - If orderAscendCollection.Item(orderCollection.Item(inIndex)) Is Nothing Then - boAscend = False - End If + Try + If orderAscendCollection.Item(orderCollection.Item(inIndex)) Is Nothing Then + boAscend = False + End If + Catch + Try + boAscend = False + Dim oo As Object = orderCollection.Item(inIndex) + For Each o As Object In orderAscendCollection + If o = oo Then + boAscend = True + Exit For + End If + Next + Catch + boAscend = False + End Try + End Try Else - boAscend = False + boAscend = False End If obRC.AddOrderAttributeByAscend(orderCollection(inIndex), boAscend) Next |
From: Richard B. <rb...@us...> - 2005-05-03 00:24:12
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27558 Modified Files: userguide.sh5 Log Message: Added AFAttribute mapping section Index: userguide.sh5 =================================================================== RCS file: /cvsroot/jcframework/dotnet/userguide.sh5,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 Binary files /tmp/cvsaVFGf9 and /tmp/cvs8l6MsU differ |
From: Richard B. <rb...@us...> - 2005-04-29 04:36:03
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18918 Modified Files: userguide.sh5 Log Message: minor update Index: userguide.sh5 =================================================================== RCS file: /cvsroot/jcframework/dotnet/userguide.sh5,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Binary files /tmp/cvs2s5Pv3 and /tmp/cvsjfqfKR differ |
From: Richard B. <rb...@us...> - 2005-04-21 23:00:44
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4502 Modified Files: CInjectedObject.vb CPersistentObject.vb userguide.sh5 Log Message: Changes to properly support MSSQL Guid columns Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- CInjectedObject.vb 11 Apr 2005 23:27:06 -0000 1.27 +++ CInjectedObject.vb 21 Apr 2005 23:00:28 -0000 1.28 @@ -449,6 +449,8 @@ If dotPos = -1 Then If TypeOf (value) Is System.SByte Then CallByName(obj, name, CallType.Set, IIf(value.ToString = "1", True, False)) + ElseIf TypeOf (value) Is System.Guid Then + CallByName(obj, name, CallType.Set, CType(value, Guid).ToString("N")) Else CallByName(obj, name, CallType.Set, value) End If @@ -467,6 +469,8 @@ val = o If TypeOf (value) Is System.SByte Then CallByName(val, propertyName, CallType.Set, IIf(value.ToString = "1", True, False)) + ElseIf TypeOf (value) Is System.Guid Then + CallByName(val, name, CallType.Set, CType(value, Guid).ToString("N")) Else CallByName(val, propertyName, CallType.Set, value) End If @@ -474,6 +478,8 @@ Else If TypeOf (value) Is System.SByte Then CallByName(o, propertyName, CallType.Set, IIf(value.ToString = "1", True, False)) + ElseIf TypeOf (value) Is System.Guid Then + CallByName(o, name, CallType.Set, CType(value, Guid).ToString("N")) Else CallByName(o, propertyName, CallType.Set, value) End If Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- CPersistentObject.vb 11 Apr 2005 23:27:07 -0000 1.67 +++ CPersistentObject.vb 21 Apr 2005 23:00:29 -0000 1.68 @@ -515,9 +515,11 @@ Try If dotPos = -1 Then If TypeOf (Value) Is System.SByte Then - CallByName(Me, name, CallType.Set, IIf(Value.ToString = "1", True, False)) + CallByName(Me, name, CallType.Set, IIf(value.ToString = "1", True, False)) + ElseIf TypeOf (value) Is System.Guid Then + CallByName(Me, name, CallType.Set, CType(value, Guid).ToString("N")) Else - CallByName(Me, name, CallType.Set, Value) + CallByName(Me, name, CallType.Set, value) End If Else Dim o As Object @@ -531,15 +533,19 @@ val = o If TypeOf (Value) Is System.SByte Then CallByName(val, propertyName, CallType.Set, IIf(Value.ToString = "1", True, False)) + ElseIf TypeOf (value) Is System.Guid Then + CallByName(val, name, CallType.Set, CType(value, Guid).ToString("N")) Else - CallByName(val, propertyName, CallType.Set, Value) + CallByName(val, propertyName, CallType.Set, value) End If CallByName(Me, objName, CallType.Set, val) Else If TypeOf (Value) Is System.SByte Then CallByName(o, propertyName, CallType.Set, IIf(Value.ToString = "1", True, False)) + ElseIf TypeOf (value) Is System.Guid Then + CallByName(o, name, CallType.Set, CType(value, Guid).ToString("N")) Else - CallByName(o, propertyName, CallType.Set, Value) + CallByName(o, propertyName, CallType.Set, value) End If End If End If Index: userguide.sh5 =================================================================== RCS file: /cvsroot/jcframework/dotnet/userguide.sh5,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Binary files /tmp/cvsz5Mg5j and /tmp/cvstEf0y7 differ |
From: Richard B. <rb...@us...> - 2005-04-21 23:00:43
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_MSSQL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4502/Providers/AF_MSSQL Modified Files: CMsSqlConnection.vb Log Message: Changes to properly support MSSQL Guid columns Index: CMsSqlConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_MSSQL/CMsSqlConnection.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CMsSqlConnection.vb 11 Apr 2005 00:31:45 -0000 1.3 +++ CMsSqlConnection.vb 21 Apr 2005 23:00:34 -0000 1.4 @@ -215,6 +215,11 @@ param = New SqlParameter param.ParameterName = cp.Name param.SqlDbType = CType(cp.Column.ProviderType, SqlDbType) + If param.SqlDbType = SqlDbType.UniqueIdentifier Then + If TypeOf cp.Value Is String Then + cp.Value = New Guid(CType(cp.Value, String)) + End If + End If If TypeOf (cp.Value) Is DateTime Then dd = cp.Value If dd.Ticks = 0 Then @@ -271,6 +276,11 @@ param = New SqlParameter param.ParameterName = cp.Name param.SqlDbType = CType(cp.Column.ProviderType, SqlDbType) + If param.SqlDbType = SqlDbType.UniqueIdentifier Then + If TypeOf cp.Value Is String Then + cp.Value = New Guid(CType(cp.Value, String)) + End If + End If If TypeOf (cp.Value) Is DateTime Then dd = cp.Value If dd.Ticks = 0 Then |
From: Richard B. <rb...@us...> - 2005-04-14 06:33:46
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20467 Modified Files: userguide.sh5 Log Message: User guide update Index: userguide.sh5 =================================================================== RCS file: /cvsroot/jcframework/dotnet/userguide.sh5,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvsCYWfMM and /tmp/cvsHz9wbj differ |
From: Richard B. <rb...@us...> - 2005-04-13 13:14:00
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20393 Added Files: AtomsFramework.snk Log Message: Readd strong name key as binary not text --- NEW FILE: AtomsFramework.snk --- (This appears to be a binary file; contents omitted.) |
From: Richard B. <rb...@us...> - 2005-04-13 13:12:21
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19549 Removed Files: AtomsFramework.snk Log Message: Removed SNK file. Will re-add in a minute --- AtomsFramework.snk DELETED --- |
From: Richard B. <rb...@us...> - 2005-04-13 13:10:57
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18883 Modified Files: AssemblyInfo.vb Log Message: Refreshed strong name key after some wierd CVS glitch Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/AssemblyInfo.vb,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- AssemblyInfo.vb 11 Apr 2005 00:31:41 -0000 1.16 +++ AssemblyInfo.vb 13 Apr 2005 13:10:39 -0000 1.17 @@ -8,7 +8,7 @@ <Assembly: AssemblyTitle("Atoms Persistence Framework")> <Assembly: AssemblyDescription("Object/Relational Persistence Layer for .NET")> <Assembly: AssemblyCompany("")> -<Assembly: AssemblyProduct("Atoms.Framework")> +<Assembly: AssemblyProduct("AtomsFramework")> <Assembly: AssemblyCopyright("")> <Assembly: AssemblyTrademark("")> <Assembly: AssemblyCulture("")> |
From: Richard B. <rb...@us...> - 2005-04-12 23:11:41
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28767 Modified Files: readme.html Log Message: Index: readme.html =================================================================== RCS file: /cvsroot/jcframework/dotnet/readme.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- readme.html 2 Feb 2005 05:08:38 -0000 1.7 +++ readme.html 12 Apr 2005 23:11:28 -0000 1.8 @@ -108,7 +108,7 @@ <table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr> - <th class="thHead">Atoms Framework Release Notes</th> + <th class="thHead">AtomsFramework Release Notes</th> </tr> </table> @@ -117,11 +117,14 @@ <!-- BEGIN faq_block --> <table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0" align="center"> <tr> - <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.1<br />Released: xx-xxx-200x</span></td> + <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.2 Release Candidate 1<br />Released: 13-Apr-2005</span></td> </tr> <tr> <td align="center"> -<span>Thank you for choosing to use the AtomsFramework. We trust that you enjoy using it and that you find it useful. If you have any questions please visit the project home page and leave a message in the forums.<br/> +<span>Thank you for choosing to use the AtomsFramework.</br> +We trust that you enjoy using it and that you find it useful.</br></br> +If you have any questions please post a message in the forums.<br/> +Documentation for this release candidate is currently being developed - please be patient while this occurs.<br /> <br/> - Richard.<br /> <br/> @@ -137,9 +140,12 @@ <div id="faq_a_installation" style="display:none;"> <table class="bodyline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr><td align="left" valign="top"><span class="postbody"> -This is a source code release so installation is fairly trivial. To get this project working you must have installed the ADO.NET provider for MySQL (even if you don't use MySQL). This is included in the archive (ByteFX and SharpZipLib) or you can get the latest from <a href="http://sourceforge.net/projects/mysqlnet/">http://sourceforge.net/projects/mysqlnet/</a><br/> +This is a source code release so installation is trivial.</br> +Note:- There are many database providers included in this release. Some providers require ADO.NET drivers not included +in the standard Visual Studio releases. Unless you are using these providers you can safely exclude them from the solution and you +do not need to compile them. You only need the provider(s) for the database(s) you will work with.<br/> <br/> -The archive also includes sample projects and <a href="http://www.nunit.org/">NUnit</a> tests (Nunit 2.2) to get you started.<br/> +The archive includes some simple sample projects and the <a href="http://www.nunit.org/">NUnit</a> tests (Nunit 2.2.2) to get you started.<br/> <br/> <i>VBSample</i> is written in VB.NET<br/> <i>CSSample</i> is the same project written in C#<br/> @@ -149,10 +155,10 @@ </div> <tr> <td class="groupHeader" align="left" valign="top"> - <div onclick="return CFAQ.display('faq_a_notesv2.1', false);" style="width:100%;cursor:pointer;cursor:hand;"> - <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.1', true);" onfocus="this.blur();"><b>Changes in v2.1 (xx-xxx-xx)</b></a></span> + <div onclick="return CFAQ.display('faq_a_notesv2.2RC1', false);" style="width:100%;cursor:pointer;cursor:hand;"> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.1', true);" onfocus="this.blur();"><b>Changes in v2.2 RC1 (13-Apr-2005)</b></a></span> </div> - <div id="faq_a_notesv2.1" style="display:none;"> + <div id="faq_a_notesv2.2RC1" style="display:none;"> <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> <tr class="tableCaption"><td colspan=3>Bugs:</td></tr> <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> @@ -184,6 +190,23 @@ <td class="col1">Collections not restored after transaction rollback</td> <td>Collections are now cloned or copied at the start of a transaction. If the transaction aborts the copied collections are restored to the object.<td> </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Event and Caching</td> + <td>If an object had event listeners attached to it and it was then updated to the cache, these events would + also be cached. Event delegates are now ignored when copying objects into the cache.<td> + </tr> + <tr valign="top"> + <td>1155465</td> + <td class="col1">Saving an object without first doing a retrieve</td> + <td>Saving non-inherited objects without first retrieving them could cause problems if the object already exists</br> + The framework will now attempt to insert and if that fails then attempt to update.<td> + </tr> + <tr valign="top"> + <td>1154254</td> + <td class="col1">Missing alias in MultiSummaryCriteria</td> + <td>SQL Generation was incorrectly excluding table alias names in the where clause.<td> + </tr> <tr class="tableCaption" valign="bottom"> <td colspan=3><br/>Modifications</td> </tr> @@ -191,11 +214,73 @@ <td class="colHeader">Description</td> <td class="colHeader">Details</td> </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Name Changes</td> + <td>A lot of classes, properties and methods have changed names since the 2.0 release to + align the framework with the Microsoft class library standards. FxCop was used in this + process and the fxcop project is included in the release.</br> + Changes to naming are as follows:</br> + 1. Namespace changed from AToMSFramework to AtomsFramework </br> + 2. Classes drop the leading C. C<classname> becomes <classname></br> + eg CPersistentObject -> PersistentObject</br> + 3. Interfaces changed to I<interfacename></br> + eg _CConnection -> IConnection</br> + 4. Method and Property names are PascalCased (first letter capitalised)</br> + 5. Parameter names are camelCased (first letter in lowercase)</br></br> + Specific class name changes: </br><ul> + <li>CCacheCollection -> CacheEntryCollection</li> + <li>CAssociationObject -> AssociationItem</li> + <li>CCursor -> ResultCursor</li> + <li>CPersistentCollection -> PersistentObjectCollection</li> + <li>CSQLStatement -> AtomsSqlStatement</li> + <li>CSQLParameter -> AtomsSqlParameter</li> + <li>CUDAMap -> AssociationMap</li> + <li>CUDAMapEntry -> AssociationMapEntry</li></ul> + <td> + </tr> + <tr valign="top"> + <td>1112843</td> + <td class="col1">New Database Providers</td> + <td>Database access is now managed via database provider classes instead of being embedded in the framework. + All XML database mappings that use the class="xxx" syntax should be changed to use the provider="yyy"syntax.</br> + Provider names are in the AF_yyy.DLL and can either be referenced using a full path to the .DLL or + you can copy the .DLL to the application directory.</br> + Database providers have been added for PostgreSQL, Informix, Oracle and Firebird/Interbase.<td> + </tr> + <tr valign="top"> + <td>1114653</td> + <td class="col1">Improve Many-To-Many Associations</td> + <td>Previously many to many associations required the creation of a class to manage the + association, and the use of matching one-to-many associations from the participating classes.</br> + This is now replaced by a new many-to-many association that can be supplied with a mapping table + in the database. Posts in the forums explain this.<td> + </tr> <tr valign="top"> <td>N/A</td> <td class="col1">XML Schema</td> <td>Finally got around to creating an XML schema for the XML mapping files.<td> </tr> + <tr valign="top"> + <td>1117175</td> + <td class="col1">Add IsValidToDelete property</td> + <td>Deletion of objects can now be conditionally prevented using the IsValidToDelete property.</br> + Classes that do not inherit from PersistentObject can implement the IValidation interface to gain this functionality.<td> + </tr> + <tr valign="top"> + <td>1047937</td> + <td class="col1">MultiSummaryCriteria with SummaryField for subclasses</td> + <td>MultiSummaryCriteria can now summarise fields in subclasses, not just the main class.<td> + </tr> + <tr valign="top"> + <td>1112357</td> + <td class="col1">One-To-Many association AutoDeletion</td> + <td>One-to-many associations with autodelete ="true" have a different behaviour.</br> + When an object is removed from the collection the object will be deleted without needing + to call an explicit delete simply by saving the parent object. Similarly, objects that + are removed, but are not autodeleted will have their reference fields to the parent object + cleared.<td> + </tr> </table> </div> </td> @@ -215,17 +300,17 @@ <tr valign="top"> <td>N/A</td> <td class="col1">InjectedObjects</td> - <td>hasValidKey was failing in some circumstances<td> + <td>HasValidKey was failing in some circumstances<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Infinite loop during object saving</td> - <td>It was possible for object saving to cause a stack overflow in some rare situations. This is now fixed.<td> + <td>It was possible for object saving to cause a stack overflow in some situations. This is now fixed.<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Invalid Type Cast error during retrieval</td> - <td>Retrieval of objects that do not inherit from CPersistentObject and that have child objects would fail due to a bug in the code. This is now fixed.<td> + <td>Retrieval of objects that do not inherit from PersistentObject and that have child objects would fail. This is now fixed.<td> </tr> <tr class="tableCaption" valign="bottom"> <td colspan=3><br/>Modifications</td> |