In model i have IEntityBase with

Guid Id { get; }

All my entities is implements IEntityBase. In Query

Query.All<IEntityBase>().Where(a => a.Id == id)

I got non optimal sql like this:

SELECT  [a].[Id] ,
FROM    ( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((SELECT
                                                              [b].[Id] ,
                                                              ( SELECT
                                                              [c].[Id] ,
                                                              189 AS [TypeId]
                                                              [dbo].[Entity1] [c]
                                                              ) [b])
          ( SELECT  [d].[Id] ,
            FROM    ( SELECT    [e].[Id] ,
                                190 AS [TypeId]
                      FROM      [dbo].[Entity2] [e]
                    ) [d]
          ( SELECT  [t10].[Id] ,
            FROM    ( SELECT    [u10].[Id] ,
                                204 AS [TypeId]
                      FROM      [dbo].[EntityN] [u10]
                    ) [t10]
        ) [a]
WHERE   ( [a].[Id] = @p0_0 ) ;

In some domains it not work (SQL error details 'Type: SyntaxError;' Query 'SELECT [a].[Id], [a].[TypeId] FROM Original message 'Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.')

Reproduced on: DataObjects.Net, 4.6.0 Beta 3, Net40-Release, 9eae80f005b3:2012-09-14 DataObjects.Net, 4.5.4, Net40-Release, 52fbc8e33e5d:2012-08-11

asked Sep 17 '12 at 03:05

pil0t's gravatar image


One Answer:

Fixed and will be included in 4.5.5 release

answered Sep 17 '12 at 06:50

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov

edited Sep 17 '12 at 06:50

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA