From: Richard B. <rb...@us...> - 2004-12-15 23:46:25
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5669 Modified Files: AToMSFramework.vbproj CClassMap.vb CJoin.vb CPersistenceBroker.vb readme.html Added Files: XMLMapping.xsd XMLMapping.xsx Log Message: Fixed bug in SQL generation for joins to objects that have subclasses using shared table fields. Added XSD for XML mapping files. Index: AToMSFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/AToMSFramework.vbproj,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- AToMSFramework.vbproj 18 Oct 2004 01:36:43 -0000 1.19 +++ AToMSFramework.vbproj 15 Dec 2004 23:46:04 -0000 1.20 @@ -80,7 +80,7 @@ <Reference Name = "ByteFX.MySqlClient" AssemblyName = "ByteFX.MySqlClient" - HintPath = "bin\ByteFX.MySqlClient.dll" + HintPath = "..\ByteFX.MySqlClient.76.NI\ByteFX.MySqlClient.dll" /> </References> <Imports> @@ -388,6 +388,15 @@ SubType = "Code" BuildAction = "Compile" /> + <File + RelPath = "XMLMapping.xsd" + BuildAction = "Content" + /> + <File + RelPath = "XMLMapping.xsx" + DependentUpon = "XMLMapping.xsd" + BuildAction = "None" + /> </Include> </Files> </VisualBasic> Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- CPersistenceBroker.vb 6 Dec 2004 00:57:05 -0000 1.81 +++ CPersistenceBroker.vb 15 Dec 2004 23:46:11 -0000 1.82 @@ -444,7 +444,7 @@ classMapCount += Me.getChildCountForMultipleInheritance(udamap.ForClass) classMapCount -= 1 'This is because we added one in the beginning of the for loop - If Not targetobj Is Nothing And targetobj.Persistent Then + If Not targetobj Is Nothing AndAlso targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj @@ -511,7 +511,7 @@ 'update classMapCount with the child count number classMapCount += Me.getChildCountForMultipleInheritance(udamap.ForClass) classMapCount -= 1 'This is because we added one in the beginning of the for loop - If Not targetobj Is Nothing And targetobj.Persistent Then + If Not targetobj Is Nothing AndAlso targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj @@ -2113,11 +2113,13 @@ Dim mapName As String For Each de In classMap.ChildrenMaps() cm = de.Value - classMapCount += 1 - mapName = "t" & classMapCount.ToString - rMaps.Add(mapName, cm) - joins = New CJoin(joins, cm, mapName, False) - Me.createJoinForMultipleInheritance(cm, classMapCount, joins, rMaps) + If cm.getReferenceSize > 0 Then + classMapCount += 1 + mapName = "t" & classMapCount.ToString + rMaps.Add(mapName, cm) + joins = New CJoin(joins, cm, mapName, False) + Me.createJoinForMultipleInheritance(cm, classMapCount, joins, rMaps) + End If Next End Sub @@ -2147,11 +2149,13 @@ For Each de In classMap.ChildrenMaps cm = de.Value - 'recursive call to retrieve base objects - obj = Me.createTargetObjectForMultipleInheritance(cm, objectType, classNameSpace, dataRow, joins, conn) - If Not obj Is Nothing And obj.Persistent Then - 'Found the obj - Return obj + If cm.getReferenceSize > 0 Then + 'recursive call to retrieve base objects + obj = Me.createTargetObjectForMultipleInheritance(cm, objectType, classNameSpace, dataRow, joins, conn) + If Not obj Is Nothing And obj.Persistent Then + 'Found the obj + Return obj + End If End If Next --- NEW FILE: XMLMapping.xsd --- <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="XMLMapping" targetNamespace="http://tempuri.org/XMLMapping.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLMapping.xsd" xmlns:mstns="http://tempuri.org/XMLMapping.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="map"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="database" minOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" form="unqualified" type="paramNames" use="required" /> <xs:attribute name="value" form="unqualified" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="class" form="unqualified" type="DBClassType" use="required" /> </xs:complexType> </xs:element> <xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="attribute" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="column" form="unqualified" type="xs:string" /> <xs:attribute name="find" form="unqualified" type="TrueFalse" /> <xs:attribute name="key" form="unqualified" type="keyType" /> <xs:attribute name="proxy" form="unqualified" type="TrueFalse" /> <xs:attribute name="timestamp" form="unqualified" type="TrueFalse" /> <xs:attribute name="reference" form="unqualified" type="xs:string" /> <xs:attribute name="identity" type="TrueFalse" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="table" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="database" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="namespace" form="unqualified" type="xs:string" /> <xs:attribute name="superclass" form="unqualified" type="xs:string" /> <xs:attribute name="readonly" type="TrueFalse" /> <xs:attribute name="modifyonly" type="TrueFalse" /> <xs:attribute name="owner" type="xs:string" /> <xs:attribute name="sharedtablefield" type="xs:string" /> <xs:attribute name="sharedtablevalue" type="xs:string" /> <xs:attribute name="assemblypath" type="xs:string" /> <xs:attribute name="superclassnamespace" type="xs:string" /> <xs:attribute name="factory" type="xs:string" /> </xs:complexType> </xs:element> <xs:element name="association"> <xs:complexType> <xs:sequence> <xs:element name="entry" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="fromAttribute" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="toAttribute" form="unqualified" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="fromClass" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="toClass" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="cardinality" form="unqualified" type="cardinality" use="required" /> <xs:attribute name="target" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="retrieveAutomatic" form="unqualified" type="TrueFalse" use="required" /> <xs:attribute name="deleteAutomatic" form="unqualified" type="TrueFalse" use="required" /> <xs:attribute name="saveAutomatic" form="unqualified" type="TrueFalse" use="required" /> <xs:attribute name="inverse" form="unqualified" type="TrueFalse" /> <xs:attribute name="fromClassNameSpace" type="xs:string" /> <xs:attribute name="toClassNameSpace" type="xs:string" /> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> <xs:simpleType name="TrueFalse"> <xs:restriction base="xs:string"> <xs:enumeration value="true" /> <xs:enumeration value="false" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="cardinality"> <xs:restriction base="xs:string"> <xs:enumeration value="OneToOne" /> <xs:enumeration value="OneToMany" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="keyType"> <xs:restriction base="xs:string"> <xs:enumeration value="primary" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="DBClassType"> <xs:restriction base="xs:string"> <xs:enumeration value="CMsSqlDatabase" /> <xs:enumeration value="CMsAccessDatabase" /> <xs:enumeration value="CMySqlDatabase" /> <xs:enumeration value="CODBCDatabase" /> <xs:enumeration value="CMaxDBDatabase" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="paramNames"> <xs:restriction base="xs:string"> <xs:enumeration value="name" /> <xs:enumeration value="serverName" /> <xs:enumeration value="user" /> <xs:enumeration value="password" /> <xs:enumeration value="ansinulls" /> <xs:enumeration value="OIDTable" /> <xs:enumeration value="portNumber" /> <xs:enumeration value="option" /> </xs:restriction> </xs:simpleType> </xs:schema> Index: CJoin.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CJoin.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CJoin.vb 25 Oct 2004 07:12:31 -0000 1.9 +++ CJoin.vb 15 Dec 2004 23:46:11 -0000 1.10 @@ -274,6 +274,7 @@ Dim db As _CRelationalDatabase Dim leftBracket As String = "(" Dim rightBracket As String = ")" + Dim isFirst As Boolean = True If LeftSide Is Nothing Then tm = CType(RightSide.Tables.Item(1), CTableMap) @@ -310,8 +311,10 @@ tm = CType(RightSide.Tables.Item(1), CTableMap) s = leftBracket & LeftSide.GetSQLString & " " & db.getClauseStringLeftJoin & " " & db.getClauseStringTableAlias(tm.Name, tm.TableOwner, TableAlias) & " " & db.getClauseStringOn & " " For i = 1 To cm.getReferenceSize - If i > 1 Then + If Not isFirst Then s = s & " " & db.getClauseStringAnd & " " + Else + isFirst = False End If s = s & cm.getReferenceAttributeMap(i).ColumnMap.getAliasQualifiedName(TableAlias) _ & " = " & cm.getReferenceAttributeMap(i).AttributeMap.ColumnMap.getAliasQualifiedName(Me.GetTableAlias(cm.SuperClass)) Index: readme.html =================================================================== RCS file: /cvsroot/jcframework/dotnet/readme.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- readme.html 6 Dec 2004 00:57:06 -0000 1.3 +++ readme.html 15 Dec 2004 23:46:12 -0000 1.4 @@ -117,7 +117,7 @@ <!-- BEGIN faq_block --> <table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0" align="center"> <tr> - <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.0 Release Candidate 2<br />Released: 10-Nov-2004</span></td> + <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.1<br />Released: xx-xxx-200x</span></td> </tr> <tr> <td align="center"> @@ -147,10 +147,43 @@ </span></td></tr> </table> </div> + <tr> + <td class="groupHeader" align="left" valign="top"> + <div onclick="return CFAQ.display('faq_a_notesv2.1', false);" style="width:100%;cursor:pointer;cursor:hand;"> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.1', true);" onfocus="this.blur();"><b>Changes in v2.1 (xx-xxx-xx)</b></a></span> + </div> + <div id="faq_a_notesv2.1" style="display:none;"> + <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> + <tr class="tableCaption"><td colspan=3>Bugs:</td></tr> + <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> + <td class="colHeader">Description</td> + <td class="colHeader">Details</td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Incorrect SQL Generation</td> + <td>SQL generated for associations to classes with children using shared tables was broken. For now the child objects are not retrieved.<td> + </tr> + <tr class="tableCaption" valign="bottom"> + <td colspan=3><br/>Modifications</td> + </tr> + <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> + <td class="colHeader">Description</td> + <td class="colHeader">Details</td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">XML Schema</td> + <td>Finally got around to creating an XML schema for the XML mapping files.<td> + </tr> + </table> + </div> + </td> + </tr> <tr> <td class="groupHeader" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_notesv2.0', false);" style="width:100%;cursor:pointer;cursor:hand;"> - <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.0', true);" onfocus="this.blur();"><b>Changes in v2.0 Final (xx-xx-04)</b></a></span> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.0', true);" onfocus="this.blur();"><b>Changes in v2.0 (07-Dec-04)</b></a></span> </div> <div id="faq_a_notesv2.0" style="display:none;"> <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> @@ -183,7 +216,7 @@ </tr> <tr valign="top"> <td>N/A</td> - <td class="col1">Performance </td> + <td class="col1">Performance Monitoring</td> <td>Code has been added to allow various performance values to be measured in PerfMon. This includes cache hits, sql hits, retrieves, saves, deletes per second, etc. If you want more, just place a request on the web site.<td> </tr> <tr valign="top"> --- NEW FILE: XMLMapping.xsx --- <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> <XSDDesignerLayout layoutVersion="2" viewPortLeft="-605" viewPortTop="4209" zoom="100"> <map_XmlElement left="6112" top="979" width="7567" height="2963" selected="0" zOrder="11" index="0" expanded="1"> <database_XmlElement left="398" top="4450" width="5292" height="2963" selected="0" zOrder="12" index="0" expanded="1"> <parameter_XmlElement left="398" top="7921" width="5292" height="2964" selected="0" zOrder="14" index="0" expanded="1" /> </database_XmlElement> <class_XmlElement left="6324" top="4450" width="7143" height="7196" selected="0" zOrder="16" index="1" expanded="1"> <attribute_XmlElement left="7250" top="12154" width="5291" height="4656" selected="0" zOrder="18" index="0" expanded="1" /> </class_XmlElement> <association_XmlElement left="14101" top="4450" width="5292" height="5926" selected="0" zOrder="20" index="2" expanded="1"> <entry_XmlElement left="14101" top="10884" width="5292" height="2963" selected="0" zOrder="22" index="0" expanded="1" /> </association_XmlElement> </map_XmlElement> <TrueFalse_XmlSimpleType left="15099" top="1079" width="5292" height="2540" selected="0" zOrder="24" index="1" expanded="1" /> <cardinality_XmlSimpleType left="19818" top="3758" width="5291" height="2963" selected="0" zOrder="25" index="2" expanded="1" /> <keyType_XmlSimpleType left="19844" top="6985" width="5291" height="2963" selected="0" zOrder="26" index="3" expanded="1" /> <DBClassType_XmlSimpleType left="479" top="11335" width="5292" height="2963" selected="0" zOrder="27" index="4" expanded="1" /> <paramNames_XmlSimpleType left="691" top="14583" width="5292" height="2963" selected="0" zOrder="29" index="5" expanded="1" /> </XSDDesignerLayout> Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- CClassMap.vb 16 Nov 2004 21:39:34 -0000 1.45 +++ CClassMap.vb 15 Dec 2004 23:46:05 -0000 1.46 @@ -2016,10 +2016,9 @@ statement.addSqlClause(m_joinSet.GetSQLString) statement.addSqlClause(" " & Me.RelationalDatabase.getClauseStringWhere & " ") - classMapCount = 1 Do + classMapCount = 1 mapName = "t" & classMapCount.ToString - classMapCount += 1 cm2 = rMaps(mapName) isfirst = True If Not cm2.SharedTableField Is Nothing Then |