gdamour     2005/02/05 06:26:53

  Modified:    modules/core/src/java/org/openejb/entity/cmp
                        CollectionValuedSelect.java SetValuedSelect.java
                        SingleValuedSelect.java
  Log:

  Should throw the exceptions intead of returning them.
  
  Revision  Changes    Path
  1.3       +3 -4      
openejb/modules/core/src/java/org/openejb/entity/cmp/CollectionValuedSelect.java
  
  Index: CollectionValuedSelect.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/CollectionValuedSelect.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CollectionValuedSelect.java       2 Feb 2005 12:53:02 -0000       1.2
  +++ CollectionValuedSelect.java       5 Feb 2005 11:26:53 -0000       1.3
  @@ -52,7 +52,6 @@
   
   import javax.ejb.FinderException;
   
  -import org.apache.geronimo.core.service.SimpleInvocationResult;
   import org.tranql.field.Row;
   import org.tranql.ql.QueryException;
   import org.tranql.query.CollectionResultHandler;
  @@ -71,13 +70,13 @@
           this.commandView = commandView;
       }
   
  -    public Object invokeInstance(CMPInstanceContext ctx, Object[] args) {
  +    public Object invokeInstance(CMPInstanceContext ctx, Object[] args) 
throws Exception {
           Collection results = new ArrayList();
           try {
               CollectionResultHandler handler = new 
CollectionResultHandler(commandView.getView()[0]);
               commandView.getQueryCommand().execute(handler, new Row(args), 
results);
           } catch (QueryException e) {
  -            return new FinderException(e.getMessage()).initCause(e);
  +            throw (FinderException) new 
FinderException(e.getMessage()).initCause(e);
           }
           return results;
       }
  
  
  
  1.3       +3 -6      
openejb/modules/core/src/java/org/openejb/entity/cmp/SetValuedSelect.java
  
  Index: SetValuedSelect.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/SetValuedSelect.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SetValuedSelect.java      2 Feb 2005 12:53:02 -0000       1.2
  +++ SetValuedSelect.java      5 Feb 2005 11:26:53 -0000       1.3
  @@ -47,14 +47,11 @@
    */
   package org.openejb.entity.cmp;
   
  -import java.util.ArrayList;
  -import java.util.Collection;
   import java.util.HashSet;
   import java.util.Set;
   
   import javax.ejb.FinderException;
   
  -import org.apache.geronimo.core.service.SimpleInvocationResult;
   import org.tranql.field.Row;
   import org.tranql.ql.QueryException;
   import org.tranql.query.CollectionResultHandler;
  @@ -72,13 +69,13 @@
           this.commandView = commandView;
       }
       
  -    public Object invokeInstance(CMPInstanceContext ctx, Object[] args) {
  +    public Object invokeInstance(CMPInstanceContext ctx, Object[] args) 
throws Exception {
           Set results = new HashSet();
           try {
               CollectionResultHandler handler = new 
CollectionResultHandler(commandView.getView()[0]);
               commandView.getQueryCommand().execute(handler, new Row(args), 
results);
           } catch (QueryException e) {
  -            return new FinderException(e.getMessage()).initCause(e);
  +            throw (FinderException) new 
FinderException(e.getMessage()).initCause(e);
           }
           return results;
       }
  
  
  
  1.3       +3 -3      
openejb/modules/core/src/java/org/openejb/entity/cmp/SingleValuedSelect.java
  
  Index: SingleValuedSelect.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/SingleValuedSelect.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SingleValuedSelect.java   2 Feb 2005 12:53:03 -0000       1.2
  +++ SingleValuedSelect.java   5 Feb 2005 11:26:53 -0000       1.3
  @@ -77,7 +77,7 @@
               SingleValuedResultHandler handler = new 
SingleValuedResultHandler(commandView.getView()[0]);
               o = commandView.getQueryCommand().execute(handler, new 
Row(args), NODATA);
           } catch (QueryException e) {
  -            return new FinderException(e.getMessage()).initCause(e);
  +            throw (FinderException) new 
FinderException(e.getMessage()).initCause(e);
           }
           if (NODATA == o) {
               throw new ObjectNotFoundException();
  @@ -99,7 +99,7 @@
                       throw new QueryException(e);
                   }
               }
  -            return new FinderException("More than one row returned from 
single valued select.");
  +            throw new QueryException("More than one row returned from single 
valued select.");
           }
       }
   }
  
  
  

Reply via email to