Hi,
I try to update an object
this is my code
Code:
transaction = session.beginTransaction();
Candidate candidate = (Candidate) session.load(Candidate.class, id);
if(candidate==null)
System.out.println("candidate null");
Date today = new Date();
candidate.setStatus(status);
candidate.setReferenceNumber(reference);
candidate.setFirstName(firstName);
candidate.setLastName(lastName);
Update updated = new Update();
updated.setUpdated(df.format(today));
updated.setUpdatedBy(userName);
List <Update> updates = new ArrayList();
updates.add(updated);
candidate.setUpdates(updates);
//session.update(candidate);
session.flush();
transaction.commit();
but it doesnt change the record in the database
i get no errors but the record is not updated
am i doing sth wrong here?