Re: How to generate custom query method

"M.-Leander Reimer" <[email protected]>
Newsgroups gmane.comp.java.ejb.middlegen.user
Organization Techdivision GdbR
Message-ID <[email protected]>
Hi Dietmar,

1. I think an EJB select method has to start with ejbSelect so tge 
method name should be

public abstract long ejbSelectCountCards(long ErrorId);

2. You need a second method which you tag as @ejb.interface-method 
view-type="local", that simply calls your EJB select method. This will 
result in the method being present in your interface definition.

Hope this works.

Leander

[email protected] schrieb:
> 
> Thanks for the help.
> I had figured that out by now from an example. It still does not work 
> though. Xdoclet does not generate any interface method (but no Error is 
> reported).
> Any clue?
> Thanks.
> 
> 
> 	*Tim Cockle <[email protected]>*
> Gesendet von: [email protected]
> 
> 10.09.2004 10:46
> Bitte antworten an middlegen-user
> 
> 	       
>         An:        [email protected]
>         Kopie:        
>         Thema:        Re: [Middlegen-user] How to generate custom query 
> method
> 
> 
> 
> 
> Hi
> 
> It should be in cmp20-Card-class-code.txt
> 
> Tim
> On Fri, 2004-09-10 at 09:37, [email protected] wrote:
>  > Hi,
>  >
>  > I`m trying to add a EJB query method to a Entity Bean (here for Table
>  > "Card"), that counts the number of entries (here cards).
>  > I have added the following "code"
>  >  /**
>  >  * @ejb.select
>  >  *    result-type-mapping="Local"
>  >  *    query="SELECT COUNT(*) FROM Card,  WHERE State_Id = ?1"
>  >  *
>  > **/
>  > public abstract long countCards(long ErrorId);
>  >
>  >
>  >
>  > in the file "cmp20-Card-class-comments.txt" within the merge
>  > directory.
>  > Midlegen copies this code into the CardBean.java file, but xdoclet
>  > then fails to execute (<<The Bean class is needed but not found in
>  > Xdoclet source path for interface
>  > com.gd.ecard.dao.interfaces.CardLocal>>)
>  >
>  > What am I doing wrong?
>  > I would be grateful for any help.
>  > Thanks.
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> middlegen-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/middlegen-user
> 



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.