[jboss-user] [JBoss Seam] - How to Clone EntityHome Object
jonathan.shin
do-not-reply at jboss.com
Wed Jul 11 16:16:24 EDT 2007
I'm creating a task module and the requirement is as follow:
When user completed the task, copy the current task and change the completion date property to null and add to the database. Is there any example that copy the persistent object then add to the database?
| @Override
| public String update()
| {
| if (this.instance.getTaskCompleted().equals("Y")) {
|
| try {
| TitleXiTaskHome titleXiTask = (TitleXiTaskHome) super.clone();
| titleXiTask.instance.setTaskCompleted("N");
| titleXiTask.instance.setCompletedDate(null);
| titleXiTask.persist();
| } catch (CloneNotSupportedException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
| super.update();
| return "success";
| }
|
I'm getting CloneNotSupportedException error.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063193#4063193
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063193
More information about the jboss-user
mailing list