I think jboss auto-generates finders like "findBy"+actualFieldName.

I'm not sure why the warning is out-of-sync with this feature, which has
been there since jboss 2.0 or earlier.

david jencks


On 2002.12.08 04:17:03 -0500 [EMAIL PROTECTED] wrote:
> Hello SainTiss,
> 
> I don't know why your findByName method works, but @ejb.finder tags
> should 
> have an associated query attribute. For example: 
> @ejb.finder signature="java.util.Collection findBySaint(java.lang.String 
> saint)" query="SELECT OBJECT(o) FROM Person WHERE o.saint = ?1"
> This is why JBoss says "Warning: Every finder method except
> findByPrimaryKey
> (key) must be associated with a query element in the deployment
> descriptor."
> Those query elements are generated from @ejb.finder query attributes. 
> 
> Best regards,
> Ville Peurala
> 
> 
> Lainaus SainTiss <[EMAIL PROTECTED]>:
> 
> > Hi,
> > 
> > I'm trying to find out about these finder methods, and I've stumbled
> > upon an oddity here:
> > 
> > I created two finder methods, using the following XDoclet tags:
> > 
> >  * @ejb.finder
> >  *      signature="java.util.Collection findByName(java.lang.String
> > name)"
> >  *
> >  * @ejb.finder
> >  *      signature="java.util.Collection findBySaint(java.lang.String
> > saint)"
> > 
> > The difference between them, is basically that there IS a "name" field,
> > but there is NO "saint" field in the EJB...
> > 
> > What happens is that calling the findByName method results in the
> > expected behaviour (ie all entities with the given name are returned),
> > but the findBySaint method results in a FinderException being thrown...
> > 
> > This all looks very logical to me, since of course, the container
> cannot
> > know what I mean by "findBySaint"...
> > 
> > What isn't logical though, is that JBoss complains *twice* when
> > deploying:
> > 
> > 20:44:38,632 INFO  [EJBDeployer] 
> > Bean   : Persoon
> > Method : public abstract Collection findByName(String) throws
> > FinderException, RemoteException
> > Section: 10.5.6
> > Warning: Every finder method except findByPrimaryKey(key) must be
> > associated with a query element in the deployment descriptor.
> > 
> > 20:44:38,633 INFO  [EJBDeployer] 
> > Bean   : Persoon
> > Method : public abstract Collection findBySaint(String) throws
> > FinderException, RemoteException
> > Section: 10.5.6
> > Warning: Every finder method except findByPrimaryKey(key) must be
> > associated with a query element in the deployment descriptor.
> > 
> > From my above experiences, I agree that JBoss should complain about the
> > findBySaint method, but if it complains about the findByName method as
> > well, then why is it working?
> > 
> > Thanks,
> > 
> > Hans
> > 
> > 
> > 
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> 
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to