a double reference persistence problem?

E

Elhanan

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?
 
T

Tom Forsmo

Elhanan said:
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top