Example #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.openiam.idm.srvc.user.service.UserDataService#addPhone(org.openiam
   * .idm.srvc.continfo.dto.Phone)
   */
  @Transactional
  public Phone addPhone(Phone val) {
    if (val == null) throw new NullPointerException("val is null");

    if (StringUtils.isEmpty(val.getParentId()))
      throw new NullPointerException("parentId for the address is not defined.");

    val.setParentType(ContactConstants.PARENT_TYPE_USER);
    PhoneEntity phoneEntity = phoneDao.add(phoneDozerConverter.convertToEntity(val, true));
    return phoneDozerConverter.convertToDTO(phoneEntity, true);
  }