Menu

#91 Explicit home interface parameter names

closed-fixed
ejbdoclet (29)
5
2002-09-11
2002-08-28
No

This minor patch replaces XDtEjbHome's behavior of
generating dummy parameter names (e.g. param1, param2,
etc.) with the real names stored in the XParameter objects.

This change is required in order to support a feature
of JBoss: BMP Custom Finders for CMP 2.0 beans.

Example:

/**
* @ejb.bean
* name="Gangster"
* type="CMP"
* @ejb.finder
* signature="java.util.Collection
findByKeys(java.util.Collection keys)"
* query="Overridden by GangsterBean.java"
*/
public abstract class GangsterBean
implements EntityBean
{

public Collection ejbFindByKeys(Collection keys)
{
return keys;
}

}

Without this patch the HomeInterfaceSubTask would
generate the following un-compilable Home interface:

public interface GangsterHome
extends javax.ejb.EJBHome
{

public java.util.Collection
findByKeys(java.util.Collection param1)
throws FinderException,RemoteException;

public java.util.Collection
findByKeys(java.util.Collection keys)
throws FinderException,RemoteException;

}

The findByKeys method is declared twice. The reason
for this is that XDtEjbHome:forAllHomeMethods scans for
ejb:finder class tags as well as methods with names
begining with "ejbFind". When it passes over the
ejb:finder class tag it generates the signature (e.g
parameter names like "param1"), then it passes over the
method and uses the signature with verbatim parameter
names, checks to see if that signature has already been
used (HashSet of signatures), thinks it hasn't because
the two signatures differ.

Discussion

  • Gerald Turner

    Gerald Turner - 2002-08-28

    Patch that changes XDtEjbHome to use parameter names rather than generated names

     
  • Mathias Bogaert

    Mathias Bogaert - 2002-09-06
    • assigned_to: nobody --> ara_e_w
     
  • Ara Abrahamian

    Ara Abrahamian - 2002-09-11

    Logged In: YES
    user_id=205271

    Fixed. Thanks.

    Ara.

     
  • Ara Abrahamian

    Ara Abrahamian - 2002-09-11
    • status: open --> closed-fixed
     

Log in to post a comment.