{
// the primary contact was changed. so ...
try
{
// set the old guy to not be the primary contact
IndividualLocal oldIndividualEntityBean = ih.findByPrimaryKey(new IndividualPK(oldIndividualVO.getContactID(), this.dataSource));
oldIndividualVO.setIsPrimaryContact("NO");
oldIndividualEntityBean.setIndividualVO(oldIndividualVO);
} catch (FinderException fe) {
logger.info("[changePrimaryContact] old primary contact: "+oldIndividualVO.getContactID()+", not found.");
}
// set the the new one to be the primary contact
IndividualLocal newIndividualEntityBean = ih.findByPrimaryKey(new IndividualPK(newIndividualVO.getContactID(), this.dataSource));
newIndividualVO.setIsPrimaryContact("YES");
newIndividualEntityBean.setIndividualVO(newIndividualVO);
} else {
// The selected primary contact is the same as the previous primary contact, just
// need to set it as primary.
IndividualLocal individualEntityBean = ih.findByPrimaryKey(new IndividualPK(newIndividualVO.getContactID(), this.dataSource));
newIndividualVO.setIsPrimaryContact("YES");
individualEntityBean.setIndividualVO(newIndividualVO);
}
} catch(Exception e) {
logger.error("[changePrimaryContact] Exception thrown.", e);