0 Replies Latest reply on Jun 3, 2007 7:26 PM by fernando_jmt

    Latest CVS EntityQuery troubles/doubts

    fernando_jmt

      Hi.

      I've updated to latest SEAM CVS (20070602), the improvements are good. Nevertheless I have some questions/doubts:

      A) The method isNextExists() always returns false. I made some debug and I found that isNextExits() method is called before than getResultList() (I'm sure it is related with some JSF Phase behaviour), this means the value of "resultList" property will always be null. I resolved this making this change:

      @Override
       @Transactional
       public boolean isNextExists()
       {
       return getResultList()!=null &&
       resultList.size() > getMaxResults();
       }
      

      I'm sure you guys have a better solution...


      B) Is it possible to have a EntityQuery in the SESSION scope?
      I tried to do it. But it does not work (EntityManager is closed exception is thrown). I think there is some reason behind it, can you make me figure it out?


      C) Can I use DataModelSelection when using EntityQuery?
      What I want to have is something like:
      <rich:dataTable value="#{userList.dataModel}" var="userItem" id="userListId"
       rows="#{userList.maxResults}">
      ....
      <rich:column>
       <f:facet name="header">#{messages['Common.action']}</f:facet>
       <s:link value="#{messages['Common.view']}" action="#{userAction.select(userItem)}"/>
      </rich:column>
      ....
      
      </rich:dataTable>
      


      At this time I can use #{userAction.select(userItem)} only if I have a component which explicitly use @DataModel annotation. But it would be nice to have this out-of-the-box on entity-query.


      Thanks in advance.