Thanks,
I want to use a beans who maps a table on a relational db which haS a
primary key composed by two colomns of this table, or eventually a column of
this table and a column which is a foreign key which point on another table.
This is may little problem; I don't understand if with JAWS I may do this,
or I has to use a BMP.
Thanks for any suggestion.
Andrea
-----Messaggio originale-----
Da: Georg Rehfeld [mailto:[EMAIL PROTECTED]]
Inviato: Tuesday, May 22, 2001 3:40 AM
A: [EMAIL PROTECTED]
Oggetto: Re: [JBoss-user] multiple key
Hi Andrea,
> question:There is a way to map a primary key over multiple
> tables in a db?
I'm not quite sure, what you mean:
- having the same primary key _column_ name/type in different
tables? This is definitely allowed in SQL.
- using the same primary key _class_ in different beans?
This is allowed, see EJB spec 1.1 section 8.5 and illustratet
by the fact, that i.e. java.lang.Integer is a valid primary
key class.
- having one bean stored 'horizontally' splittet over several
tables, which share the primary key (i.e. so, that heavily used
fields/columns are stored in a fast DB and others in a slower
(remote) one)? I don't think, you can do this currently with
JBoss CMP (using JAWS), but I may be wrong (we use BMP here).
Others may correct this statement. With BMP you can do this
split easily, and in ejbLoad either join the data together
to fetch them in just one JDBC call, or only load the important
fields from the fast DB lazily loading the rest from the slow
DB in the apropriate business methods.
- having one bean stored in different tables 'vertically' i.e.
depending on some type field (so as to store old data into
a DB on a cheap slow server with high data capacity and actual
data into a DB on an expensive fast server with limited data
capacity)? Again I believe, this is currently impossible with
JAWS CMP. And again, you may easily do that with BMP, if you
have your tables in one DB you might use the SQL UNION syntax
to access all tables with only one SQL statement in ejbLoad,
or query all tables until you've found your row back (if you
can't decide from the primary key, where to search for the data).
If I misunderstood you completely, please clarify.
regards
Georg
___ ___
| + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg
|_|_\ |___ [EMAIL PROTECTED] +49 (40) 23 53 27 10
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user