Package com.fengjing.framework.hibernate.model

Examples of com.fengjing.framework.hibernate.model.Employee


    response.setContentType("text/html;charset=utf-8");
    PrintWriter writer = response.getWriter();
   
    try {
     
      Employee employee=new Employee();
     
      employee.setEmpname("����");
      employee.setSex("Ů");
      employee.setLocation("��������");
     
      Department department=new Department();
      department.setDeptname("���Բ�");
     
      employee.setDepartment(department);
     
      employeeService.add(employee);
     
      writer.write("<script type='text/javascript'>alert('����ɹ�!');</script>");
    } catch (Exception e) {
View Full Code Here


    PrintWriter writer = response.getWriter();
   
   
    try {
      List<Employee> list=employeeService.query(" from com.fengjing.framework.hibernate.model.Employee employee where employee.id = 2 ");
      Employee employee = list.get(0);
     
      employee.setEmpname("������");
      employee.setSex("��");
      employee.setLocation("�й�����");
     
      employee.getDepartment().setDeptname("����Ժ");
     
      employeeService.update(employee);
      writer.write("<script type='text/javascript'>alert('�޸ijɹ�!');</script>");
    } catch (Exception e) {
      writer.write("<script type='text/javascript'>alert('�޸�ʧ��!\t"+e.getMessage()+"');</script>");
View Full Code Here

  @Resource(name="employeeServiceImplHibernate4")
  private EmployeeService employeeService;
 
  @Test
  public void save(){
    Employee employee=new Employee();
   
    employee.setEmpname("����");
    employee.setSex("Ů");
    employee.setLocation("��������");
   
    Department department=new Department();
    department.setDeptname("���Բ�");
   
    employee.setDepartment(department);
   
    employeeService.add(employee);
   
  }
View Full Code Here

 
 
  @Test
  public void modify(){
    List<Employee> list=employeeService.query(" from com.fengjing.framework.hibernate.model.Employee employee where employee.id = 1 ");
    Employee employee = list.get(0);
   
    employee.setEmpname("��xx");
    employee.setSex("��");
    employee.setLocation("�й�����");
   
    employee.getDepartment().setDeptname("����Ժ");
   
    employeeService.update(employee);
  }
View Full Code Here

TOP

Related Classes of com.fengjing.framework.hibernate.model.Employee

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.