cmr with jboss problem

D

dcp

Has anybody been able to get a CMR one to many unidirectional
relationship working with jboss? I'm trying to get it to work but keep
getting "foreign key constraint not allowed for this type of data
store".

The relationship is simple, I have two entity beans, person and
company and I want to have one to many unidirectional relationship
between these two beans. A person has one company, but a company has
many persons.

I want to have a company_id field in my person table that refers to
the id field in my company table. Maybe I'm missing something or doing
this wrong?

If somebody could post a working example of one to many unidirectional
I'd be mighty grateful. I'm trying to use the foreign-key-mapping
rather than relation-table, can you do this with foreign-key-mapping?

Here's what I have:

/**
* @return the company the person belongs to
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="COMPANY_ID"
* sql-type="integer"
* jdbc-type="integer"
*
* @ejb.interface-method
*
* @ejb.relation
* name="Person-Company"
* role-name="Person-belongs-to-Company"
* target-ejb="Company"
* target-role-name="Company-has-many-Persons"
* target-multiple="yes"
*
* @jboss.relation
* fk-constraint="true"
* fk-column="COMPANY_ID"
* related-pk-field="id"
*
*/
public abstract CompanyLocal getCompany();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top