/**
   * This method update a user details
   *
   * @param EntityManager entityManager
   * @param userDetailBO userDetailBO
   * @return true ;
   */
  public boolean updateUser(EntityManager entityManager, UserDetailBO userDetailBO) {
    final String METHOD_NAME = "updateUser(EntityManager entityManager, UserDetailBO userDetailBO)";
    logger.entering(CLASS_NAME, METHOD_NAME);

    UserTable userTable = UserObjectPreparationHelper.convertUserDetailBOToUserEntity(userDetailBO);

    UpdateUserTask.process(entityManager, userTable);
    logger.exiting(CLASS_NAME, METHOD_NAME);
    return true;
  }
  /**
   * This method creates a user
   *
   * @param EntityManager entityManager
   * @param userDetailBO userDetailBO
   * @param ScreenResponseMessageBO messages
   * @return boolean isProcessSuccess;
   */
  public boolean createUser(EntityManager entityManager, UserDetailBO userDetailBO) {
    final String METHOD_NAME =
        "createUser(EntityManager entityManager, UserDetailBO userDetailBO, ScreenResponseMessageBO messages)";
    logger.entering(CLASS_NAME, METHOD_NAME);

    boolean isProcessSuccess = false;
    UserTable userTable = UserObjectPreparationHelper.convertUserDetailBOToUserEntity(userDetailBO);
    boolean flag = false;
    flag = CheckIfUserExistsTask.process(entityManager, userDetailBO.getUserEmailId());
    if (flag == true) {
      logger.debug("Duplicate user creation");
    } else {
      CreateUserTask.process(entityManager, userTable);
      isProcessSuccess = true;
    }
    logger.exiting(CLASS_NAME, METHOD_NAME);
    return isProcessSuccess;
  }