Hi all,

I submitted a patch to include custom finder declarations in the
generated *Bean.java files from Middlegen. It's under:

[ 575413 ] Merge file support for custom finders

You can now specify a mergedir attribute in the cmp20 tag to tell
Middlegen where to look for the merge files. There is one file per
table. The name is <tablename>-finders.merge. The tablename part is CASE
SENSITIVE! It is the value the getSqlName() method returns. So for
Hypersoniq DB it would e.g. be PERSONS-finders.merge and under mySQL it
would be persons-finders.merge. Could have converted it all to lower
case, but I just realized myself, and I already submitted the patch :-))

In the merge file declare something like (damn line wrapping):

@ejb:finder
    signature="java.util.Collection
findByFirstNameAndLastname(java.lang.String firstName, java.lang.String
lastName)"
    result-type-mapping="Local"
    method-intf="LocalHome"
    query="SELECT DISTINCT OBJECT(o) FROM Person o WHERE o.firstName =
?1 AND o.lastName = ?2"

Hope this works for everyone and helps a few people.

Leander


Am Fre, 2002-06-28 um 16.44 schrieb Aslak Helles�y:
> OK, I'll reopen the FR later (SF is down). I realise it would be useful for
> merging in other kinds of tags too.
> 
> I acknowledge the importance of this FR, but I have more important tasks in
> XDoclet and also in Middlegen. Therefore, a patch from you or someone else
> would be very helpful. If I have to do it myself it might take a few
> weeks/months/years ;-)
> 
> /Aslak
> 
> 
> > -----Original Message-----
> > From: Joao Miguel Garcia [mailto:[EMAIL PROTECTED]]
> > Sent: 28. juni 2002 11:40
> > To: Marcus Brito; Aslak Helles�y
> > Subject: RE: [Finders] Adding finders... Again!
> >
> >
> > Hi Marcus and Aslak
> >
> > I think there is a missunderstanding on this issue!
> >
> > Marcus wrote this to me:
> >
> >     Yeah, that's just what I done. I've defined a new merge point for
> >     finders. The intended use of this is when you have a bean
> > for which you
> >     have no source, and you need to declare its finders.
> >
> >     If you do have the sources for the beans, you should add @ejb:finder
> >     tags to it instead of using ejb-finders-{0}.xml
> >
> > Aslak, this problem should be resolved by Middlegen and not by XDoclet.
> >
> > Guys, help me please....
> >
> > I have the beans generated by Middlegen and processed by XDoclet
> > and it's a bit complicated to copy the ejb:finder tags to the
> > files generated by Middlegen each time I want to chang something
> > in my database!
> >
> > Thanks,
> >
> > Jo�o Miguel Garcia
> > IT Billing
> > OniWay
> > Av. Almirantes Reis, 65 - Edif�cio D
> > 1150-011 Lisboa
> > Mobile: 96 849 37 10
> >
> >
> > -----Original Message-----
> > From: Marcus Brito [mailto:[EMAIL PROTECTED]]
> > Sent: s�bado, 22 de Junho de 2002 21:30
> > To: Joao Miguel Garcia
> > Subject: RE: [Finders] Adding finders... Again!
> >
> >
> > Em Sex, 2002-06-21 �s 16:07, Joao Miguel Garcia escreveu:
> > > Hi Marcus,
> > >
> > > But my XXXBeran.java is being generated by Middlegen and I
> > don't want to edit those files!!!!
> >
> > Chore no colo do Aslak pedindo para adicionar ao middlegen a
> > possibilidade de declarar finders extras :)
> >
> > Estou brincando quanto a chorar no colo, mas realmente acredito que esse
> > tipo de problema � melhor resolvido no lado do middlegen que no lado do
> > xdoclet.
> >
> > J� que o middlegen � uma ferramenta que gera c�digo para o xdoclet, �
> > melhor que ela possa criar novos finders. Abra um "feature request" para
> > o middlegen no sourceforge.net
> >
> > --
> > Pazu <[EMAIL PROTECTED]>
> >
> > Anime Gaiden - De f�s para f�s, sempre.
> > http://www.animegaiden.com.br
> 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to