}
protected com.liferay.portal.model.PasswordTracker update(
com.liferay.portal.model.PasswordTracker passwordTracker)
throws SystemException {
Session session = null;
try {
if (passwordTracker.isNew() || passwordTracker.isModified()) {
session = openSession();
if (passwordTracker.isNew()) {
PasswordTrackerHBM passwordTrackerHBM = new PasswordTrackerHBM(passwordTracker.getPasswordTrackerId(),
passwordTracker.getUserId(),
passwordTracker.getCreateDate(),
passwordTracker.getPassword());
session.save(passwordTrackerHBM);
session.flush();
}
else {
try {
PasswordTrackerHBM passwordTrackerHBM = (PasswordTrackerHBM)session.load(PasswordTrackerHBM.class,
passwordTracker.getPrimaryKey());
passwordTrackerHBM.setUserId(passwordTracker.getUserId());
passwordTrackerHBM.setCreateDate(passwordTracker.getCreateDate());
passwordTrackerHBM.setPassword(passwordTracker.getPassword());
session.flush();
}
catch (ObjectNotFoundException onfe) {
PasswordTrackerHBM passwordTrackerHBM = new PasswordTrackerHBM(passwordTracker.getPasswordTrackerId(),
passwordTracker.getUserId(),
passwordTracker.getCreateDate(),
passwordTracker.getPassword());
session.save(passwordTrackerHBM);
session.flush();
}
}
passwordTracker.setNew(false);
passwordTracker.setModified(false);