-->
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.  [ 3 posts ] 
Author Message
 Post subject: Way to save draft table to a permanent table in hibernate?
PostPosted: Mon Aug 16, 2010 4:35 am 
Newbie

Joined: Sun Aug 15, 2010 10:35 am
Posts: 4
I have a table DRAFT_WORK holding temporary work by someone. When the user finishes, he submits the work whereupon the same should be saved in a permanent table WORK. The two tables are very similar except for 2 differences:-
1. an additional field in WORK for time of submission
2. both have the field ID which is the primary key and auto-generated and have to be sequential. However, the value in this field need not match in the draft and its permanent form because users can choose to delete draft work and not submit it.

My question:-
Anyway to save data in DRAFT_WORK in hibernate to table WORK using mapping files and code?
The tables have children and i try to implement this in hibernate using collections and i want the children to be saved as well.


Top
 Profile  
 
 Post subject: Re: Way to save draft table to a permanent table in hibernate?
PostPosted: Mon Aug 16, 2010 5:10 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
Hello gkinu,

It is possible to get the data from draft table and storing in permanent table.

In what way draft_work has data ? After saving is that the data has to be deleted ? using coding you can attain these things.

get the property & set to the PermananetWork entity.

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
 Post subject: Re: Way to save draft table to a permanent table in hibernate?
PostPosted: Mon Aug 16, 2010 7:17 am 
Newbie

Joined: Sun Aug 15, 2010 10:35 am
Posts: 4
Kindly then give me hints of what functions to use. E.g. for deleting, i know that
session.getCurrentSession().delete(object) will do. But is there a similar one-line or few lines code to use for the copying of data from draft object to permanent object/table?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.