On entity bean primary keys...

no matter if you're talking about entity beans or relational databases in
general it is always a good idea to use primary keys without business
meaning. You might run into a problem later if your PK embodies a business
concept and this concept changes later in the lifecycle of your software
product. So using a PK that does not have any business meaning whatsover is
generally considered a good idea in software development. Using autonumber
fields is generally a convenience issue as most DB's support this directly
and it's also easy to implement yourself if you want to remain db
independent.

Apart, requirements might be that you're PK is globally unique. This is the
case in my situation and that's why I'm using the UUID for EJB pattern which
generates a 32-bit PK w/o database which is unique across space and time
(see www.theserverside.com, Patterns section rsp. EJB Design Patterns book)
for more info.

cu,
Bernie


-----Ursprungliche Nachricht-----
Von: Ingo Bruell [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 29. April 2002 10:33
An: [EMAIL PROTECTED]
Betreff: Re[2]: [Xdoclet-user] value-objects wrong PK usage


Hi,

oops, my reply was going directly to Marius.

MK> Alex Loubyansky wrote:

>>  What do you mean "complex PKs don't work very well with jboss3.x now"?
>>
MK> http://main.jboss.org/forums/thread.jsp?forum=46&thread=9931

MK> So i stopped using it. I don't know if it is just the table-creating 
MK> problem.

I read your article and it sounds that jboss has only problems to
create the foreign key constraints, right ?

I am not using foreign keys in the db yet, so i have not this problem.

But i wonder why most the time autonumber fields are used as pk. Could
someone explane (it should be OT but i am interested in)

so long


Ingo Bruell

---
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<ICQ# 40377720>
Oldenburg    PGP-Fingerprint: CB01 AE12 B359 87C4 BF1C  953C 8FE7 C648 169E
E5FC
Germany      PGP-Public-Key available at pgpkeys.mit.edu



_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to