-->
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: Calculate Progress between many tables
PostPosted: Mon Jun 19, 2006 9:30 am 
Beginner
Beginner

Joined: Mon Dec 26, 2005 4:55 pm
Posts: 28
Hello,

I have an application which is connected to a database. This database has three tables (for this scenario). The tables are ContactDetails, BillingDetails and ShippingDetails, where ContactDetails has a ForeignKey Relation to BillingDetails and ShippingDetails.

Thus I have created three POJO objects for each one of these tables, and then I save and load them according to how specified in the Hibernate Standard documentation.

All this works fine. However I now need to know whether the user has enter all the required data.

I though of two options on how to go forward…

1. Create another table named Progress, then create a POJO object named Progress. This table would have three fields, ContactId (Long), BillingAddressFilled (Byte), ShippingAddressFilled (Byte). When the user saved the contact details, apart from saving the contact details, he would also be creating a new record in the Progress table, then when he saves the billing address destails he would be setting the BillingAddressFilled field to 1, and so on. This sounds easy to make, however requires to save inside the Progress table for each save.

2. I would have a POJO that maps different fields inside different tables. For example it would map the ContactId from the ContactDetails table, the BillingId from the BillingDetails table and the ShippingId from the ShippingDetails table. However I am not sure how I can accomplish this with Hibernate, or whether it should really be made.

I would really appreciate any comments about this.

Best Regards,
Sim085


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.