You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using JetDriver 2.0.0.1001 for MsAccess on Net 4.5 and with NHibernate 3.3.3.4001
I need some help to clarify why the following SQL text is post-processed incorrectly by JetDriver's ConnectionProvider.Driver.GenerateCommand(). I think it is related to the formula property I have, without it all is ok.
<propertyname="CutCount"type="System.Int32"formula="(SELECT COUNT(CuttingPart.ID) FROM CuttingPart WHERE CuttingPart.PartID = ID)"/>
NHibernate generated SQL passed to AbstractBatcher.Generate method (correct)
SELECTthis_.IDas ID42_4_,
this_.Titleas Title42_4_,
this_.Lengthas Length42_4_,
(SELECTCOUNT(CuttingPart.ID) FROM CuttingPart WHERECuttingPart.PartID=this_.ID) as formula1_4_,
o2_.IDas ID40_0_,
o2_.Titleas Title40_0_,
m1_.IDas ID16_1_,
m1_.Titleas Title16_1_,
pc3_.PartIDas PartID6_,
pc3_.IDas ID6_,
pcv4_.ContourIDas ContourID7_,
pcv4_.IDas ID7_,
pcv4_.IDas ID50_3_,
pcv4_.[Type] as column2_50_3_,
pcv4_.XMas XM50_3_,
pcv4_.YMas YM50_3_,
pcv4_.Radiusas Radius50_3_,
FROM Part this_
left outer join AppOrder o2_ onthis_.AppOrderID=o2_.IDleft outer join Material m1_ onthis_.MaterialID=m1_.IDleft outer join Contour pc3_ onthis_.ID=pc3_.PartIDleft outer join ContourValue pcv4_ onpc3_.ID=pcv4_.ContourIDWHEREthis_.IsArchived=0ORDER BYpcv4_.PointIndexasc
Jet Driver result after its _factory.ConnectionProvider.Driver.GenerateCommand
SELECTthis_.IDas ID42_4_,
this_.Titleas Title42_4_,
this_.Lengthas Length42_4_,
(SELECTCOUNT(CuttingPart.ID) from CuttingPart WHERECuttingPart.PartID=this_.ID) as formula1_4_,
o2_.IDas ID40_0_,
o2_.Titleas Title40_0_,
m1_.IDas ID16_1_,
m1_.Titleas Title16_1_,
pc3_.PartIDas PartID6_,
pc3_.IDas ID6_,
pcv4_.ContourIDas ContourID7_,
pcv4_.IDas ID7_,
pcv4_.IDas ID50_3_,
pcv4_.[Type] as column2_50_3_,
pcv4_.XMas XM50_3_,
pcv4_.YMas YM50_3_,
pcv4_.Radiusas Radius50_3_,
-- from here I have incorrect SQL text
(select*from
((( pcv4_.ContourIDas ContourID50_3_ FROM Part this_
left outer join AppOrder o2_ onthis_.AppOrderID=o2_.ID)
left outer join Material m1_ onthis_.MaterialID=m1_.ID)
left outer join Contour pc3_ onthis_.ID=pc3_.PartID)
left outer join ContourValue pcv4_ onpc3_.ID=pcv4_.ContourIDWHEREthis_.IsArchived=0) as jetJoinAlias29
ORDER BYpcv4_.PointIndexasc
Is it a known problem ? Could you please give me a hint about a possible workaround if any? Thanks a lot.
The text was updated successfully, but these errors were encountered:
I looked at the sources. I suppose FinalizeJoins() works incorrectly if there are nested SELECT FROM in the query (as the formula does) because FinalizeJoins() doesn't properly determine From-Where clauses indices in the sql string with IndexOfCaseInsensitive() in this case.
A simple fix is to use LastIndexOfCaseInsensitive in this case to skip the nested queries. It resolves my issue but I am not sure if it is correct in all possible cases.
Your issue wording is a mix of bug report and support request. Better write it only as a bug report, if you intend it to be a bug report. For support request, better go on nh user group or Stack Overflow.
Hello all,
I am using JetDriver 2.0.0.1001 for MsAccess on Net 4.5 and with NHibernate 3.3.3.4001
I need some help to clarify why the following SQL text is post-processed incorrectly by JetDriver's
ConnectionProvider.Driver.GenerateCommand()
. I think it is related to the formula property I have, without it all is ok.NHibernate generated SQL passed to
AbstractBatcher.Generate
method (correct)Jet Driver result after its
_factory.ConnectionProvider.Driver.GenerateCommand
Is it a known problem ? Could you please give me a hint about a possible workaround if any? Thanks a lot.
The text was updated successfully, but these errors were encountered: