Discussion:
[Middlegen-user] Value Objects and Middlegen
Brian Cochran
2002-11-05 02:27:01 UTC
Permalink
Hey Aslak,
I noticed you were one of the primary contributors on Value Objects in
XDoclet. Is that as simple as I think it is as far as integrating it into
middlegen? (Drop it into the template entitiy-cmp20.vm template. Moreover,
where could I find something about the idea behind Value Objects. (i.e what
do they offer, and how do you use them, etc.) Thanks a bunch.

Thanks a bunch,
Brian
Aslak Hellesøy
2002-11-05 19:02:08 UTC
Permalink
-----Original Message-----
Cochran
Sent: 5. november 2002 05:28
Subject: [Middlegen-user] Value Objects and Middlegen
Hey Aslak,
I noticed you were one of the primary contributors on Value Objects in
Nonono. I have never really looked into them or tried them. -Just applied
some patches.
XDoclet. Is that as simple as I think it is as far as integrating it into
middlegen? (Drop it into the template entitiy-cmp20.vm template. Moreover,
where could I find something about the idea behind Value Objects.
(i.e what
do they offer, and how do you use them, etc.) Thanks a bunch.
It would be great if you would do us the favour to add value-object support
in middlegen. Send a diff/patch when you're done. Value object is badly
documented, so be prepared to dig into XDoclet's mail archives and sources.
Thanks a bunch,
Brian
Cheers,
Aslak
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Gavin Hughes
2002-11-05 20:42:04 UTC
Permalink
We've done a quick hack to get Middlegen to generate Value objects
instead of Data objects (or to ask XDoclet to anyway).

The change is a minor modification to the entity CMP template
(entity-cmp-20.vm in the middlegen-entitybean-plugin-2.0-b2-dev.jar
file in lib).

You can do this by modifying the original template or by copying
it and modifying the appropriate section, then overriding the
original template with your modified version. This is done by adding
a <fileproducer> element within the <cmp20> element in your build.xml
file :

<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>

The section of the template between @ejb.bean and @ejb.finder should
be changed to the following (use your own Value object base class in
the "extends" attribute if you want one or just leave it empty) :

#if( ${plugin.dataobject} )
* @ejb:value-object name="${table.beanName}"
* extends="com.nrma.values.BaseValue"
* match="*"
* instantiation="eager"
*
#end

Obviously it would be better to have a different parameter specifying that
value objects are generated (ie. $(plugin.valueobject)) so that you can choose
one or the other. This would need some changes to one of the CMP plugin classes
I think - I've got no idea which one I'm afraid...

Cheers,
Gavin.


-----Original Message-----
From: Aslak Hellesøy [mailto:***@netcom.no]
Sent: Wednesday, 6 November 2002 7:59 AM
To: Brian Cochran; middlegen-***@lists.sourceforge.net
Subject: RE: [Middlegen-user] Value Objects and Middlegen
-----Original Message-----
Cochran
Sent: 5. november 2002 05:28
Subject: [Middlegen-user] Value Objects and Middlegen
Hey Aslak,
I noticed you were one of the primary contributors on Value Objects
in
Nonono. I have never really looked into them or tried them. -Just applied some patches.
XDoclet. Is that as simple as I think it is as far as integrating it
into middlegen? (Drop it into the template entitiy-cmp20.vm template.
Moreover, where could I find something about the idea behind Value
Objects. (i.e what do they offer, and how do you use them, etc.)
Thanks a bunch.
It would be great if you would do us the favour to add value-object support in middlegen. Send a diff/patch when you're done. Value object is badly documented, so be prepared to dig into XDoclet's mail archives and sources.
Thanks a bunch,
Brian
Cheers,
Aslak
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in Las
Vegas (supported by COMDEX), the only Apache event to be fully
supported by the ASF. http://www.apachecon.com
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Eivind Waaler
2002-11-06 05:45:04 UTC
Permalink
Good work, I added a ref. to this mail thread as a feature request:

http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D634285&group_i=
d=3D36044&atid=3D415993

=2Eeivind
=20
We've done a quick hack to get Middlegen to generate Value objects=20
instead of Data objects (or to ask XDoclet to anyway).
=20
The change is a minor modification to the entity CMP template
(entity-cmp-20.vm in the middlegen-entitybean-plugin-2.0-b2-dev.jar
file in lib).=20
=20
You can do this by modifying the original template or by copying
it and modifying the appropriate section, then overriding the
original template with your modified version. This is done by adding
a <fileproducer> element within the <cmp20> element in your build.xml
=20
<fileproducer
id=3D"entity-cmp-20"
template=3D"${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>
=20
be changed to the following (use your own Value object base class in
the "extends" attribute if you want one or just leave it empty) : =20
=20
#if( ${plugin.dataobject} )
*=09=09extends=3D"com.nrma.values.BaseValue"
*=09=09match=3D"*"
*=09=09instantiation=3D"eager"
*
#end
=20
Obviously it would be better to have a different parameter specifying tha=
t
value objects are generated (ie. $(plugin.valueobject)) so that you can c=
hoose
one or the other. This would need some changes to one of the CMP plugin c=
lasses
I think - I've got no idea which one I'm afraid...
=20
Cheers,
Gavin.
=20
=20
-----Original Message-----
Sent: Wednesday, 6 November 2002 7:59 AM
Subject: RE: [Middlegen-user] Value Objects and Middlegen
=20
=20
-----Original Message-----
=20
Cochran
Sent: 5. november 2002 05:28
Subject: [Middlegen-user] Value Objects and Middlegen
Hey Aslak,
I noticed you were one of the primary contributors on Value Objects=
=20
in
=20
Nonono. I have never really looked into them or tried them. -Just applied=
some patches.
=20
XDoclet. Is that as simple as I think it is as far as integrating it=20
into middlegen? (Drop it into the template entitiy-cmp20.vm template.=
=20
Moreover, where could I find something about the idea behind Value=20
Objects. (i.e what do they offer, and how do you use them, etc.)=20
Thanks a bunch.
=20
It would be great if you would do us the favour to add value-object suppo=
rt in middlegen. Send a diff/patch when you're done. Value object is badly =
documented, so be prepared to dig into XDoclet's mail archives and sources.
=20
Thanks a bunch,
Brian
=20
Cheers,
Aslak
=20
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in Las=20
Vegas (supported by COMDEX), the only Apache event to be fully=20
supported by the ASF. http://www.apachecon.com=20
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
=20
=20
=20
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm=20
Tungsten T handheld. Power & Color in a compact size! http://ads.sourcefo=
rge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
=20
=20
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
=20
Gavin Hughes
2002-11-07 22:21:02 UTC
Permalink
We've been doing a bit more work on this here - if any of this is useful
and someone wants to include it into Middlegen then feel free to use
whichever bits you like - the code is still a bit ugly in places I'm afraid.

The change I mentioned in the original message generates Value objects
that only contain the CMP fields (which means they aren't that different
to data objects).

We've done some further modifications now that include CMR fields in the
value objects as well.

The changes are larger than the previous set, and involve the following files :

- nrma-entity-cmp-20.vm - CMP template file (derived from entity-cmp-20.vm)
- NrmaEntityPlugin.java - CMP plugin (extends the CMP20 plugin)
- NrmaEntityTable - (extends Entity20Table)
- nrma-details-object.vm - template file for Details objects

Plugin
------

The Plugin class uses a few new parameters that are specified when it is
invoked in the Ant task :

valueObjectPackage specifies the package that Value objects are to be placed in

detailsObjectPackage specifies the package that Details objects are placed in

There should be a parameter to specify the Value object base class as well (currently
its hard coded into the CMP template).

The Plugin class specifies that NrmaEntityTable represents the table data passed
to the velocity templates - this Table class contains a number of new methods that
let us get various names required for specifying the Value object to be generated
in the template.

The Plugin class generates "Details" objects that are simple wrappers for Value
objects. We use these for debugging - the toString method is edited to print out
whatever information we think is necessary - including CMR information, which the
XDoclet generated Value object doesn't do. These are generated in the same directory
as the Bean classes, which isn't so good if the package specified for them is not
the same as the bean package - haven't found a way around this yet. They aren't used
by any of the generated code so you can ignore them if you wish.

Value object changes to the template
------------------------------------

Look at the template file for all the value object changes - XDoclet @ejb.value-object
tags are now included on all CMP and CMR fields.

One "match" value named "all" is used for all fields - this results in a single
Value object being generated for each Bean that contains all the fields and
relationships on the Bean.

The pattern followed is a little different in intent to what seems to be the
standard XDoclet mechanism of defining particular Value object trees (each with
its own "match" name) for different scenarios.

As there is no simple way of defining these, one Value object class is much
easier to generate. In any case, I find the standard mechanism very unwieldy
for complex trees - instead I use a "tree builder" utility to generate particular
trees at runtime that include the desired branches - have a look at the ValueTreeBuilder
class attached if you are interested (its not used by any of the Middlegen related
code).


Example of invocation in build.xml
----------------------------------

These are invoked instead of <cmp20> in the <middlegen> task :

<nrmacmp20
destination="${build.gen-src.dir}"
package="${packageRoot}.entities"
detailsObjectPackage="${packageRoot}.values"
valueObjectPackage="${packageRoot}.entities"
interfacepackage="${packageRoot}.entities"
jndiprefix="${jndiRoot}"
pkclass="false"
dataobject="true"
datasuffix="Details"
viewtype="local"
mergedir="${basedir}/src/middlegen"
readonly="false"
fkcmp="false"
guid="true">

<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>

<jboss/>

</nrmacmp20>


Hope that helps anyone wanting to generate full Value objects.

Cheers,
Gavin.


-----Original Message-----
From: Eivind Waaler [mailto:***@tihlde.org]
Sent: Wednesday, 6 November 2002 6:45 PM
To: Gavin Hughes
Cc: middlegen-***@lists.sourceforge.net
Subject: RE: [Middlegen-user] Value Objects and Middlegen


Good work, I added a ref. to this mail thread as a feature request:

http://sourceforge.net/tracker/index.php?func=detail&aid=634285&group_id=36044&atid=415993

.eivind
Post by Gavin Hughes
We've done a quick hack to get Middlegen to generate Value objects
instead of Data objects (or to ask XDoclet to anyway).
The change is a minor modification to the entity CMP template
(entity-cmp-20.vm in the middlegen-entitybean-plugin-2.0-b2-dev.jar
file in lib).
You can do this by modifying the original template or by copying it
and modifying the appropriate section, then overriding the original
template with your modified version. This is done by adding a
<fileproducer> element within the <cmp20> element in your build.xml
<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>
be changed to the following (use your own Value object base class in
#if( ${plugin.dataobject} )
* extends="com.nrma.values.BaseValue"
* match="*"
* instantiation="eager"
*
#end
Obviously it would be better to have a different parameter specifying
that value objects are generated (ie. $(plugin.valueobject)) so that
you can choose one or the other. This would need some changes to one
of the CMP plugin classes I think - I've got no idea which one I'm
afraid...
Cheers,
Gavin.
-----Original Message-----
Sent: Wednesday, 6 November 2002 7:59 AM
Subject: RE: [Middlegen-user] Value Objects and Middlegen
-----Original Message-----
Brian
Cochran
Sent: 5. november 2002 05:28
Subject: [Middlegen-user] Value Objects and Middlegen
Hey Aslak,
I noticed you were one of the primary contributors on Value
Objects
in
Nonono. I have never really looked into them or tried them. -Just
applied some patches.
XDoclet. Is that as simple as I think it is as far as integrating it
into middlegen? (Drop it into the template entitiy-cmp20.vm template.
Moreover, where could I find something about the idea behind Value
Objects. (i.e what do they offer, and how do you use them, etc.)
Thanks a bunch.
It would be great if you would do us the favour to add value-object
support in middlegen. Send a diff/patch when you're done. Value object
is badly documented, so be prepared to dig into XDoclet's mail
archives and sources.
Thanks a bunch,
Brian
Cheers,
Aslak
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in Las
Vegas (supported by COMDEX), the only Apache event to be fully
supported by the ASF. http://www.apachecon.com
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Aslak Hellesøy
2002-11-07 22:48:03 UTC
Permalink
Hi Gavin,

We really appreciate your contribution! -But contribution on email will
evaporise in our hot mail boxes. Could you please repost your
code/explanation as a patch on SF?

http://sourceforge.net/tracker/?group_id=36044&atid=415992

Cheers,
Aslak
-----Original Message-----
Hughes
Sent: 8. november 2002 01:12
Cc: Shaun Kelly
Subject: RE: [Middlegen-user] Value Objects and Middlegen
We've been doing a bit more work on this here - if any of this is useful
and someone wants to include it into Middlegen then feel free to use
whichever bits you like - the code is still a bit ugly in places
I'm afraid.
The change I mentioned in the original message generates Value objects
that only contain the CMP fields (which means they aren't that different
to data objects).
We've done some further modifications now that include CMR fields in the
value objects as well.
The changes are larger than the previous set, and involve the
- nrma-entity-cmp-20.vm - CMP template file (derived from
entity-cmp-20.vm)
- NrmaEntityPlugin.java - CMP plugin (extends the CMP20 plugin)
- NrmaEntityTable - (extends Entity20Table)
- nrma-details-object.vm - template file for Details objects
Plugin
------
The Plugin class uses a few new parameters that are specified when it is
valueObjectPackage specifies the package that Value objects are
to be placed in
detailsObjectPackage specifies the package that Details objects
are placed in
There should be a parameter to specify the Value object base
class as well (currently
its hard coded into the CMP template).
The Plugin class specifies that NrmaEntityTable represents the
table data passed
to the velocity templates - this Table class contains a number of
new methods that
let us get various names required for specifying the Value object
to be generated
in the template.
The Plugin class generates "Details" objects that are simple
wrappers for Value
objects. We use these for debugging - the toString method is
edited to print out
whatever information we think is necessary - including CMR
information, which the
XDoclet generated Value object doesn't do. These are generated in
the same directory
as the Bean classes, which isn't so good if the package specified
for them is not
the same as the bean package - haven't found a way around this
yet. They aren't used
by any of the generated code so you can ignore them if you wish.
Value object changes to the template
------------------------------------
Look at the template file for all the value object changes -
tags are now included on all CMP and CMR fields.
One "match" value named "all" is used for all fields - this
results in a single
Value object being generated for each Bean that contains all the
fields and
relationships on the Bean.
The pattern followed is a little different in intent to what
seems to be the
standard XDoclet mechanism of defining particular Value object
trees (each with
its own "match" name) for different scenarios.
As there is no simple way of defining these, one Value object
class is much
easier to generate. In any case, I find the standard mechanism
very unwieldy
for complex trees - instead I use a "tree builder" utility to
generate particular
trees at runtime that include the desired branches - have a look
at the ValueTreeBuilder
class attached if you are interested (its not used by any of the
Middlegen related
code).
Example of invocation in build.xml
----------------------------------
<nrmacmp20
destination="${build.gen-src.dir}"
package="${packageRoot}.entities"
detailsObjectPackage="${packageRoot}.values"
valueObjectPackage="${packageRoot}.entities"
interfacepackage="${packageRoot}.entities"
jndiprefix="${jndiRoot}"
pkclass="false"
dataobject="true"
datasuffix="Details"
viewtype="local"
mergedir="${basedir}/src/middlegen"
readonly="false"
fkcmp="false"
guid="true">
<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>
<jboss/>
</nrmacmp20>
Hope that helps anyone wanting to generate full Value objects.
Cheers,
Gavin.
-----Original Message-----
Sent: Wednesday, 6 November 2002 6:45 PM
To: Gavin Hughes
Subject: RE: [Middlegen-user] Value Objects and Middlegen
http://sourceforge.net/tracker/index.php?func=detail&aid=634285&gr
oup_id=36044&atid=415993
.eivind
Post by Gavin Hughes
We've done a quick hack to get Middlegen to generate Value objects
instead of Data objects (or to ask XDoclet to anyway).
The change is a minor modification to the entity CMP template
(entity-cmp-20.vm in the middlegen-entitybean-plugin-2.0-b2-dev.jar
file in lib).
You can do this by modifying the original template or by copying it
and modifying the appropriate section, then overriding the original
template with your modified version. This is done by adding a
<fileproducer> element within the <cmp20> element in your build.xml
<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>
be changed to the following (use your own Value object base class in
#if( ${plugin.dataobject} )
* extends="com.nrma.values.BaseValue"
* match="*"
* instantiation="eager"
*
#end
Obviously it would be better to have a different parameter specifying
that value objects are generated (ie. $(plugin.valueobject)) so that
you can choose one or the other. This would need some changes to one
of the CMP plugin classes I think - I've got no idea which one I'm
afraid...
Cheers,
Gavin.
-----Original Message-----
Sent: Wednesday, 6 November 2002 7:59 AM
Subject: RE: [Middlegen-user] Value Objects and Middlegen
-----Original Message-----
Brian
Cochran
Sent: 5. november 2002 05:28
Subject: [Middlegen-user] Value Objects and Middlegen
Hey Aslak,
I noticed you were one of the primary contributors on Value
Objects
in
Nonono. I have never really looked into them or tried them. -Just
applied some patches.
XDoclet. Is that as simple as I think it is as far as integrating it
into middlegen? (Drop it into the template entitiy-cmp20.vm template.
Moreover, where could I find something about the idea behind Value
Objects. (i.e what do they offer, and how do you use them, etc.)
Thanks a bunch.
It would be great if you would do us the favour to add value-object
support in middlegen. Send a diff/patch when you're done. Value object
is badly documented, so be prepared to dig into XDoclet's mail
archives and sources.
Thanks a bunch,
Brian
Cheers,
Aslak
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in Las
Vegas (supported by COMDEX), the only Apache event to be fully
supported by the ASF. http://www.apachecon.com
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Gavin Hughes
2002-11-08 03:12:03 UTC
Permalink
OK - will do - just found one little bug which I'll remove first...

Cheers,
Gavin.

-----Original Message-----
From: Aslak Hellesøy [mailto:***@netcom.no]
Sent: Friday, 8 November 2002 11:45 AM
To: Gavin Hughes; middlegen-***@lists.sourceforge.net
Cc: Shaun Kelly
Subject: RE: [Middlegen-user] Value Objects and Middlegen


Hi Gavin,

We really appreciate your contribution! -But contribution on email will evaporise in our hot mail boxes. Could you please repost your code/explanation as a patch on SF?

http://sourceforge.net/tracker/?group_id=36044&atid=415992

Cheers,
Aslak
-----Original Message-----
Hughes
Sent: 8. november 2002 01:12
Cc: Shaun Kelly
Subject: RE: [Middlegen-user] Value Objects and Middlegen
We've been doing a bit more work on this here - if any of this is
useful and someone wants to include it into Middlegen then feel free
to use whichever bits you like - the code is still a bit ugly in
places I'm afraid.
The change I mentioned in the original message generates Value objects
that only contain the CMP fields (which means they aren't that
different to data objects).
We've done some further modifications now that include CMR fields in
the value objects as well.
The changes are larger than the previous set, and involve the
- nrma-entity-cmp-20.vm - CMP template file (derived from
entity-cmp-20.vm)
- NrmaEntityPlugin.java - CMP plugin (extends the CMP20 plugin)
- NrmaEntityTable - (extends Entity20Table)
- nrma-details-object.vm - template file for Details objects
Plugin
------
The Plugin class uses a few new parameters that are specified when it
valueObjectPackage specifies the package that Value objects are to
be placed in
detailsObjectPackage specifies the package that Details objects are
placed in
There should be a parameter to specify the Value object base class as
well (currently its hard coded into the CMP template).
The Plugin class specifies that NrmaEntityTable represents the table
data passed to the velocity templates - this Table class contains a
number of new methods that
let us get various names required for specifying the Value object
to be generated
in the template.
The Plugin class generates "Details" objects that are simple wrappers
for Value objects. We use these for debugging - the toString method is
edited to print out
whatever information we think is necessary - including CMR
information, which the
XDoclet generated Value object doesn't do. These are generated in
the same directory
as the Bean classes, which isn't so good if the package specified
for them is not
the same as the bean package - haven't found a way around this
yet. They aren't used
by any of the generated code so you can ignore them if you wish.
Value object changes to the template
------------------------------------
Look at the template file for all the value object changes - XDoclet
@ejb.value-object tags are now included on all CMP and CMR fields.
One "match" value named "all" is used for all fields - this results in
a single Value object being generated for each Bean that contains all
the fields and
relationships on the Bean.
The pattern followed is a little different in intent to what seems to
be the standard XDoclet mechanism of defining particular Value object
trees (each with
its own "match" name) for different scenarios.
As there is no simple way of defining these, one Value object class is
much easier to generate. In any case, I find the standard mechanism
very unwieldy
for complex trees - instead I use a "tree builder" utility to
generate particular
trees at runtime that include the desired branches - have a look
at the ValueTreeBuilder
class attached if you are interested (its not used by any of the
Middlegen related
code).
Example of invocation in build.xml
----------------------------------
<nrmacmp20
destination="${build.gen-src.dir}"
package="${packageRoot}.entities"
detailsObjectPackage="${packageRoot}.values"
valueObjectPackage="${packageRoot}.entities"
interfacepackage="${packageRoot}.entities"
jndiprefix="${jndiRoot}"
pkclass="false"
dataobject="true"
datasuffix="Details"
viewtype="local"
mergedir="${basedir}/src/middlegen"
readonly="false"
fkcmp="false"
guid="true">
<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>
<jboss/>
</nrmacmp20>
Hope that helps anyone wanting to generate full Value objects.
Cheers,
Gavin.
-----Original Message-----
Sent: Wednesday, 6 November 2002 6:45 PM
To: Gavin Hughes
Subject: RE: [Middlegen-user] Value Objects and Middlegen
http://sourceforge.net/tracker/index.php?func=detail&aid=634285&gr
oup_id=36044&atid=415993
.eivind
Post by Gavin Hughes
We've done a quick hack to get Middlegen to generate Value objects
instead of Data objects (or to ask XDoclet to anyway).
The change is a minor modification to the entity CMP template
(entity-cmp-20.vm in the middlegen-entitybean-plugin-2.0-b2-dev.jar
file in lib).
You can do this by modifying the original template or by copying it
and modifying the appropriate section, then overriding the original
template with your modified version. This is done by adding a
<fileproducer> element within the <cmp20> element in your build.xml
<fileproducer
id="entity-cmp-20"
template="${basedir}/src/templates/nrma-entity-cmp-20.vm"
/>
be changed to the following (use your own Value object base class in
#if( ${plugin.dataobject} )
* extends="com.nrma.values.BaseValue"
* match="*"
* instantiation="eager"
*
#end
Obviously it would be better to have a different parameter
specifying that value objects are generated (ie.
$(plugin.valueobject)) so that you can choose one or the other. This
would need some changes to one of the CMP plugin classes I think -
I've got no idea which one I'm afraid...
Cheers,
Gavin.
-----Original Message-----
Sent: Wednesday, 6 November 2002 7:59 AM
Subject: RE: [Middlegen-user] Value Objects and Middlegen
-----Original Message-----
Brian Cochran
Sent: 5. november 2002 05:28
Subject: [Middlegen-user] Value Objects and Middlegen
Hey Aslak,
I noticed you were one of the primary contributors on Value
Objects in
Nonono. I have never really looked into them or tried them. -Just
applied some patches.
XDoclet. Is that as simple as I think it is as far as integrating
it into middlegen? (Drop it into the template entitiy-cmp20.vm
template. Moreover, where could I find something about the idea
behind Value Objects. (i.e what do they offer, and how do you use
them, etc.) Thanks a bunch.
It would be great if you would do us the favour to add value-object
support in middlegen. Send a diff/patch when you're done. Value
object is badly documented, so be prepared to dig into XDoclet's
mail archives and sources.
Thanks a bunch,
Brian
Cheers,
Aslak
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be fully
supported by the ASF. http://www.apachecon.com
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...