User: dsundstrom
  Date: 02/04/13 18:56:10

  Modified:    src/main/org/jboss/ejb/plugins/cmp/jdbc
                        JDBCQueryManager.java
  Log:
  Fixed complaint (bug) [ 541870 ] Exception Cleanup (findByPrimaryKey).
  
  Now reports method name and parameter type.
  
  Revision  Changes    Path
  1.6       +15 -15    
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCQueryManager.java
  
  Index: JDBCQueryManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCQueryManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JDBCQueryManager.java     12 Apr 2002 21:39:47 -0000      1.5
  +++ JDBCQueryManager.java     14 Apr 2002 01:56:10 -0000      1.6
  @@ -32,7 +32,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Joe Shevland</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Justin Forder</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class JDBCQueryManager
   {
  @@ -101,27 +101,27 @@
         
         if(localHomeClass != null)
         {
  +
  +         Method method = null;
            try
            {
               // try to get the finder method on the local home interface
  -            Method method = localHomeClass.getMethod(
  -            "findByPrimaryKey",
  -            new Class[]
  -            {entity.getPrimaryKeyClass()});
  -            
  -            // got it add it to known finders
  -            JDBCQueryMetaData q = new JDBCAutomaticQueryMetaData(method);
  -            knownQueries.put(
  -            method,
  -            factory.createFindByPrimaryKeyQuery(q));
  -            
  -            log.debug("Added findByPrimaryKey query command for " +
  -            "local home interface");
  +            localHomeClass.getMethod(
  +                  "findByPrimaryKey",
  +                  new Class[] { entity.getPrimaryKeyClass() });
            } catch(NoSuchMethodException e)
            {
               throw new DeploymentException("Local home interface does " +
  -            "not have a findByPrimaryKey method");
  +               "not have the method findByPrimaryKey(" +
  +               entity.getPrimaryKeyClass().getName() + ")");
            }
  +            
  +         // got it add it to known finders
  +         JDBCQueryMetaData q = new JDBCAutomaticQueryMetaData(method);
  +         knownQueries.put(method, factory.createFindByPrimaryKeyQuery(q));
  +            
  +         log.debug("Added findByPrimaryKey query command for " +
  +               "local home interface");
         }
         
         //
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to