|
From: <sv...@de...> - 2005-06-07 16:49:52
|
Author: pcamacho
Date: 2005-06-07 12:49:51 -0400 (Tue, 07 Jun 2005)
New Revision: 1248
Modified:
humano2/trunk/components/webTools/Adapter.cs
humano2/trunk/core/db/mssql/mssqlComplex.cs
humano2/trunk/core/db/pgsql/pgsqlComplex.cs
Log:
FIX: bug #189. When updating the view by default of a class, if an attrib=
ute was a pertinence, the first attribute=20
(select) of this pertinence was taken and not the isPrimary one as it sho=
uld be.
Modified: humano2/trunk/components/webTools/Adapter.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/Adapter.cs 2005-06-06 22:33:49 UTC =
(rev 1247)
+++ humano2/trunk/components/webTools/Adapter.cs 2005-06-07 16:49:51 UTC =
(rev 1248)
@@ -1434,6 +1434,12 @@
Logger.Log("CreateViewStandard: classId: "+classId+" domainId: "+d=
omainId, LogLevel.Trace);
string[] attributeIds =3D complex.GetUserSetableAttributeList(classId=
, domainId).AllKeys;
=20
+ Logger.Log("attributesIds: ",LogLevel.Trace);
+ for(int i=3D0;i<attributeIds.Length;i++)
+ {
+ Logger.Log("attributeIds[" + i + "]: " + attributeIds[i]=
,LogLevel.Trace); =20
+ }
+ =20
string listOfAttributeIds =3D Support.Commify(attributeIds);
=20
Logger.Log("CreateViewStandard: listOfAttributeIds=3D " + li=
stOfAttributeIds, LogLevel.Trace);
@@ -1521,10 +1527,14 @@
col2 =3D view.Rows[0][1].ToString();
}
=09
+ Logger.Log("col1: " + col1,LogLevel.Trace);
+ Logger.Log("col2: " + col1,LogLevel.Trace);
+ =20
string columns;
if(mode =3D=3D 0)
{
string attCol =3D CheckForPertinence(idEntity.ToString());
+ Logger.Log("Pertinence att: " + attCol, LogLevel.Trace);
columns =3D col2 + "," + attCol;
}
else
@@ -1546,6 +1556,7 @@
for(int t=3D0; t < colValues.Length; t++)
{
dr[t] =3D colValues[t];
+ Logger.Log("value[" + t + "]=3D " + Convert.ToString(col=
Values[t]),LogLevel.Trace);
}
dt.Rows.Add(dr);
=20
Modified: humano2/trunk/core/db/mssql/mssqlComplex.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/db/mssql/mssqlComplex.cs 2005-06-06 22:33:49 UTC (=
rev 1247)
+++ humano2/trunk/core/db/mssql/mssqlComplex.cs 2005-06-07 16:49:51 UTC (=
rev 1248)
@@ -876,13 +876,14 @@
}
=20
/// <summary>
- /// Get the string id of the pertinence attribute an attribute is relat=
ed to
+ /// Get the string id of the pertinence attribute an attribute is rela=
ted to
/// </summary>
/// <param name=3D"attributeId">The attribute for which we want =
the pertinence attribute related to</param>
- /// <returns>The attribute of the pertinence attribute or "" if =
attributeId is not a pertinence attribute</returns>
+ /// <returns>The PRIMARY attribute of the pertinence attribute o=
r "" if attributeId is not a pertinence attribute</returns>
override public string GetPertinenceForAttribute(string attribut=
eId)
{
- string req =3D "select \"id_entity\" from attribute where \"=
classId\" in (select \"to\" from pertinence where id_entity =3D " + Conve=
rt.ToInt32(attributeId) + ")";
+ string req =3D "select \"id_entity\" from attribute where \"=
classId\" in (select \"to\" from pertinence where id_entity =3D " + Conve=
rt.ToInt32(attributeId) + ") ";
+ req +=3D"and \"isPrimary\"=3D't'"; //Only takes the p=
rimary attribute of the pertinence
=20
DataTable dt =3D doSelect(req);
if( (dt =3D=3D null) || (dt.Rows.Count =3D=3D 0))
Modified: humano2/trunk/core/db/pgsql/pgsqlComplex.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/db/pgsql/pgsqlComplex.cs 2005-06-06 22:33:49 UTC (=
rev 1247)
+++ humano2/trunk/core/db/pgsql/pgsqlComplex.cs 2005-06-07 16:49:51 UTC (=
rev 1248)
@@ -916,11 +916,13 @@
/// Get the string id of the pertinence attribute an attribute is rela=
ted to
/// </summary>
/// <param name=3D"attributeId">The attribute for which we want =
the pertinence attribute related to</param>
- /// <returns>The attribute of the pertinence attribute or "" if =
attributeId is not a pertinence attribute</returns>
+ /// <returns>The PRIMARY attribute of the pertinence attribute o=
r "" if attributeId is not a pertinence attribute</returns>
override public string GetPertinenceForAttribute(string attribut=
eId)
{
- string req =3D "select \"id_entity\" from attribute where \"=
classId\" in (select \"to\" from pertinence where id_entity =3D " + Conve=
rt.ToInt32(attributeId) + ")";
- =20
+ string req =3D "select \"id_entity\" from attribute where \"=
classId\" in (select \"to\" from pertinence where id_entity =3D " + Conve=
rt.ToInt32(attributeId) + ") ";
+ req +=3D"and \"isPrimary\"=3D't'"; //Only takes the p=
rimary attribute of the pertinence
+ Logger.Log("GetPertinenceForAttribute: query=3D " + req,LogL=
evel.Trace); =20
+ =20
DataTable dt =3D doSelect(req);
if( (dt =3D=3D null) || (dt.Rows.Count =3D=3D 0))
{
|