title: JPA, Oracle, connect by prior, level - invalid identifier
body: <p>I have query like this one:</p>
  
  <pre><code>final String q =
      "SELECT level AS \"sibling_level\", tree.* FROM category_view tree " +
      "where tree.child_market = :market " +
      "connect by prior tree.cate_xre_id = tree.cate_id " +
      "start with tree.cate_id = -1 or tree.cate_id = -18";
  
      final Query query = cqb.createNativeQuery(q, params, 
                                           NSISegmentationTreeViewImpl.class);
  
      List&lt;NSISegmentationTreeViewImpl&gt; segList = query.getResultList();
  </code></pre>
  
  <p>category_view is an database view.</p>
  
  <p>I got sometimes:</p>
  
  <blockquote>
    <p>SQLGrammarException: ORA-00904: "NSISEGMENT0_"."SIBLING_LEVEL": invalid identifier</p>
  </blockquote>
  
  <p>its not deterministic sometimes i have good result sometimes i have error.</p>
  
  <p>Database ver is 11</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks.</p>
  
  <p>View def:</p>
  
  <pre><code>CREATE OR REPLACE FORCE "CATEGORY_VIEW" ("PARENT_ID", "PARENT_NAME", "CHILD_ID", "CHILD_NAME", "CHILD_TYPE", "CHILD_PRIORITY", "CHILD_MARKET", "CATE_XRE_ID", "CATE_ID") AS 
    WITH sibling AS
    (SELECT
      pare.category_id parent_id,
      pare.name parent_name,
      chld.category_id child_id,
      chld.name child_name,
      csga.value child_type,
      cpra.value child_priority,
      cmra.value child_market ,
      paxr.sub_category_id cate_xre_id,
      pare.category_id cate_id,
    )
  SELECT
    parent_id,
    parent_name ,
    child_id,
    child_name,
    child_type,
    child_priority,
    child_market,
    cate_xre_id,
    cate_id,
  FROM sibling
  ORDER BY sibling.child_name;
  </code></pre>
  
  <p>I removed unnecessary fields, structure is the same.</p>