From: Richard B. <rb...@us...> - 2005-03-16 09:34:47
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23873 Modified Files: CMultiSummaryCriteria.vb Log Message: Fixes for multisummarycriteria Index: CMultiSummaryCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMultiSummaryCriteria.vb,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- CMultiSummaryCriteria.vb 9 Feb 2005 06:24:44 -0000 1.13 +++ CMultiSummaryCriteria.vb 16 Mar 2005 09:34:25 -0000 1.14 @@ -128,7 +128,8 @@ m_rows = -1 m_Having = Nothing m_fieldsForSum = New Collection - m_methodsForSum = New Collection + m_methodsForSum = New Collection + m_aliasForSum = New Collection End Sub Public Sub New(ByVal obj As CPersistentObject) @@ -220,23 +221,24 @@ am = cm2.GetAssociationMapByName(assocName) If am Is Nothing Then Throw New NoAssociationException("Invalid association " & assocName & " selected - no such association exists") - End If - m_fromCMaps.Add(cm2) - i = m_fromCMaps.Count - mapName = "t" & i.ToString - m_joins = New CJoin(m_joins, cm, mapName, am) - mapName = "t" & (i - 1).ToString - m_joins.LeftTableAlias = mapName - cm = cm.SuperClass - While Not cm Is Nothing - i += 1 - m_fromCMaps.Add(cm) - mapName = "t" & i.ToString - m_joins = New CJoin(m_joins, cm, mapName, True) - mapName = "t" & (i - 1).ToString - m_joins.LeftTableAlias = mapName - cm = cm.SuperClass - End While + End If + cm = obj.GetClassMap + m_fromCMaps.Add(cm) + i = m_fromCMaps.Count + mapName = "t" & i.ToString + m_joins = New CJoin(m_joins, cm, mapName, am) + mapName = "t" & (i - 1).ToString + m_joins.LeftTableAlias = mapName + cm = cm.SuperClass + While Not cm Is Nothing + i += 1 + m_fromCMaps.Add(cm) + mapName = "t" & i.ToString + m_joins = New CJoin(m_joins, cm, mapName, True) + mapName = "t" & (i - 1).ToString + m_joins.LeftTableAlias = mapName + cm = cm.SuperClass + End While End Sub '''----------------------------------------------------------------------------- @@ -264,21 +266,27 @@ For i = 0 To UBound(myArrayStrings) - 1 strName = myArrayStrings(i) - udaMap = clMap.AssociationMaps(strName) - clMap = udaMap.toclass - If clMap Is Nothing Then - Exit For - End If - Next i + udaMap = clMap.AssociationMaps(strName) + If udaMap Is Nothing Then + Throw New AToMSFramework.RetrieveException("Could not find association named " & strName & " for class " & clMap.Name) + End If + clMap = udaMap.ToClass + If clMap Is Nothing Then + Exit For + End If + Next i + attributename = myArrayStrings(UBound(myArrayStrings)) j = m_joins strName = "" While Not j Is Nothing If j.RightSide.Name = clMap.Name Then strName = j.TableAlias - j = Nothing - End If - End While + j = Nothing + Else + j = j.LeftSide + End If + End While m_aliasForSum.Add(strName) m_fieldsForSum.Add(clMap.getAttributeMapByString(attributename, True)) |