From: Richard B. <rb...@us...> - 2004-10-07 23:15:24
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30810 Modified Files: CMultiRetrieveCriteria.vb COrderEntry.vb Log Message: Allow order by on MultiRetrieveCriteria to work using attributes of associated classes. Index: COrderEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/COrderEntry.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** COrderEntry.vb 21 Jul 2004 02:55:38 -0000 1.4 --- COrderEntry.vb 7 Oct 2004 23:15:14 -0000 1.5 *************** *** 26,29 **** --- 26,30 ---- Private m_attributeMap As CAttributeMap Private m_ascend As Boolean + Private m_ClassMap As CClassMap '''----------------------------------------------------------------------------- *************** *** 39,43 **** Public Property Ascend() As Boolean Get ! Ascend = m_ascend End Get Set(ByVal Value As Boolean) --- 40,44 ---- Public Property Ascend() As Boolean Get ! Return m_ascend End Get Set(ByVal Value As Boolean) *************** *** 58,62 **** Public Property AttributeMap() As CAttributeMap Get ! AttributeMap = m_attributeMap End Get Set(ByVal Value As CAttributeMap) --- 59,63 ---- Public Property AttributeMap() As CAttributeMap Get ! Return m_attributeMap End Get Set(ByVal Value As CAttributeMap) *************** *** 67,70 **** --- 68,89 ---- '''----------------------------------------------------------------------------- ''' <summary> + ''' The CClassMap the attribute belongs to + ''' </summary> + ''' <value>An Class Map for the table</value> + ''' <remarks></remarks> + ''' <history> + ''' [exelrud] 10/07/2004 Created + ''' </history> + '''----------------------------------------------------------------------------- + Public Property ClassMap() As CClassMap + Get + Return m_ClassMap + End Get + Set(ByVal Value As CClassMap) + m_ClassMap = Value + End Set + End Property + '''----------------------------------------------------------------------------- + ''' <summary> ''' Creates a new instance of the COrderEntry class. ''' </summary> Index: CMultiRetrieveCriteria.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMultiRetrieveCriteria.vb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CMultiRetrieveCriteria.vb 21 Jul 2004 02:55:38 -0000 1.13 --- CMultiRetrieveCriteria.vb 7 Oct 2004 23:15:10 -0000 1.14 *************** *** 256,260 **** Dim orderEntry As COrderEntry orderEntry = New COrderEntry ! orderEntry.AttributeMap = ClassMap.getAttributeMapByString(attributeName, True) orderEntry.Ascend = pAscend m_orderAttributes.Add(orderEntry) --- 256,278 ---- Dim orderEntry As COrderEntry orderEntry = New COrderEntry ! ! If attributeName.IndexOf(".") >= 0 Then ! Dim Parts() As String ! Parts = attributeName.Split(".") ! ! attributeName = Parts(1) ! ! Dim cm As CClassMap ! For Each cm In m_fromCMaps ! If cm.Name.Equals(Parts(0)) Then ! orderEntry.ClassMap = cm ! orderEntry.AttributeMap = cm.getAttributeMapByString(attributeName, True) ! Exit For ! End If ! Next ! Else ! orderEntry.ClassMap = ClassMap ! orderEntry.AttributeMap = ClassMap.getAttributeMapByString(attributeName, True) ! End If orderEntry.Ascend = pAscend m_orderAttributes.Add(orderEntry) *************** *** 318,321 **** --- 336,340 ---- Dim isFirst As Boolean = True Dim mapName As String + Dim ht As New Hashtable statement.addSqlClause(Me.ClassMap.RelationalDatabase.getClauseStringSelect) *************** *** 332,335 **** --- 351,355 ---- j += 1 mapName = "t" & j.ToString + ht.Add(cm.Name, mapName) 'Load each individual column, and process in order of objects to join For i = 1 To cm.getSize *************** *** 374,378 **** statement.addSqlClause(" ") End If ! statement.addSqlClause(entry.AttributeMap.ColumnMap.getAliasQualifiedName("t1")) If entry.Ascend Then statement.addSqlClause(" " & Me.ClassMap.RelationalDatabase.getClauseStringAscend) --- 394,399 ---- statement.addSqlClause(" ") End If ! statement.addSqlClause(entry.AttributeMap.ColumnMap.getAliasQualifiedName(ht(entry.ClassMap.Name))) ! 'statement.addSqlClause(entry.AttributeMap.ColumnMap.getAliasQualifiedName("t1")) If entry.Ascend Then statement.addSqlClause(" " & Me.ClassMap.RelationalDatabase.getClauseStringAscend) |