a question about Pk and Fk?

Hi,everyone ,please help me! Now I am writing a CMP bean in EJB2.0,and I must define a PK class,but I find there is a column is a foreign key and this column must be included in primary key?How can i deal with it? help please
[261 byte] By [primeton] at [2007-9-26 1:15:10]
# 1
I think you need not put foreign key in yor primary key class, just primary key is enough.EJB Container just use primary key to identify the EntityBean reflecting a row in your table, so your primary key is enough to decide which to use.
sujianqiang at 2007-6-29 0:41:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi,

I think you'll have to define it as any other field in the PK class. The only thing you've got to do afterwards is define in the ejb relationships (in the deploytool) that this field is mapped to a field in another ejb. In section 11.3.5 of the ejb 2.0 specs you'll find an example of how this is handled through the ejb QL.

Regards,

Kurt.

leukbr at 2007-6-29 0:41:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Why do you say that you must include the FK in your PK. What is the context? Raphael Parree
RaphaelP at 2007-6-29 0:41:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...