Hi guys,
I've a question regarding fetching data I have this code:
using (var adapter = ...)
{
var fields = new ResultsetFields(2);
fields.DefineField(PropertyFields.Id, 0);
fields.DefineField(ObjectFields.Name, 1);
var bucket = new RelationPredicateBucket();
bucket.Relations.Add(PropertyEntity.Relations.ObjectEntityUsingObjectId, JoinHint.Left);
var datatable = new DataTable();
adapter.FetchTypedView(fields, datatable, bucket, true);
}
I have three entities
1. TypeEntity - base class
ID: int
Name: string
Other fields ...
-
ObjectEntity - inherits from TypeEntity
ID: int
Properties: Collection of PropertyEntity
Other fields ...
-
PropertyEntity
ID: int
Name: string
Object: ObjectEntity - (nullable field)
Other fields ...
As you can see, I'm trying to do a left join here, i.e. I'm selecting all properties and trying to get name of the object the property belongs to, if it is not null.
Llblgen generates this statement, which is not correct as for me:
SELECT [LPA_L3].[ID] AS [Id], [LPA_L1].[Name]
FROM (( [net].[Object] [LPA_L2]
RIGHT JOIN [net].[Property] [LPA_L3] ON [LPA_L2].[ID]=[LPA_L3].[ObjectID])
LEFT JOIN [net].[Type] [LPA_L1] ON [LPA_L1].[ID]=[LPA_L2].[ID])
WHERE ( ( ( [LPA_L2].[ID] IS NOT NULL)))
Am I doing anything wrong here?
I'm using llblgen 3.1.11.208 (file version of SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll)
Inheritance is Target-per-Entity.