Package edu.ubb.warp.test

Source Code of edu.ubb.warp.test.UserInserter

package edu.ubb.warp.test;

import edu.ubb.warp.dao.DAOFactory;
import edu.ubb.warp.dao.UserDAO;
import edu.ubb.warp.exception.UserNameExistsException;
import edu.ubb.warp.logic.Hash;
import edu.ubb.warp.model.User;

public class UserInserter {
  public static void InsertUsers() {
    DAOFactory df = DAOFactory.getInstance();
    UserDAO uDao = df.getUserDAO();
    User u1 = new User();
    User u2 = new User();
    u1.setEmail("mail@mail.com");
    u1.setPassword(Hash.hashString("password"));
    u1.setPhoneNumber("0743288115");
    u1.setUserName("manager");
    u1.setAddress("Kolozsvar strada utca 12");
    try {
      uDao.insertUser(u1);
    } catch (UserNameExistsException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
}
TOP

Related Classes of edu.ubb.warp.test.UserInserter

TOP
Copyright © 2018 www.massapi.com. 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.