Package com.foxconn.gds.security.model

Examples of com.foxconn.gds.security.model.UserProfile


  @Test
  public void testCreateUserAccount() {
    try {
      IUserAccountServices accMgr = UserAccountServices.getInstance();
      UserAccount acc;
      UserProfile pfl;
      String accId;
      for (int i = 0; i < 500; i++) {
        pfl = new UserProfile(
            ("eId-" + i), //unique
            ("name-" + i),
            ("name-" + i+ "@foxconn.com"),
            ("861350000" + i)
        );
View Full Code Here


  public void testUserDiffAccountSameProfile() {
    String account = "0-acc-0";
    UserAccount user = UserAccountServices.getInstance().findUserAccountByID(account);
    UserAccount other = new UserAccount("0-acc-2", "Foxconn88");
   
    UserProfile profile = user.getProfile();
   
    other.setProfile( profile );
    try {
      UserAccountServices.getInstance().createUserAccount(other);
    } catch (Exception e) {
View Full Code Here

  }
  // UserAccount (X), Profile(V)
  @Test
  public void testSaveOrUpdateUserAccount() {
    UserAccount user = new UserAccount("0-acc-2", "Foxconn88881234567");
    UserProfile profile = new UserProfile("eId-0", "name-0", "暮云春樹@foxconn.com", "11111111111" );
    user.setProfile(profile);
    user.setMyGroups("ADMIN,0-acc-1");
   
    boolean updated = true;
    try {
View Full Code Here

 
  // UserAccount (X), Profile(X)
  @Test
  public void testSaveOrUpdateUserAccount2() {
    UserAccount user = new UserAccount("3339-acc", "Foxconn88");
    UserProfile profile = new UserProfile("eId-3339", "name-0", "ds樹@foxconn.com", "11111111111" );
    user.setProfile(profile);
    user.setMyGroups("ADMIN,0-acc-1");
   
    boolean updated = true;
    try {
View Full Code Here

    }
  }
 
  public UserProfile findUserProfile(String employeeId) {
    log.info("enter findUserProfile ...");
    UserProfile result = null;
    String hql = "from UserProfile where employeeId=:employeeId ";
    try {
      // 取得資料存取管道
      EntityManager em = entityManagerFactory.createEntityManager();
     
View Full Code Here

  }
 
  public boolean isUserProfileExist(String employeeId) {
    log.info("enter isUserProfileExist ...");
    try {
      UserProfile result = findUserProfile(employeeId);
      return (result != null);
    } catch (NoResultException err) {
      return false;
    }
  }
View Full Code Here

      } else {
        user.setId( tmpUser.getId() );
      }   
    }
   
    UserProfile profile = user.getProfile();
    UserProfile tmpProfile = this.findUserProfile(profile.getEmployeeId());
    if(tmpProfile!=null) {
      profile.setId( tmpProfile.getId() );
    }
   
    EntityManager em =null;
    EntityTransaction tx = null;
View Full Code Here

    String account = req.getParameter("account");
    UserAccount user = UserAccountServices.getInstance().findUserAccountByID(account);
    if(user==null) {
      user = new UserAccount(account, account);
    }
    UserProfile newProfile = new UserProfile(
        req.getParameter("profile.employeeId"),
        req.getParameter("profile.name"),
        req.getParameter("profile.email"),
        req.getParameter("profile.mobile")
    );
    newProfile.setFirstName(req.getParameter("profile.firstName"));
    newProfile.setLastName(req.getParameter("profile.lastName"));
 
    user.setProfile(newProfile);
    user.setId(0);
    UserAccount newAccount = user;
//    UserAccount newAccount = new UserAccount(
View Full Code Here

TOP

Related Classes of com.foxconn.gds.security.model.UserProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.