Discussion:
[Middlegen-user] whats the status of internally generated pks.
Brian Cochran
2002-08-23 17:51:03 UTC
Permalink
Hey all,


@todo generate create methods which don't take pk as arg (and use an
arbitrary pk generator internally)

I found this in the generated stuff and was wondering if anybody was
working on it. I can if nobody else is. What would the method signature look
like? Would we just use a Data object with the values for primary key fields
blank? Or do we need a new signature. Also, the ability to add import
statements to the generated bean would be great. A new mergepoint for
middlegen?

Thanks again and great job,

Brian
Aslak Hellesøy
2002-08-23 18:17:03 UTC
Permalink
-----Original Message-----
Cochran
Sent: 23. august 2002 21:51
Subject: [Middlegen-user] whats the status of internally generated pks.
Hey all,
@todo generate create methods which don't take pk as arg (and use an
arbitrary pk generator internally)
I found this in the generated stuff and was wondering if anybody was
working on it. I can if nobody else is. What would the method
If you're on WLS you can take advantage of WLS' aotomatik pk generation.
Care to elaborate on how it works Eivind?
What are we supposed to pass as parameters to ejbCreate when using this
feature?
signature look
like? Would we just use a Data object with the values for primary
Data objects are bad. They don't support relations. The best would be to
generate an additional ejbCreate method that takes the same list of
parameters, but without the parameters corresponding to pk columns.

If you want to give it a go, please take a look at some of the pk generation
patterns in floyd marinescu's EJB patterns book.
What I'd like to see is a template that can generate the classes he
describes in his patterns.
key fields
blank? Or do we need a new signature. Also, the ability to add import
statements to the generated bean would be great. A new mergepoint for
Make an FR please.
middlegen?
Thanks again and great job,
Brian
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Kyle F. Downey
2002-08-23 20:51:03 UTC
Permalink
Post by Aslak Hellesøy
If you want to give it a go, please take a look at some of the pk
generation patterns in floyd marinescu's EJB patterns book.
What I'd like to see is a template that can generate the classes he
describes in his patterns.
btw, I'm working on implementing the PK generation pattern ("sequence
blocks")--using Middlegen!--as part of the next release of San Jacinto
(http://www.amberarcher.org).
--kd
Aslak Hellesøy
2002-08-23 21:11:02 UTC
Permalink
How sweet. I just committed a new logo you can use if you like:
middlegen/xdocs/images/powered_by_middlegen.gif

I'll add a new "Powered By" section in the docs where you can live :-D
-And I'll take a closer look at all the nice stuff at Amber Archer!

I invite you to continue the discussion about this PK generation stuff on
middlegen-devel. There are some tricky issues we should sort out:

-How to deal with composite PKs
-How to deal with PKs where some of the colums are als FKs (As in
Middlegen's reservation table in the airline sample)
-How to deal with PK columns of various types (some patterns, like GUID
assume a certain type)
-Etc.

Aslak
-----Original Message-----
Sent: 24. august 2002 00:51
Subject: RE: [Middlegen-user] whats the status of internally generated
pks.
Post by Aslak Hellesøy
If you want to give it a go, please take a look at some of the pk
generation patterns in floyd marinescu's EJB patterns book.
What I'd like to see is a template that can generate the classes he
describes in his patterns.
btw, I'm working on implementing the PK generation pattern ("sequence
blocks")--using Middlegen!--as part of the next release of San Jacinto
(http://www.amberarcher.org).
--kd
Eivind Waaler
2002-08-24 11:38:01 UTC
Permalink
Hey, the WLS automatic pk generation can be used as follows:

The weblogic subtask of the cmp20 task has two properties:

<weblogic pkgen=3D"true" vendorseq=3D"false"/>

Pkgen is just a flag denoting use of auto-pk-generation or not. Weblogic
supports basically two kinds, named sequence tables (works for any db) and
vendor specific sequences (works for Oracle, MSSQL, maybe more?). If the
vendorseq flag is false we will use named sequence tables no matter what
db is being used.

For everything but MS SQL sequences we need to specify a pktable in the
<table> elements. This is the name of the named sequence table, or the
actual name of the sequence in Oracle. The pkcachesize kan also be given,
this tells weblogic how many keys to reserve in each lookup.

Using these container generated pk's is pretty straightforward. Whatever
you pass in as parameter for the PK in the create method is being ignored,
beware of this and make sure to read out the pk after calling create if
you need it.

Some examples:

1. Generate persons with named sequence table:

<table name=3D"persons" pktable=3D"personsSeq"/>
=2E..
<cmp20
=2E..
<weblogic pkgen=3D"true" vendorseq=3D"false"/>
=2E..

The sequence table must have one column with one entry..

2. Generate persons with MS SQL sequence (db type is detected by
middlegen):

=2E..
<weblogic pkgen=3D"true" vendorseq=3D"true"/>
=2E..

Please let us know how this works out.

If anyone can come up with a good way to implement a more general pattern
not being dependant on specific servers that would be cool.

=2Eeivind
Post by Aslak Hellesøy
=20
=20
-----Original Message-----
Cochran
Sent: 23. august 2002 21:51
Subject: [Middlegen-user] whats the status of internally generated pks.
Hey all,
@todo generate create methods which don't take pk as arg (and use an
arbitrary pk generator internally)
=09I found this in the generated stuff and was wondering if anybody was
working on it. I can if nobody else is. What would the method
=20
If you're on WLS you can take advantage of WLS' aotomatik pk generation.
Care to elaborate on how it works Eivind?
What are we supposed to pass as parameters to ejbCreate when using this
feature?
=20
signature look
like? Would we just use a Data object with the values for primary
=20
Data objects are bad. They don't support relations. The best would be to
generate an additional ejbCreate method that takes the same list of
parameters, but without the parameters corresponding to pk columns.
=20
If you want to give it a go, please take a look at some of the pk generat=
ion
Post by Aslak Hellesøy
patterns in floyd marinescu's EJB patterns book.
What I'd like to see is a template that can generate the classes he
describes in his patterns.
=20
key fields
blank? Or do we need a new signature. Also, the ability to add import
statements to the generated bean would be great. A new mergepoint for
=20
Make an FR please.
=20
middlegen?
Thanks again and great job,
Brian
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=3Dsourceforge1&refcode1=3Dvs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
=20
=20
=20
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=3Dsourceforge1&refcode1=3Dvs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
=20
Loading...