Oracle Tree loading Feature

2 posts, 0 answers
  1. Ibrahim Imam
    Ibrahim Imam avatar
    69 posts
    Member since:
    Jul 2007

    Posted 28 Apr 2011 Link to this post

    Hello,

    there is a way to support statements like the appended sample including "start with", "connect by prior" functionality using OpenAccess?

    SELECT 

     

     

    FOLDER_ID

    FROM WN_FOLDER 

     

    WHERE ORG_ID = pOrgId

    START WITH FOLDER_ID = pObjectId

    CONNECT BY FOLDER_ID = PRIOR PARENT_ID AND ORG_ID = pOrgId

     

    AND PARENTORG_ID = pOrgId

    BR

     

     

  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 03 May 2011 Link to this post

    Hello Ibrahim Imam,

    In the latest version of the product we have introduced a new extension method which you can use to write manually backend specific SQL. Such query would look like this:
    var result = context.WnFolders.Where(x => "WHERE ORG_ID = pOrgId START WITH FORDER_ID = pObjectId CONNECT BY FOLDER_ID = PRIOR PARENT_ID AND ORG_ID = pOrgId AND PARENTORG_ID = pOrgId".SQL<bool>()).Select(y => y.FolderId).ToList();

    If you need to pass parameters, for example if pOrgId is a variable, you can substitute pOrgId with {0} in the string and call SQL<bool>(pOrgId).
    Note that you need to include the Telerik.OpenAccess namespace in order to see the SQL<T> extension method.
    I hope that helps.

    All the best,
    Alexander
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  3. DevCraft banner
Back to Top