-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hibernate update not working
PostPosted: Wed Dec 09, 2009 6:10 pm 
Newbie

Joined: Sat Nov 14, 2009 2:07 pm
Posts: 10
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.