Duplicate
Details
Details
Assignee
Unassigned
UnassignedReporter
DarioD
DarioDComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created August 10, 2007 at 7:38 AM
Updated August 21, 2008 at 1:46 PM
Resolved September 21, 2007 at 2:57 PM
To reproduce the issue run the attached application. The query it's here:
string hql = "select f1, f2.Artlta from FArt f1, FLta f2 where f1.Codart = f2.Artlta";
IQuery q = s.CreateQuery(hql);
q.List();
The line fix for this could be this in the method TransformFromClause:
"return "from " + transformed;"
Here it's the resultant code:
private string TransformFromClause(string fromClause)
{
string transformed;
//"from ".Length
const int fromLength = 5;
fromClause = fromClause.Substring(fromLength, fromClause.Length - fromLength);
string[] blocks = fromClause.Split(',');
if (blocks.Length > 1)
{
for (int i = 0; i < blocks.Length; i++)
{
string tr = TransformJoinBlock(blocks[i]);
if (tr.IndexOf(" join ") > -1)
{
blocks[i] = "(select * from " + tr + ") as jetJoinAlias" + i.ToString();
}
else
{
blocks[i] = tr;
}
}
transformed = string.Join(",", blocks);
}
else
{
transformed = "from " + TransformJoinBlock(blocks[0]);
}
return "from " + transformed;
}