Closed Erikvl87 closed 10 years ago
@Erikvl87 Can you add the generated SQL to this issue?
I think I found the source of the issue: https://github.com/devatwork/Premotion-Mansion/blob/master/src/Premotion.Mansion.Repository.SqlServer/Queries/SqlStringBuilder.cs#L137-L139
Lets discus the right approach to fix this first.
Hi @devatwork, that's exactly were I ended my debug session yesterday. The solution was unclear though, as it seem to miss the right specification. I will contact you by mail.
@devatwork Here is the generated SQL you requested.
The abstract query that is generated:
{where:allowed-role-ids:any_where:child-of=1&1_cache-enabled:True_where:(type == ContentIndexRoottype == Site or )_sort:order asc}
That will generate the following MSSQL query:
SELECT [Nodes].* FROM [Nodes] WHERE ([Nodes].[parentId] = @0) AND (( [Nodes].[type] = @1) AND ( [Nodes].[type] = @2)) ORDER BY [Nodes].[order] ASC;
SELECT COUNT(1) AS [TotalCount] FROM [Nodes] WHERE ([Nodes].[parentId] = @0) AND (( [Nodes].[type] = @1) AND ( [Nodes].[type] = @2));
Parameters:
@0 1
@1 "ContentIndexRoot"
@2 "Site"
The OrSpecification is not working properly.
The following will not return any results:
While the following two specifications will work separately: {OrSpecification( IsSpecification( 'type', 'ContentIndexRoot' ) )} {OrSpecification( IsSpecification( 'type', 'Site' ) )}
For the above example an alternative would be the following: {InSpecification( 'type', 'ContentIndexRoot,Site' )}
But in my case I need to select the nodes where 'property A = value' or 'property B = value'.