User: fleury  
  Date: 00/06/02 17:00:00

  Modified:    src/main/org/jboss/ejb/plugins/jaws
                        JAWSPersistenceManager.java
  Log:
  The test take the object directly as the key
  
  Revision  Changes    Path
  1.14      +8 -10     
jboss/src/main/org/jboss/ejb/plugins/jaws/JAWSPersistenceManager.java
  
  Index: JAWSPersistenceManager.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jaws/JAWSPersistenceManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JAWSPersistenceManager.java       2000/06/02 23:10:00     1.13
  +++ JAWSPersistenceManager.java       2000/06/03 00:00:00     1.14
  @@ -80,7 +80,7 @@
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *  @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  - *   @version $Revision: 1.13 $
  + *   @version $Revision: 1.14 $
    */
   public class JAWSPersistenceManager
      implements EntityPersistenceManager
  @@ -315,7 +315,6 @@
      public void createEntity(Method m, Object[] args, EntityEnterpriseContext ctx)
         throws RemoteException, CreateException
      {
  -      log.debug("Create entity");
         // Get methods
         try
         {
  @@ -419,7 +418,8 @@
            // Invoke postCreate
            postCreateMethod.invoke(ctx.getInstance(), args);
         } catch (InvocationTargetException e)
  -      {
  +      {    
  +               
            throw new CreateException("Create failed:"+e);
         } catch (NoSuchMethodException e)
         {
  @@ -443,7 +443,6 @@
        
        public boolean beanExists(Object id) {
                
  -             
                Connection con = null;
                
                PreparedStatement stmt = null;
  @@ -500,7 +499,6 @@
                                throw new SQLException("Unable to check for EJB in 
database");
                        }
                        
  -                     //Tracer.trace("Result is "+result);
                        if ( rs.getInt("Total") >= 1 )
                                exists = true;
                        else
  @@ -535,18 +533,18 @@
                }
        }
      
  -     public Object findByPrimaryKey(EntityEnterpriseContext ctx) throws 
FinderException {
  +     public Object findByPrimaryKey(Object id) throws FinderException {
           
           //Tracer.trace("PrimaryKey is 
"+beanWrapper.getPrimaryKey().getDataBasePrimaryKey());
   
  -        if (beanExists(ctx.getId())) {
  +        if (beanExists(id)) {
   
  -            return ctx;
  +            return id;
           }
           else {
   
               throw new FinderException ("Object with primary key "+
  -                                                                     ctx.getId()+ 
  +                                                                     id+ 
                                                " not found in storage");
           }
       }
  @@ -561,7 +559,7 @@
         if (finderMethod.getName().equals("findByPrimaryKey"))
         {
            
  -         return findByPrimaryKey(ctx);
  +         return findByPrimaryKey(args[0]);
         }
         else
         {
  
  
  

Reply via email to