}
protected com.liferay.portal.model.UserTracker update(
com.liferay.portal.model.UserTracker userTracker)
throws SystemException {
Session session = null;
try {
if (userTracker.isNew() || userTracker.isModified()) {
session = openSession();
if (userTracker.isNew()) {
UserTrackerHBM userTrackerHBM = new UserTrackerHBM(userTracker.getUserTrackerId(),
userTracker.getCompanyId(),
userTracker.getUserId(),
userTracker.getModifiedDate(),
userTracker.getRemoteAddr(),
userTracker.getRemoteHost(),
userTracker.getUserAgent());
session.save(userTrackerHBM);
session.flush();
}
else {
try {
UserTrackerHBM userTrackerHBM = (UserTrackerHBM)session.load(UserTrackerHBM.class,
userTracker.getPrimaryKey());
userTrackerHBM.setCompanyId(userTracker.getCompanyId());
userTrackerHBM.setUserId(userTracker.getUserId());
userTrackerHBM.setModifiedDate(userTracker.getModifiedDate());
userTrackerHBM.setRemoteAddr(userTracker.getRemoteAddr());
userTrackerHBM.setRemoteHost(userTracker.getRemoteHost());
userTrackerHBM.setUserAgent(userTracker.getUserAgent());
session.flush();
}
catch (ObjectNotFoundException onfe) {
UserTrackerHBM userTrackerHBM = new UserTrackerHBM(userTracker.getUserTrackerId(),
userTracker.getCompanyId(),
userTracker.getUserId(),
userTracker.getModifiedDate(),
userTracker.getRemoteAddr(),
userTracker.getRemoteHost(),
userTracker.getUserAgent());
session.save(userTrackerHBM);
session.flush();
}
}
userTracker.setNew(false);
userTracker.setModified(false);