Package me.kafeitu.demo.activiti.entity.oa

Examples of me.kafeitu.demo.activiti.entity.oa.Leave


  //如果你需要真正插入数据库,将Rollback设为false
  //@Rollback(false)
  public void crudEntity() {

    // 保存请假
    Leave leave = new Leave();
    leave.setApplyTime(new Date());
    leave.setStartTime(new jodd.datetime.JDateTime("2012-05-22").convertToSqlDate());
    leave.setEndTime(new jodd.datetime.JDateTime("2012-05-23").convertToSqlDate());
    leave.setLeaveType("公休");
    leave.setUserId("kafeitu");
    leave.setReason("no reason");
    entityDao.save(leave);
    em.flush();

    // 获取用户
    leave = entityDao.findOne(leave.getId());
    assertNotNull(leave);

    // 删除请假
    entityDao.delete(leave);
    em.flush();

    // 获取用户
    leave = entityDao.findOne(leave.getId());
    assertNull(leave);
  }
View Full Code Here

TOP

Related Classes of me.kafeitu.demo.activiti.entity.oa.Leave

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.