public OperationStatus assignYdkRole(Long ydkRoleId, Long id) {
    // TODO Auto-generated method stub
    OperationStatus os = new OperationStatus();
    if (id == null || ydkRoleId == null) {
      os.setIsSuccessful(false);
      os.setFailureReason("Null input");
      return os;
    }
    YdkAccount ydkAccount = accountDbMngr.getYdkAccount(id);
    if (ydkAccount == null) {
      os.setIsSuccessful(false);
      os.setFailureReason("Could not find YdkAccount by id : " + id);
      return os;
    }

    YdkRole ydkRole = accountDbMngr.getYdkRole(id);
    if (ydkRole == null) {
      os.setIsSuccessful(false);
      os.setFailureReason("Could not find YdkRole by id : " + ydkRoleId);
      return os;
    }

    ydkAccount.setYdkRole(ydkRole);
    accountDbMngr.updateYdkAccount(ydkAccount);
    return os;
  }
 public WebYdkAccountListResult findYdkAccounts(String name, WebServiceListParams listRarams) {
   // TODO Auto-generated method stub
   List<YdkAccount> list = (List<YdkAccount>) accountDbMngr.findAllYdkAccounts(name);
   for (YdkAccount a : list) {
     a.getYdkRole().getMask();
     a.getYdkRole().setYdkAccounts(null);
   }
   return getSpecifiedPageList(list, listRarams, new WebYdkAccountListResult());
 }
  public WebYdkAccountListResult getAllYdkAccounts() {
    // TODO Auto-generated method stub
    WebYdkAccountListResult result = new WebYdkAccountListResult();

    result.setYdkAccounts((List) accountDbMngr.getAllYdkAccounts());
    result.setCurrentPage(1);
    result.setTotalItems(result.getYdkAccounts().size());
    result.setTotalPages(1);
    for (YdkAccount a : result.getYdkAccounts()) {
      a.getYdkRole().getMask();
      a.getYdkRole().setYdkAccounts(null);
    }
    return result;
  }
  public OperationStatus deactiveYdkAccount(Long id) {
    // TODO Auto-generated method stub
    OperationStatus os = new OperationStatus();
    YdkAccount ydkAccount = accountDbMngr.getYdkAccount(id);

    if (ydkAccount == null) {
      os.setIsSuccessful(false);
      os.setFailureReason("Could not find YdkAccount by id : " + id);
      return os;
    }

    ydkAccount.setIsActived(false);
    accountDbMngr.updateYdkAccount(ydkAccount);
    return os;
  }
  public WebServiceYdkAccount getYdkAccountById(Long id) {
    // TODO Auto-generated method stub
    WebServiceYdkAccount result = new WebServiceYdkAccount();
    if (id == null) {
      result.getOs().setIsSuccessful(false);
      result.getOs().setFailureReason("Null input Id");
      return result;
    }
    YdkAccount instance = accountDbMngr.getYdkAccount(id);
    if (instance == null) {
      result.getOs().setIsSuccessful(false);
      result.getOs().setFailureReason("YdkAccount not found by id: " + id);
      return result;
    }

    result.setYdkAccount(instance);
    // Eager get
    instance.getYdkRole().getMask();
    instance.getYdkRole().setYdkAccounts(null);
    return result;
  }
  public WebServiceYdkAccount getYdkAccountByName(String name) {
    // TODO Auto-generated method stub
    WebServiceYdkAccount result = new WebServiceYdkAccount();
    if (name == null) {
      result.getOs().setIsSuccessful(false);
      result.getOs().setFailureReason("Null input Id");
      return result;
    }
    YdkAccount instance = accountDbMngr.getYdkAccountByName(name);
    if (instance == null) {
      result.getOs().setIsSuccessful(false);
      result.getOs().setFailureReason("YdkAccount not found by username: " + name);
      return result;
    }

    // Eager get
    instance.getYdkRole().getMask();
    instance.getYdkRole().setYdkAccounts(null);

    result.setYdkAccount(instance);
    return result;
  }