public void doClockIn(Terminal terminal, Shift shift, Calendar currentTime) { setClockedIn(true); setCurrentShift(shift); setCurrentTerminal(terminal); setLastClockInTime(currentTime.getTime()); LogFactory.getLog(Application.class) .info("terminal id befor saving clockIn=" + terminal.getId()); AttendenceHistory attendenceHistory = new AttendenceHistory(); attendenceHistory.setClockInTime(currentTime.getTime()); attendenceHistory.setClockInHour(Short.valueOf((short) currentTime.get(Calendar.HOUR))); attendenceHistory.setUser(this); attendenceHistory.setTerminal(terminal); attendenceHistory.setShift(shift); UserDAO.getInstance().saveClockIn(this, attendenceHistory, shift, currentTime); }
/** Copy terminal fields. */ public final void link(Terminal terminal) { set(F_TERMINALID, new Long(terminal.getId())); set(F_TERMINALNAME, terminal.getName()); set(F_BUILDINGID, new Long(terminal.getBuildingId())); set(F_BUILDINGNAME, terminal.getBuildingName()); }