[EMAIL PROTECTED] wrote: > Well, I have tried it a couple of ways. But currently, for > the issue listed, here is what I did (Before any Entities are > created at all):
Is your container generating PKs or are you? No. My CreditApplication gets one set in the DTO constructor, then I do this in the ejbCreate: setApplicationId( pCreditApplicationDto.getPrimaryKey() ); The rest of the Entities get the PK set at creation time like: setProductPK( BusinessCardUtil.generateGUID(pBusinessCardDto) ); > 1. I create a blank CreditApplicationLocal with the > CreditApplicationDto.getAppId. I did this because I kept > getting "PrimaryKey Not Found" errors when trying to create > the CreditApplicationLocal with a CreditApplicationDto that > contained other items that where not already created. :-( Are you making a copy of the CreditApplicationDto and calling CreditApplicationHome.create(dto) with that copy? Or are you using some other non-DTO create method with the values taken from the DTO? Yes, I create a new CreditApplicatonDto and populate it with just the core data in the CreditApplication. No other objects. I did try it originally by creating the CreditApplication with the original CreditApplicationDto, but have been desperately trying to hack anything in to get this to work. > 2. I take the structure I was sent: > creditAppDto with AppId (with AppId) >> --> BusinessCard (no AppId, no ID) >> -->BusinessLine (no AppId, no ID) >> -->SecuredCard (no AppId, no ID) > > 2b. Create BusinessCard Entity from the > CreditApplicationDto.getBusinessCardDto() method. > 2c. do a creditApplicationLocal.setBusinessCard( businessCardLocal); At this point, businessCardLocal.getCreditApplication() returns the CA created above? No, all of my relationships are unidirectional. So i only have CMR declarations in the CreditApplicationBean. > 3b. Create BusinessLine Entity from the > CreditApplicationDto.getBusinessLineDto() method. > 3c. do a creditApplicationLocal.setBusinessLine( businessLineLocal); Similarly, businessLineLocal.getCA() returns the CA, but now businessCardLocal.getCA() returns null? > 4b. Create SecuredCard Entity from the > CreditApplicationDto.getSecuredCardDto() method. > 4c. do a creditApplicationLocal.setSecuredCard( securedCardLocal); > > If I skip 2, 3, or 4, the last one that I added to the > CreditApplicationLocal get the [Product].appId set. The others do not. So each time a new entity bean is attached to the CA, the old ones are detached? It sounds like all three relations are actually being considered the same 1:1 relation. For example, let's say you had User <-- 1:1 --> Address If you do the following: UserLocal user = userHome.create(...); AddressLocal home = addressHome.create(...); AddressLocal work = addressHome.create(...); user.setAddress(home); At this point, home.getUser() returns the user. Now user.setAddress(work); Now home.getUser() returns null. True, it seems you have different relations, but this is what the behavior sounds like. Is it definitely the *entity beans* that are having their appID blown away? So it's not really related to the value objects, right? Truly bizarre. Can you post the relation tags on both sides (CA and the cards/lines)? I am posting the relationship for 1 product as they are all identical, I have checked many times. But, there is no way for me to create a BusinessCard with an AppId. I added it once, and got aCMR error. So I had to let the CMR manage the AppId. /** * Get BusinessCard product for this CreditApplication. * This is a one (CreditApplication) to one (BusinessCard) relationship. * We can get a BusinessCardDto in the creditApplicationDto.getBusinessCard() method. * We can also setBusinessCard( pBusinessCard ) * * @ejb.interface-method view-type="local" * * @ejb.value-object * compose="com.wf.bd.ice.product.BusinessCardDto" * compose-name="BusinessCardDto" * members="com.wf.bd.ice.product.BusinessCardLocal" * members-name="BusinessCard" * relation="external" * * @ejb.relation * name="CreditApplication-BusinessCard" * role-name="CreditApplication-has-BusinessCard" * target-ejb="BusinessCard" * target-role-name="BusinessCard-belongs_to-CreditApplication" * target-cascade-delete="yes" * * @weblogic.target-column-map * foreign-key-column="applicationId" * key-column="applicationId" */ Your help is much appreciated! David Harkness Sr. Software Engineer Sony Pictures Digital Networks (310) 482-4756 ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user