From: Richard B. <rb...@us...> - 2005-02-04 04:39:30
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25699 Modified Files: CCacheEntry.vb CInjectedObject.vb Log Message: Fix for collection/transaction handling when using interface based persistence. Fix for x.y format mapping when object x is nothing Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CInjectedObject.vb 31 Jan 2005 06:17:39 -0000 1.9 +++ CInjectedObject.vb 4 Feb 2005 04:39:20 -0000 1.10 @@ -205,6 +205,9 @@ objName = pName.Substring(0, dotPos) propertyName = pName.Substring(dotPos + 1) o = CallByName(m_object, objName, CallType.Get) + If o Is Nothing Then + Return Nothing + End If Return CallByName(o, propertyName, CallType.Get) End If End Function @@ -221,6 +224,9 @@ objName = pName.Substring(0, dotPos) propertyName = pName.Substring(dotPos + 1) o = CallByName(m_originalObject, objName, CallType.Get) + If o Is Nothing Then + Return Nothing + End If Return CallByName(o, propertyName, CallType.Get) End If End Function @@ -427,6 +433,9 @@ objName = pName.Substring(0, dotPos) propertyName = pName.Substring(dotPos + 1) o = CallByName(m_object, objName, CallType.Get) + If o Is Nothing Then + Return Nothing + End If Return CType(CallByName(o, propertyName, CallType.Get), IList) End If Catch err As Exception @@ -450,6 +459,9 @@ objName = pName.Substring(0, dotPos) propertyName = pName.Substring(dotPos + 1) o = CallByName(m_object, objName, CallType.Get) + If o Is Nothing Then + Return Nothing + End If obj = CallByName(o, propertyName, CallType.Get) End If If obj Is Nothing Then Return Nothing @@ -489,6 +501,9 @@ objName = pName.Substring(0, dotPos) propertyName = pName.Substring(dotPos + 1) o = CallByName(m_object, objName, CallType.Get) + If o Is Nothing Then + Return + End If If o.GetType.IsValueType Then val = o If TypeOf (Value) Is System.SByte Then Index: CCacheEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCacheEntry.vb,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CCacheEntry.vb 2 Feb 2005 05:08:37 -0000 1.25 +++ CCacheEntry.vb 4 Feb 2005 04:39:09 -0000 1.26 @@ -148,12 +148,12 @@ coll = Activator.CreateInstance(f.FieldType) 'need to copy references one-by-one If Not iListType Is Nothing Then il = CType(coll, IList) - For Each obj In f.GetValue(m_object) + For Each obj In f.GetValue(m_object.GetSourceObject) il.Add(obj) Next Else id = CType(coll, IDictionary) - For Each de As DictionaryEntry In f.GetValue(m_object) + For Each de As DictionaryEntry In f.GetValue(m_object.GetSourceObject) id.Add(de.Key, de.Value) Next End If @@ -170,7 +170,7 @@ iDicType = f.FieldType.GetInterface("IDictionary", True) 'iEnumerableType = f.FieldType.GetInterface("IEnumerable", True) If Not iListType Is Nothing OrElse Not iDicType Is Nothing Then - 'We must restore this collection from the collection copy 'Just use a straight value assignment - no need to worry about cloning f.SetValue(m_object, m_collectionCollection.Item(f.Name)) End If Next + 'We must restore this collection from the collection copy 'Just use a straight value assignment - no need to worry about cloning f.SetValue(m_object.GetSourceObject, m_collectionCollection.Item(f.Name)) End If Next End Sub Public Sub New(ByVal lifetime As Double) |