* @return boolean status of operation
*/
public boolean updateIndividuals(ArrayList IVOs,int indID)
{
IndividualVO ivo = null;
ContactFacadeLocal indL = null;
ContactHelperLocal contacthelperL = null;
try
{
InitialContext ic = CVUtility.getInitialContext();
ContactFacadeLocalHome home = (ContactFacadeLocalHome)ic.lookup("local/ContactFacade");
indL = home.create();
indL.setDataSource(this.dataSource);
int size = IVOs.size();
ContactHelperLocalHome homeHelper = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
contacthelperL = homeHelper.create();
contacthelperL.setDataSource(this.dataSource);
for ( int i=0;i<size;i++)
{
ivo = (IndividualVO) IVOs.get(i);
ivo.setContactID(ivo.getIndividualID());
AddressVO adrVO = contacthelperL.getPrimaryAddressForContact(indID, ivo.getIndividualID(), ivo.getContactType());
ivo.getPrimaryAddress().setAddressID(adrVO.getAddressID());
Collection col = contacthelperL.getPrimaryMOCForContact(indID, ivo.getContactID(), ivo.getContactType());
Iterator it = col.iterator();
Vector vec = ivo.getMOC();
int vecsize = vec.size();
while (it.hasNext()){
MethodOfContactVO moc = (MethodOfContactVO)it.next();
for (int j = 0; j < vecsize; j++){
if(moc.getMocType() == ((MethodOfContactVO) vec.elementAt(j)).getMocType()){
((MethodOfContactVO) vec.elementAt(j)).setMocID(moc.getMocID());
((MethodOfContactVO) vec.elementAt(j)).added(false);
((MethodOfContactVO) vec.elementAt(j)).updated(true);
break;
}
}
}
indL.updateIndividual(ivo,indID);
logger.info("Updated " + ivo.getIndividualID() + " Individual record");
}
}catch(Exception e)
{
logger.debug("Error in updating Individual : "+e);