Discussion:
[Middlegen-user] exclude PK attributes from ejbCreate signature
D***@cexp.com
2003-09-29 20:25:05 UTC
Permalink
Our developers are asking to exclude the PK columns from the ejbCreate
method call signature.

I noticed the FlightBean.java in the samples accomplished this.

How can I configure middlegen to work like this?

TIA,

Don Shade
Eivind Waaler
2003-09-30 04:49:04 UTC
Permalink
You have to make Middlegen generate the PKs. In the samples this is done
using the <sequenceblock..> tags.

Some other ways to do it are explained here:
http://boss.bekk.no/boss/middlegen/plugins/cmp20.html

For beans with composite PK, for example the ReservationBean in the
samples, the FK parts of the PK must still be passed in..

.eivind
Post by D***@cexp.com
Our developers are asking to exclude the PK columns from the ejbCreate
method call signature.
I noticed the FlightBean.java in the samples accomplished this.
How can I configure middlegen to work like this?
TIA,
Don Shade
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Rod Macpherson
2003-10-01 00:07:09 UTC
Permalink
In our case we wanted to exclude everything from ejbCreate and pass in
our own data model. We create the model using the middlegen <java> file
producer. So if we have a table FOO we have a model Foo and an
ejbCreate( Foo foo ) method in the EJB. Grab this script as a starting
point:

.../plugins/entitybean/src/middlegen/plugins/entitybean/entity-cmp-20.vm

Now squirrel that away in some folder and reference it in your ant
script:

<cmp20 ... >
<fileproducer id="entity-cmp-20"
template="custom-scripts/my-entity-cmp-20.vm"/>
<jboss/>
<weblogic/>
</cmp20>


The result will be unchanged but now you can start editing
my-entity-cmp-20.vm to suit your own needs such as controlling the
generation of ejbCreate. All you have to do is follow velocity script
rules and use whatever collections and objects middlgen dumped in the
velocity context. In our case we actually add a bunch more but that
requires source code changes, still pretty easy however.

-----Original Message-----
From: ***@cexp.com [mailto:***@cexp.com]
Sent: Monday, September 29, 2003 3:24 PM
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] exclude PK attributes from ejbCreate signature



Our developers are asking to exclude the PK columns from the ejbCreate
method call signature.

I noticed the FlightBean.java in the samples accomplished this.

How can I configure middlegen to work like this?

TIA,

Don Shade



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Loading...