Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

a double reference persistence problem?

Thread view: 
Elhanan - 31 Oct 2006 23:40 GMT
hi..

i have the following model,

a Breif, has several AssuredPersons, and several Polices.

each Polices has a Plan.

BUT

an AssuredPerson can have several Plans, from different Polices.

so i was thinking how can i can persists this, how can i be fexible and
allow a person to add a plan to a policy, or allow a policy to add a
plan and relate to a person, and how would i persists this with
hibernate.

so i came up with this:

i would have a PersonPlanLink class which holds a refence to one
AssuredPerson, one Refernce to Policy Class, and would be stored as
collection inside the Brief class. (a bi-di association in hibernate
no?)

so, the AssuredPerson class will have to have a refernce to it's Brief
class, and the Policy Class willl have a reference to it's Breif class
as well, each will recieve a message to a plan, but internally they
will delegate this to the brief class, which really is going to manage
the collection, and have package level setters and getters for
hibernate to persist (is this ok with hibernate?)

also when each one willl be requested to get it's own childen (getPlans
for AssuredPerson) they will query the Brief inorder to get it.

what do you think?
Tom Forsmo - 03 Nov 2006 22:12 GMT
> hi..
>
[quoted text clipped - 14 lines]
>
> what do you think?

You should perhaps look at serialisation, it deals with such reference
problems. You might be able to use that as a starting point for
persisting your data.

tom


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.