Hello,
I have a problem while using Negative predicates.
Two Tables (TblModule, TblModulPortMedikamente) have a 1:m relation. The relation is between the Fields TblModulPortMedikamenteFields.ModulIdDemand and TblModuleFields.ModulId.
I try to create a query which is the same to the sql statement:
SELECT * FROM tblModule WHERE (NOT EXISTS
(SELECT * FROM tblmodulportmedikamente
WHERE tblModule.modulid = tblmodulportmedikamente.modulID_demand))
Here my try with LLBLGEN PRO:
public IList<ModulExchange> GetModuls()
{
EntityCollection<TblModuleEntity> moduls =
new EntityCollection<TblModuleEntity>(new TblModuleEntityFactory());
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(TblModuleEntity.Relations.TblModulPortMedikamenteEntityUsingModulIdDemand);
bucket.PredicateExpression.Add( TblModulPortMedikamenteFields.ModulIdDemand != TblModuleFields.ModulId);
ISortExpression sortExpression = new SortExpression(TblModuleFields.ModulId | SortOperator.Ascending);
m_adapter.FetchEntityCollection(moduls, bucket, 0, sortExpression);
return Converter.ConvertToIList(moduls);
}
What is my fault?