Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMR

 
Monmohan Singh
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an EnityBean say Customer with primary key as CustID
I have another EntityBean Address as primary key, a composite with AddressID and CustID
Also, CustID in Address table is the foriegn key for Customer table
Will it create any problem in CMR , one to may from customer to address
Since, the same column in Address table , i.e CustID is used as a part of primary key as well as forign key to Customer table.
Since the conatiner will try to update the table two times , once at the time of creation of a row in Address table and another time when I am setting the CMR in Customer Table
Pl help
 
deepak yadav
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I faced similar situation. CMR fields are updated in postCreate() but if the CMR field also happens to be a primary key then you have to set it in the create() directly (by using setCustomerId(..)) i.e. the setter method of that CMR field (setCustomerProfile(CustomerLocal ..)) is never used and the getter method would fine.
-deepak
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic