> The following issues apply to foreign-key-mapping ..
> 
> 
> 1) problems with unidirectional relations:
> 
> deployment does not work, because the 
> JDBCCMRFieldBridge.initRelatedData 
> does not find the related cmrField -> throws DeploymentException

I just fixed a bug in this code last night, where the self-relationships
would not initialize properly. Try the newest code.
 
> 2) problems with "not null" constraints on foreign keys:
> 
> the JDBCCreateEntityCommand builds an insert statement with 
> the cmp fields 
> but without the cmr fields .. as far as I know, createEntity 
> is the only 
> affected command

I don't think this is correct.  Are you trying to create an EJB that has a
foreign key relationship to another bean that is guaranteed not be null.
The only way I can think of to do this is to set the cmr fiend in the
ejbCreate method, which would give the fk a value during the initial sql
insert statement.  Unfortunately, it is not legal to set a cmr field during
the ejbCreate method; You have to wait until ejbPostCreate. Did I
misinterpret you?
 
> 3) problems with <foreign-key-fields> in jbosscmp:
> 
> the <field-name>s are searched for in the related entity during
> JDBCRelationshipRoleMetaData.loadForeignKeyFields but it 
> seems to be also 
> used as the name of the cmr field's foreign key.

Ok, I'm a little lost. I don't remember how the default name for a fk is
constructed, but I remember basing it on related object's pk field name.  I
will add some documentation how all the default name are created.
 
> I assume, the specified name should be that of the foreign 
> key, rather 
> than that of the related primary key ..

Specified where?
 
> It could also mean, that I should have specified the opposite 
> relation 
> ship role in the jbosscmp descriptor .. but this might have no 
> <ejb-relationship-role-name>, if the relationship is unidirectional!

I don't know. Can you post the important parts of the ejb-jar and
jbosscmp-jdbc files?

-dain

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to