Hi,

I am surpised that OrderItem.setOrder_orderId gives an error. Could you please provide the stack trace (the TranQL part + the first OpenEJB element) along with the DDs?

FWIW, there are a couple of integration tests for CMP and CMR overlap scenarios in the OpenEJB tree:
sub-project: modules/itests
test class: org.openejb.test.entity.cmp2.cmrmapping.CMRMappingFacadeBean
DDs:  src/cmp2/cmrmapping

Thanks,
Gianny

Manu George wrote:

Hi,

I have two CMPs with a 1:n relationship.
CMP1 -  Order - PK = OrderPK which has a single field orderId
CMP2 - OrderItem = OrderItemPk which has 2 fields InventoryId and order_orderId

OrderId and order_orderId are mapped
When i do a setOrder_orderId in the ejbCreate of OrderItem geronimo gives an error during runtime saying cannot set read only field.

When i don't set it geronimo says partial null key . In this case I set the cmr field in the ejbPostCreate method

 org.tranql.identity.UndefinedIdentityException: Partial null key
at org.tranql.identity.DerivedIdentity.defineIdentity(DerivedIdentity.java:80) at org.openejb.entity.cmp.CMPCreateMethod.execute(CMPCreateMethod.java:175) at org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java:72) at org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(ComponentContextInterceptor.java:56) at org.openejb.ConnectionTrackingInterceptor.invoke(ConnectionTrackingInterceptor.java:81) at org.openejb.entity.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:136) at org.openejb.entity.cmp.InTxCacheInterceptor.invoke(InTxCacheInterceptor.java:90) at org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolicy.java:119)

Am I doing anything wrong here?

Regards
Manu



Reply via email to