From: Richard B. <rb...@us...> - 2004-12-22 04:15:52
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7487 Modified Files: CPersistenceBroker.vb Log Message: fix in retrieveassociation when getting collections in one-to-many associations. Wasn't generating a new object for each iteration through the cursor. Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- CPersistenceBroker.vb 21 Dec 2004 21:57:11 -0000 1.86 +++ CPersistenceBroker.vb 22 Dec 2004 04:15:39 -0000 1.87 @@ -769,8 +769,9 @@ Throw New RetrieveException("Collection " & udaMap.Target & " is not initialised for " & obj.GetObjectType.ToString) End If col.Clear() 'Clear the collection before polpulating, just to be sure - Value = udaMap.ForClass.CreateObjectInstance + While cursor.hasElements And Not cursor.EOF + Value = udaMap.ForClass.CreateObjectInstance anObjPers = Value If udaMap.LazyLoad Then cursor.loadProxy(anObjPers.GetSourceObject) @@ -2567,6 +2568,21 @@ Return getObjectsToSave(obj, True, False) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' 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 + ''' 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. + ''' It will also traverse all superclass associations if required. + ''' </remarks> + ''' <history> + ''' [rbanks] 22/12/2004 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function getObjectsToSave(ByVal obj As CPersistentObject, ByVal checkAssociationsRecursivly As Boolean) As Queue Return getObjectsToSave(obj, True, checkAssociationsRecursivly) End Function |