Hi,
I am currently converting my project from LLBLGEN 1.1 to LLBLGEN 4.1
I am having problems with the filtering expression since PredicateFactory is no longer exist in 4.1
I would like to create a filter in one of the column from a view:
Dim udtSelectFilter As New PredicateExpression
in 1.1:
udtSelectFilter.Add (FactoryClasses.PredicateFactory.CompareValue(JobFieldIndex.Intranet, ComparisonOperator.Equal, True)
Public Enum JobFieldIndex
[CreatedDate]
[CreatorEmployeeId]
[Internet]
[Intranet]
[JobCompleted]
[JobName]
End Enum
in 4.1
we replaced the filter statement with:
udtSelectFilter.Add(JobFields.Intranet = True)
But this causes an error
[Document Management].[dbo].[tblJobs].Intranet do not exist
Public Class JobFields
''' <summary>Creates a new Job1TypedView.Intranet field instance</summary>
Public Shared ReadOnly Property [Intranet] As EntityField
Get
Return CType(EntityFieldFactory.Create(Job1FieldIndex.Intranet), EntityField)
End Get
End Property
''' <summary>Creates a new Job1TypedView.Internet field instance</summary>
Public Shared ReadOnly Property [Internet] As EntityField
Get
Return CType(EntityFieldFactory.Create(Job1FieldIndex.Internet), EntityField)
End Get
End Property
End Class
After running the SQL profiler to see what SQL LLBLGEN has created, we realised that the where clause of the SQL statement is incorrect in that the column name is fully qualified with the database name, table name and column name instead of just the column name
SELECT
[DocumentManagement].[dbo].[vwJobs].[ID] AS [Id],
[DocumentManagement].[dbo].[vwJobs].[JobName],
[DocumentManagement].[dbo].[vwJobs].[Intranet],
[DocumentManagement].[dbo].[vwJobs].[Internet],
FROM [DocumentManagement].[dbo].[vwJobs]
WHERE ([DocumentManagement].[dbo].[tblJobs].[Intranet] =1)
instead of the correct where
SELECT
[DocumentManagement].[dbo].[vwJobs].[ID] AS [Id],
[DocumentManagement].[dbo].[vwJobs].[JobName],
[DocumentManagement].[dbo].[vwJobs].[Intranet],
[DocumentManagement].[dbo].[vwJobs].[Internet],
FROM [DocumentManagement].[dbo].[vwJobs]
WHERE (Intranet =1)
Can you please help with the correct filter predicate statement to give us the right SQL to do the column search in the SQL view?
Thanks and Regards,
Kristina