-->
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: update problem
PostPosted: Wed Aug 04, 2004 3:52 am 
Newbie

Joined: Wed Aug 04, 2004 3:34 am
Posts: 3
hi,
I have following problem with update:

I'm using hibernate with struts in the 3-tier application
My ActionForm(model) contains reference to the persistent object. If I want to edit object's properties, in the reset function is necessary to load (calling the session.load(class, id))appropriate object. Calling the toString() function on the object I saw, that this object was initialized properly. However, if I want to update this object (in Action class), an exception (about null identifier ) is thrown. I called toString() function on the same object (reference is passed in the parameter), but some properties (type date and id) are missing (they are null)!!! Why ???

Following is the simple description of my scenario:

ArtikelBean {
long id;
Date createTime;
Date changeTime;
String description;
//for each property is getter/setter
public void update();
public void save();
public static ArtikelBean getById(Long id);
}

ArtikelForm{
ArtikelBean ab;
public void reset(Long id){ //id is taken from request of course
ab = ArtikelBean.getById(id);

//here, if I call ab.toString(), object seems to be initialized properly

}
}

ArtikelAction{
execute(ActionForm form){
//here, when I call toString() on the same bean, id and properties of
//type date are missing

form.getArtikelBean().update()
//exception is throws, because id is null }
}

cane anyone help me please ???


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.