User: vharcq  
  Date: 02/04/08 16:01:46

  Modified:    core/src/xdoclet/ejb/tags HomeTagsHandler.java
  Log:
  Do not add automatically the mandatory FBPK in Home twice in 2 cases :
  - fbpk has been defined in ejb:finder (to set some security on it)
  - fbpk is explicitely defined in the bean
  
  Revision  Changes    Path
  1.31      +11 -2     xdoclet/core/src/xdoclet/ejb/tags/HomeTagsHandler.java
  
  Index: HomeTagsHandler.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/HomeTagsHandler.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -w -r1.30 -r1.31
  --- HomeTagsHandler.java      8 Apr 2002 13:38:29 -0000       1.30
  +++ HomeTagsHandler.java      8 Apr 2002 23:01:46 -0000       1.31
  @@ -27,7 +27,7 @@
   /**
    * @author    Ara Abrahamian ([EMAIL PROTECTED])
    * @created   Oct 15, 2001
  - * @version   $Revision: 1.30 $
  + * @version   $Revision: 1.31 $
    */
   public class HomeTagsHandler extends EjbTagsHandler
   {
  @@ -788,6 +788,7 @@
   
                // 1. Handle METHOD Tag level ejb:finder
                XMethod[] methods = getCurrentClass().methods();
  +             boolean fbpkFound = false;
   
                for( int i = 0; i < methods.length; i++ )
                {
  @@ -885,6 +886,11 @@
                                // For javadoc comment only
                                setCurrentMethod( method );
   
  +                             // If custom findByPrimaryKey exists then we should 
not add the
  +                             // mandatory later
  +                             if( method.name().equals( "findByPrimaryKey" ) )
  +                                     fbpkFound = true;
  +
                                generate( template );
                        }
                }
  @@ -909,6 +915,9 @@
                                        cat.debug( "Finder Method = " + signature );
                                }
   
  +                             if( signature.indexOf( "findByPrimaryKey" ) != -1 )
  +                                     fbpkFound = true;
  +
                                setCurrentTag( tags[i] );
                                setCurrentSignature( signature );
   
  @@ -926,7 +935,7 @@
                }
   
                // Add mandatory findByPrimaryKey if not already there
  -             if( CmpTagsHandler.isEntityCmp( getCurrentClass() ) && tagType.equals( 
"ejb:finder" ) )
  +             if( !fbpkFound && CmpTagsHandler.isEntityCmp( getCurrentClass() ) && 
tagType.equals( "ejb:finder" ) )
                {
                        StringBuffer fbpkSign = new StringBuffer( 
InterfaceTagsHandler.getComponentInterface( type, getCurrentClass() ) );
   
  
  
  

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Sponsored by http://www.ThinkGeek.com/

Reply via email to