Broken sql generator?

Thread is closed for posting
2 posts, 0 answers
  1. Jose Mejia
    Jose  Mejia avatar
    107 posts
    Member since:
    May 2009

    Posted 05 Sep 2014 Link to this post


    I'm using OA version 2014.2.617.2  and sqlite version

    I have following queries:
    private IQueryable<Entity> UserEntities
         get { return _model.Entities.Where(t => t.EntityNamespaces.Any(t1 => t1.User.UserID == _userId)); }
    internal static IQueryable<Entity> SearchEntitiesByTag(IEnumerable<int> tags)
         var query = from entity in UserEntities
                             from tag in entity.Tags
                             where tags.Contains(tag.TagId)
                             select entity;
         return query;

    which throws error:

    SELECT a.[EntityID] COL1, b.[EntityID] COL2, c.[EntityNamespaceID] COL3, c.[Description] COL4, c.[is_default] COL5, c.[is_monitoring] COL6, c.[EntityNamespaceID] COL7, c.[NameSpacename] COL8, c.[OwnerId] COL9, c.[OwnerId] COL10 FROM [Entities] a JOIN [Entities_EntityNamespaces] AS b ON (a.[EntityID] = b.[EntityID]) JOIN [EntityNamespaces] AS c ON (b.[EntityNamespaceID] = c.[EntityNamespaceID]) WHERE EXISTS (SELECT 1                  FROM [EntityNamespaces] d JOIN [Entities_EntityNamespaces] AS e ON (d.[EntityNamespaceID] = e.[EntityNamespaceID]) JOIN [Users] AS f ON (d.[OwnerId] = f.[UserID]) WHERE f.[UserID] = ?                                       AND e.[EntityID] = a.[EntityID]) AND (g.[TagId] IN (?)) ORDER BY a.[EntityID], b.[EntityID]  Telerik.OpenAccess.RT.sql.SQLException: SQL logic error or missing database
    no such column: g.TagId ---> System.Data.SQLite.SQLiteException: SQL logic error or missing database
    no such column: g.TagId

    Entities has many to many with EntityNamespace and Tags.
    The previous version of OA ( I guess it was 2013.*.*.*) was ok. It worked. While I got this bug in new OA version.
    I rewrite a query which is a little bit costly now...

    So what is the problem? Is OA problem or sqlite driver problem?

    Thanks in advance.

  2. Thomas
    Thomas avatar
    590 posts

    Posted 09 Sep 2014 Link to this post

    Hi Jose,

    I tried to reproduce this here with my latest version, but I could not. Most often this is due to the fact that I use a different model or mapping than the one that exhibits the issue. Also, the issue could have been solved already. Would you be able to pass the model to us so that we can have another look into this?

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top