-->
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: Complex model : help needed
PostPosted: Thu Mar 31, 2005 11:31 am 
Beginner
Beginner

Joined: Wed Mar 30, 2005 5:41 am
Posts: 40
Hibernate version:
3.0

Name and version of the database you are using:
MySQL 4.1

Hi,
I am new on Hibernate (even if I read and I have tested for several days) and I need help for a hard part of my project.

I would greatly appreciate If a "hibernate guru" could spend some of his precious time to help me doing the mapping.

Here is a little part of my model. If I could understand how to manage that with hibernate, I think I will then could be autonomous.

Image

A "party" can be either a worker, a client of type organization or a client of type person.

In the case of a worker or a client of type person, the personal data concerning the "party" are stored in the "Person" table.

When I retrieve a worker from the database, I should be able to know his name and if he is enabled or disabled.

When I retrieve a client of type person, I should be able to see his name and an optional comment.

When I retrieve a client of type organization, I should be able to see its name and an optional comment.


In my class model, I would have classes
- Worker
- Client
- ClientOrganization (extending Client)
- ClientPerson (extending Client)
- Party

and the interface Person implemented by Worker and ClientPerson.

I have read a lot of examples about different types of mappings but nothing really close of my need.

For now, I have generated the java classes and mapping files with Hibernate Tools in Eclipse. The result is good and I already can insert and retrieve data but I dont know how I could tune my configuration to make the data and classes model closer.

Thanks a lot for any help or suggestion
Lilian


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.