Discussion:
[Middlegen-user] Trying to have my CMP EJBs extending a base class (cmp20 plugin)
Gregory CHAZALON
2003-06-11 08:15:02 UTC
Permalink
Hi users,

I'm trying to make the cmp20 plugin to write an "extend xxx" statement for the generated entities source files.

In fact, I have a BaseEntityBean class which implements the javax.ejb.EntityBean interface and have some logging capabilities. And I want to make every single entity bean extending that class.

The main reason to do this is to avoid an error at deployment time because the entites generated source files do not implements all the methods defined in the javax.ejb.EntityBean (ejbPassivate and so on). Therefore, weblogic rejects me when I try to run the ejbc tool.

I know there is the <entitycmp/> tag that do avoid the error at deployment time. But, this solution is not acceptable for me as it generates more bulk classes (named xxxCMP.java) that only define the missing methods of the interface. I don't want that, it's pretty ugly I think :-(

So, has any Middlegen guru achiveved this extending solution ? I can't find any help in the documentation.

I will appreciate any idea.

R
Eivind Waaler
2003-06-11 08:53:07 UTC
Permalink
You have to hack the template to achieve this. Must have something like
this in the template:

public abstract class $table.destinationClassName extends YourBaseBean=20
implements javax.ejb.EntityBean {

Take a copy of the template, modify and use it like this in the build.xml:

<cmp20..
<fileproducer
id=3D"entity-cmp-20"
template=3D"path.to.your.template.vm"/>
=2E.
</cmp20>

For a more dynamic solution you would have to add the baseclass parameter
to the plugin, check for this and add in the template.

Beware that xdoclet use the xxCMP.java files for some other stuff as
well. For instance value object support adds methods to these classes.

Regards
=2Eeivind
Post by Gregory CHAZALON
Hi users,
=20
I'm trying to make the cmp20 plugin to write an "extend xxx" statement fo=
r the generated entities source files.
Post by Gregory CHAZALON
=20
In fact, I have a BaseEntityBean class which implements the javax.ejb.Ent=
ityBean interface and have some logging capabilities. And I want to make ev=
ery single entity bean extending that class.
Post by Gregory CHAZALON
=20
The main reason to do this is to avoid an error at deployment time becaus=
e the entites generated source files do not implements all the methods defi=
ned in the javax.ejb.EntityBean (ejbPassivate and so on). Therefore, weblog=
ic rejects me when I try to run the ejbc tool.
Post by Gregory CHAZALON
=20
I know there is the <entitycmp/> tag that do avoid the error at deploymen=
t time. But, this solution is not acceptable for me as it generates more bu=
lk classes (named xxxCMP.java) that only define the missing methods of the =
interface. I don't want that, it's pretty ugly I think :-( =20
Post by Gregory CHAZALON
=20
So, has any Middlegen guru achiveved this extending solution ? I can't fi=
nd any help in the documentation.
Post by Gregory CHAZALON
=20
I will appreciate any idea.
=20
Regards,
=20
Gregory ChazalonN=18=ACHY=DE=B5=E9=9A=8AX=AC=B2=9A'=B2=8A=DEu=BC=BE=12=D9=
=EE=B2f=A4z=BB(}:-jUb{=04=E1y=B7=AC=B6=D8ky=A7]y=BB=A0=81=EA=E8=9E=D8^=A6V=
=A7z=D0=DE=B2('y=DC"=B6=1Ba=AD=E6=9Du=E6=EE=82=08=A7=81=F7=9A=B6=EA=DE=B3*.=
=BD=E9=DE=BD=EA=DD=AD=E6=A6y=DA=1F=B6=BC=93=A2=D6=A5V'=B0=E9=FA=DEy=ABp=C3=
=07=AD=9E=EB=1C=A2i=A2u=D9^=81=E9=EE=B1=EA=E6j)b=9E=09b=B2=D9=A2u=D9^=81=E9=
=EE=B1=EA=E5=8A=CBl=B2=8B=ABq=E7=E8=AE=07=A7z=D8m=B6=9B>=FF=F9b=B2=DB,=A2=
=EA=DCy=FA+=81=E9=DE=B7=F9b=B2=DB?=96+-=8Aw=E8=FEh=9DvW=A0z{=ACz
Gregory CHAZALON
2003-06-11 09:53:12 UTC
Permalink
Thank you very much Eivind for this trick ! It works perfectly.

By the way, you mention the way xxxCMP.java files are used for Xdoclet value object feature.
Do you know any workaround to add the value object methods directly inside the bean source file ?
I really want to get rid off these extra CMP classes...

Thanks again anyway

Best regards,

Gregory


----- Original Message -----
From: "Eivind Waaler" <***@tihlde.org>
To: <middlegen-***@lists.sourceforge.net>
Sent: Wednesday, June 11, 2003 12:51 PM
Subject: Re: [Middlegen-user] Trying to have my CMP EJBs extending a base class (cmp20 plugin)


You have to hack the template to achieve this. Must have something like
this in the template:

public abstract class $table.destinationClassName extends YourBaseBean
implements javax.ejb.EntityBean {

Take a copy of the template, modify and use it like this in the build.xml:

<cmp20..
<fileproducer
id="entity-cmp-20"
template="path.to.your.template.vm"/>
..
</cmp20>

For a more dynamic solution you would have to add the baseclass parameter
to the plugin, check for this and add in the template.

Beware that xdoclet use the xxCMP.java files for some other stuff as
well. For instance value object support adds methods to these classes.

Regards
.eivind
Post by Gregory CHAZALON
Hi users,
I'm trying to make the cmp20 plugin to write an "extend xxx" statement for the generated entities source files.
In fact, I have a BaseEntityBean class which implements the javax.ejb.EntityBean interface and have some logging capabilities. And I want to make every single entity bean extending that class.
The main reason to do this is to avoid an error at deployment time because the entites generated source files do not implements all the methods defined in the javax.ejb.EntityBean (ejbPassivate and so on). Therefore, weblogic rejects me when I try to run the ejbc tool.
I know there is the <entitycmp/> tag that do avoid the error at deployment time. But, this solution is not acceptable for me as it generates more bulk classes (named xxxCMP.java) that only define the missing methods of the interface. I don't want that, it's pretty ugly I think :-(
So, has any Middlegen guru achiveved this extending solution ? I can't find any help in the documentation.
I will appreciate any idea.
Regards,
Gregory ChazalonN¬HYÞµésSX¬²s'²SÞu¼¾Ùî²f¤z»(}:-jUb{áy·¬¶Øky§]y» êèzØ^¦V§zÐÞ²('yÜ"¶a­æuæî,§÷s¶êÞ³*.½éÞ½êÝ­æ¦yÚ¶¼"¢Ö¥V'°éúÞy«pízë¢i¢uÙ^éî±êæj)bz b²Ù¢uÙ^éî±êåSËl²<«qç讧zØm¶>>ÿùb²Û,¢êÜyú+éÞ·ùb²Û?-+-SwèþhvW z{¬z
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
middlegen-user mailing list
middlegen-***@lists.sourceforge.net
https://lists.sou
Eivind Waaler
2003-06-11 10:45:07 UTC
Permalink
I'm not sure how you'd get rid of those CMP classes. Try asking on
xdoclet-user maybe..?

=2Eeivind
Post by Gregory CHAZALON
Thank you very much Eivind for this trick ! It works perfectly.
=20
By the way, you mention the way xxxCMP.java files are used for Xdoclet v=
alue object feature.
Post by Gregory CHAZALON
Do you know any workaround to add the value object methods directly insid=
e the bean source file ?
Post by Gregory CHAZALON
I really want to get rid off these extra CMP classes...
=20
Thanks again anyway
=20
Best regards,
=20
Gregory
=20
=20
----- Original Message -----=20
Sent: Wednesday, June 11, 2003 12:51 PM
Subject: Re: [Middlegen-user] Trying to have my CMP EJBs extending a base=
class (cmp20 plugin)
Post by Gregory CHAZALON
=20
=20
You have to hack the template to achieve this. Must have something like
=20
public abstract class $table.destinationClassName extends YourBaseBean=20
implements javax.ejb.EntityBean {
=20
Take a copy of the template, modify and use it like this in the build.xml=
=20
<cmp20..
<fileproducer
id=3D"entity-cmp-20"
template=3D"path.to.your.template.vm"/>
..
</cmp20>
=20
For a more dynamic solution you would have to add the baseclass parameter
to the plugin, check for this and add in the template.
=20
Beware that xdoclet use the xxCMP.java files for some other stuff as
well. For instance value object support adds methods to these classes.
=20
Regards
.eivind
=20
=20
Post by Gregory CHAZALON
Hi users,
=20
I'm trying to make the cmp20 plugin to write an "extend xxx" statement =
for the generated entities source files.
Post by Gregory CHAZALON
Post by Gregory CHAZALON
=20
In fact, I have a BaseEntityBean class which implements the javax.ejb.E=
ntityBean interface and have some logging capabilities. And I want to make =
every single entity bean extending that class.
Post by Gregory CHAZALON
Post by Gregory CHAZALON
=20
The main reason to do this is to avoid an error at deployment time beca=
use the entites generated source files do not implements all the methods de=
fined in the javax.ejb.EntityBean (ejbPassivate and so on). Therefore, webl=
ogic rejects me when I try to run the ejbc tool.
Post by Gregory CHAZALON
Post by Gregory CHAZALON
=20
I know there is the <entitycmp/> tag that do avoid the error at deploym=
ent time. But, this solution is not acceptable for me as it generates more =
bulk classes (named xxxCMP.java) that only define the missing methods of th=
e interface. I don't want that, it's pretty ugly I think :-( =20
Post by Gregory CHAZALON
Post by Gregory CHAZALON
=20
So, has any Middlegen guru achiveved this extending solution ? I can't =
find any help in the documentation.
Post by Gregory CHAZALON
Post by Gregory CHAZALON
=20
I will appreciate any idea.
=20
Regards,
=20
Gregory ChazalonN=18=ACHY=DE=B5=E9sSX=AC=B2s'=B2S=DEu=BC=BE=12=D9=EE=B2=
f=A4z=BB(}:-jUb{=04=E1y=B7=AC=B6=D8ky=A7]y=BB =81=EA=E8z=D8^=A6V=A7z=D0=DE=
=B2('y=DC"=B6=1Ba=AD=E6=9Du=E6=EE,=08=A7=81=F7s=B6=EA=DE=B3*.=BD=E9=DE=BD=
=EA=DD=AD=E6=A6y=DA=1F=B6=BC"=A2=D6=A5V'=B0=E9=FA=DEy=ABp=C3=07=ADz=EB=1C=
=A2i=A2u=D9^=81=E9=EE=B1=EA=E6j)bz b=B2=D9=A2u=D9^=81=E9=EE=B1=EA=E5S=CBl=
=B2<=ABq=E7=E8=AE=07=A7z=D8m=B6>>=FF=F9b=B2=DB,=A2=EA=DCy=FA+=81=E9=DE=B7=
=F9b=B2=DB?-+-Sw=E8=FEh=9DvW z{=ACz
Post by Gregory CHAZALON
=20
=20
=20
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-userN=18=ACHY=DE=
=B5=E9=9A=8AX=AC=B2=9A'=B2=8A=DEu=BC=BE=12=D9=EE=B2f=A4z=BB(}:-jUb{=04=E1y=
=B7=AC=B6=D8ky=A7]y=BB=A0=81=EA=E8=9E=D8^=A6V=A7z=D0=DE=B2('y=DC"=B6=1Ba=AD=
=E6=9Du=E6=EE=82=08=A7=81=F7=9A=B6=EA=DE=B3*.=BD=E9=DE=BD=EA=DD=AD=E6=A6y=
=DA=1F=B6=BC=93=A2=D6=A5V'=B0=E9=FA=DEy=ABp=C3=07=AD=9E=EB=1C=A2i=A2u=D9^=
=81=E9=EE=B1=EA=E6j)b=9E=09b=B2=D9=A2u=D9^=81=E9=EE=B1=EA=E5=8A=CBl=B2=8B=
=ABq=E7=E8=AE=07=A7z=D8m=B6=9B>=FF=F9b=B2=DB,=A2=EA=DCy=FA+=81=E9=DE=B7=F9b=
=B2=DB?=96+-=8Aw=E8=FEh=9DvW=A0z{=ACz

Loading...