Discussion:
[Middlegen-user] RE: [Finders] Adding finders... Again!
Aslak Hellesøy
2002-06-28 12:45:12 UTC
Permalink
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-----
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!
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.
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-----
Sent: sábado, 22 de Junho de 2002 21:30
To: Joao Miguel Garcia
Subject: RE: [Finders] Adding finders... Again!
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
--
Anime Gaiden - De fãs pa
M-Leander Reimer
2002-06-29 15:24:02 UTC
Permalink
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
Post by 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-----
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!
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.
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-----
Sent: sábado, 22 de Junho de 2002 21:30
To: Joao Miguel Garcia
Subject: RE: [Finders] Adding finders... Again!
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
--
Anime Gaiden - De fãs para fãs, sempre.
http://www.animegaiden.com.br
Aslak Hellesøy
2002-06-29 23:11:02 UTC
Permalink
This is good Leander. I'll commit it in a day or two.

aslak
---- Original Message ---
Subject: Re: [Middlegen-user] RE: [Finders] Adding finders... Again!
Hi all,
I submitted a patch to include custom finder declarations in the
[ 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 :-))
@ejb:finder
signature=3D"java.util.Collection
findByFirstNameAndLastname(java.lang.String firstName, java.lang.String
lastName)"
result-type-mapping=3D"Local"
method-intf=3D"LocalHome"
query=3D"SELECT DISTINCT OBJECT(o) FROM Person o WHERE o.firstName =3D
?1 AND o.lastName =3D ?2"
Hope this works for everyone and helps a few people.
Leander
OK, I'll reopen the FR later (SF is down). I realise it would be useful f=
or
merging in other kinds of tags too.
=20
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 els=
e
would be very helpful. If I have to do it myself it might take a few
weeks/months/years ;-)
=20
/Aslak
=20
=20
-----Original Message-----
Sent: 28. juni 2002 11:40
To: Marcus Brito; Aslak Helles=F8y
Subject: RE: [Finders] Adding finders... Again!
Hi Marcus and Aslak
I think there is a missunderstanding on this issue!
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.
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=E3o Miguel Garcia
IT Billing
OniWay
Av. Almirantes Reis, 65 - Edif=EDcio D
1150-011 Lisboa
Mobile: 96 849 37 10
-----Original Message-----
Sent: s=E1bado, 22 de Junho de 2002 21:30
To: Joao Miguel Garcia
Subject: RE: [Finders] Adding finders... Again!
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 ess=
e
tipo de problema =E9 melhor resolvido no lado do middlegen que no lado =
do
xdoclet.
J=E1 que o middlegen =E9 uma ferramenta que gera c=F3digo para o xdocle=
t, =E9
melhor que ela possa criar novos finders. Abra um "feature request" par=
a
o middlegen no sourceforge.net
--
Anime Gaiden - De f=E3s para f=E3s, sempre.
http://www.animegaiden.com.br
=20
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...