[jboss-cvs] jboss-seam/src/main/org/jboss/seam/framework ...

Peter Muir peter at bleepbleep.org.uk
Mon Apr 23 09:57:57 EDT 2007


  User: pmuir   
  Date: 07/04/23 09:57:57

  Modified:    src/main/org/jboss/seam/framework  EntityQuery.java
  Log:
  JBSEAM-1230
  
  Revision  Changes    Path
  1.14      +15 -6     jboss-seam/src/main/org/jboss/seam/framework/EntityQuery.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EntityQuery.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/framework/EntityQuery.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- EntityQuery.java	23 Apr 2007 13:51:45 -0000	1.13
  +++ EntityQuery.java	23 Apr 2007 13:57:57 -0000	1.14
  @@ -36,10 +36,13 @@
      @Override
      public List getResultList()
      {
  -      if ( resultList==null || isAnyParameterDirty() )
  +      if (isAnyParameterDirty())
         {
  -         javax.persistence.Query query = createQuery();
            refresh();
  +      }
  +      if ( resultList==null )
  +      {
  +         javax.persistence.Query query = createQuery();
            resultList = query==null ? null : query.getResultList();
         }
         return resultList;
  @@ -49,10 +52,13 @@
      @Override
      public Object getSingleResult()
      {
  -      if ( singleResult==null || isAnyParameterDirty() )
  +      if (isAnyParameterDirty())
         {
  -         javax.persistence.Query query = createQuery();
            refresh();
  +      }
  +      if ( singleResult==null)
  +      {
  +         javax.persistence.Query query = createQuery();
            singleResult = query==null ? 
                  null : query.getSingleResult();
         }
  @@ -63,10 +69,13 @@
      @Override
      public Long getResultCount()
      {
  -      if ( resultCount==null || isAnyParameterDirty() )
  +      if (isAnyParameterDirty())
         {
  -         javax.persistence.Query query = createCountQuery();
            refresh();
  +      }
  +      if ( resultCount==null )
  +      {
  +         javax.persistence.Query query = createCountQuery();
            resultCount = query==null ? 
                  null : (Long) query.getSingleResult();
         }
  
  
  



More information about the jboss-cvs-commits mailing list