From: Richard B. <rb...@us...> - 2004-11-01 04:08:33
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28472 Modified Files: CClassMap.vb modAliasNull.vb Log Message: DBNull was not being detected as a null alias UseANSINulls flag was being compared to false instead of true Index: modAliasNull.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modAliasNull.vb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- modAliasNull.vb 21 Jul 2004 02:55:38 -0000 1.4 +++ modAliasNull.vb 1 Nov 2004 04:08:23 -0000 1.5 @@ -79,11 +79,17 @@ Case VariantType.Byte If InValue = NULL_BYTE Then blnValue = True Case Else - If InValue Is Nothing Then blnValue = True + If InValue Is Nothing Then + blnValue = True + Else + If IsDBNull(InValue) Then + blnValue = True + End If + End If ' bytes and boleans 'Debug.Assert False End Select - IsNullAlias = blnValue + Return blnValue End Function Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- CClassMap.vb 1 Nov 2004 00:10:50 -0000 1.39 +++ CClassMap.vb 1 Nov 2004 04:08:23 -0000 1.40 @@ -794,7 +794,7 @@ For i = 1 To Me.getKeySize p = m_deleteStatement.Parameters.Item(i) If IsNullAlias(p.Value) Then - If Me.RelationalDatabase.UseANSINulls = False Then + If Me.RelationalDatabase.UseANSINulls = True Then x = x.Replace(" = _" & i.ToString & "_", " is NULL") p.Ignore = True Else @@ -1338,7 +1338,7 @@ For i = m_updateWhereParamPosition To m_updateStatement.Parameters.Count p = m_updateStatement.Parameters.Item(i) If IsNullAlias(p.Value) Then - If Me.RelationalDatabase.UseANSINulls = False Then + If Me.RelationalDatabase.UseANSINulls = True Then x = x.Replace(" = _" & i.ToString & "_", " is NULL") p.Ignore = True Else @@ -1803,8 +1803,6 @@ Dim de As DictionaryEntry Dim isfirst As Boolean = True Dim am As CAttributeMap - Dim baseTables As Integer - Dim currentIndex As Integer rMaps.Add("t1", Me) m_joinSet = New CJoin(Me, "t1") @@ -1822,7 +1820,6 @@ cm3 = cm2 cm2 = cm2.SuperClass End While - baseTables = classMapCount For Each de In Me.AssociationMaps udamap = de.Value If udamap.RetrieveAutomatic Then @@ -1839,18 +1836,15 @@ statement.addSqlClause(Me.RelationalDatabase.getClauseStringSelect & " ") For Each de In rMaps cm2 = de.Value - currentIndex = CInt(Mid(de.Key, 2)) 'Load each individual column, and process in order of objects being joined For i = 1 To cm2.getSize - If currentIndex < baseTables OrElse cm2.getAttributeMap(i).IsProxy Then - If isfirst Then - isfirst = False - Else - statement.addSqlClause(", ") - End If - statement.addSqlClause(cm2.getAttributeMap(i).ColumnMap.getAliasQualifiedName(de.Key) & _ - Me.RelationalDatabase.getClauseStringAs & cm2.getAttributeMap(i).ColumnMap.getAliasName(de.Key)) + If isfirst Then + isfirst = False + Else + statement.addSqlClause(", ") End If + statement.addSqlClause(cm2.getAttributeMap(i).ColumnMap.getAliasQualifiedName(de.Key) & _ + Me.RelationalDatabase.getClauseStringAs & cm2.getAttributeMap(i).ColumnMap.getAliasName(de.Key)) Next i Next statement.addSqlClause(" " & Me.RelationalDatabase.getClauseStringFrom & " ") @@ -1909,7 +1903,7 @@ For i = 1 To params.Count o = params.Item(i) If IsNullAlias(o.value) Then - If Me.RelationalDatabase.UseANSINulls = False Then + If Me.RelationalDatabase.UseANSINulls = True Then x = x.Replace(" = _" & i.ToString & "_", " is NULL") o.Ignore = True Else @@ -1930,8 +1924,6 @@ Dim de As DictionaryEntry Dim isfirst As Boolean = True Dim am As CAttributeMap - Dim baseTables As Integer - Dim currentIndex As Integer rMaps.Add("t1", Me) 'Joins are not depending on method used for retrieve (ie find or retrieve) so don't @@ -1951,7 +1943,6 @@ cm3 = cm2 cm2 = cm2.SuperClass End While - baseTables = classMapCount For Each de In Me.AssociationMaps udamap = de.Value If udamap.RetrieveAutomatic Then @@ -1968,18 +1959,15 @@ statement.addSqlClause(Me.RelationalDatabase.getClauseStringSelect & " ") For Each de In rMaps cm2 = de.Value - currentIndex = CInt(Mid(de.Key, 2)) 'Load each individual column, and process in order of objects being joined For i = 1 To cm2.getSize - If currentIndex < baseTables OrElse cm2.getAttributeMap(i).IsProxy Then - If isfirst Then - isfirst = False - Else - statement.addSqlClause(", ") - End If - statement.addSqlClause(cm2.getAttributeMap(i).ColumnMap.getAliasQualifiedName(de.Key) & _ - Me.RelationalDatabase.getClauseStringAs & cm2.getAttributeMap(i).ColumnMap.getAliasName(de.Key)) + If isfirst Then + isfirst = False + Else + statement.addSqlClause(", ") End If + statement.addSqlClause(cm2.getAttributeMap(i).ColumnMap.getAliasQualifiedName(de.Key) & _ + Me.RelationalDatabase.getClauseStringAs & cm2.getAttributeMap(i).ColumnMap.getAliasName(de.Key)) Next i Next statement.addSqlClause(" " & Me.RelationalDatabase.getClauseStringFrom & " ") |