-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate saveorupdate
PostPosted: Fri Oct 12, 2012 1:41 am 
Newbie

Joined: Fri Oct 12, 2012 1:22 am
Posts: 3
Hi friends,I am new to this forum so please forget me if i do something wrong.

i am inserting selected date as ,
....
task.setCreatedDate(createdDate);

and

taskService.saveTask(task);

in save task,

public boolean saveObject(Object object) {
try {
getHibernateTemplate().saveOrUpdate(object);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
}
}

in that i am getting current date_time only and while update this i am able to insert date i selected, it doesn't matter at updating but at first time only current date is inserted.i am so frosted about it please help me.


Top
 Profile  
 
 Post subject: Re: Hibernate saveorupdate
PostPosted: Fri Oct 12, 2012 10:40 am 
Beginner
Beginner

Joined: Fri Jul 20, 2007 10:38 am
Posts: 49
Hibernate must be pretty smart finding out the object you're passing is actually a Task. What happens if you change the saveObject to saveTask(Task task) and save that instead? How is the fied createdDate defined? Does it have a default?


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

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.