-->
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.  [ 2 posts ] 
Author Message
 Post subject: Some idea to map a "complex" object graph ?
PostPosted: Sun Oct 10, 2004 5:23 am 
Newbie

Joined: Mon Jul 05, 2004 11:49 am
Posts: 4
Location: Italy
Hi, a question for you all.
I'm evaluating Hibernate to use it in a new project. What we need is to make the following class graph persistent via Hibernate.

abstract class Worker

class Technician extends Worker

class Project

Project and Technician are associated. The association is "involved in project" and is a m-n association.
I'm trying to use xdoclet, ant, exportschema ant task.

What is not clear to me is how map the Worker class. It's abstract so I suppose it's correct not to map it. An instance of a abstract class can't exists.

So, I think to map on the db only Technician.

The problem arise when I try to use xdoclet... let's suppose Worker has a couple of methods setName, getName. They are hinerited by Technician.
I can't put @hibernate.property for name in Worker, 'cause it's abstract and I don't need to map it via Hibernate. I can't put @hibernate.property on Technician 'cause it hinerits getName and setName from Worker and there is no source where I can write the xdoclet tags...

can you help me solve this problem ?

thanks.

_________________
.o0 DaniDemi Oo.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2004 3:09 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Read Hibernate in Action it has a great chapter about the different strategies of inheritence mapping.

HTH
Ernst


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