-->
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.  [ 4 posts ] 
Author Message
 Post subject: mixing Table/Hierarchy and TableClass question
PostPosted: Fri Feb 25, 2005 1:31 am 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
I need to map the following hierarchy, but am not successful in creating
the appropriate mapping document:
Code:
            DrawingTool
              |
        +----------+-----------+
   RasterTool     VectorTool      TypeTool
       |              |              |
    +---+        +---------+         +
Brush SprayCan Polygon  Ellipse    Text


What I would like to end up with are 4 tables: one for DrawingTool and
one for each of the hierarchy bases (Raster,Vector,Type) etc.

Is it possible to do? I read the documentation and I am confused. It
seems to me that it is possible to create a mapping where the concrete
classes are mapped to separate tables and are joined, but I cannot
find a mapping that would create the set of tables I would like to have.

The reason for this mapping is that whilst for the most part (and the
example above is contrived) I will need to access instances using
the hierarchy bases (Raster, Vector, etc), I also need to be able to
access/store collections of these instances polymorphically.

Hibernate version: 3.0b4

Any help would be appreciated.

Cheers,

Bonny

_________________
Cheers,

Bonny

please don't forget to rate :)


Top
 Profile  
 
 Post subject: mixing table/hierarchy and table/subclass
PostPosted: Sat Feb 26, 2005 7:51 am 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
I've had another look through the docs and whilst I understand
that one could have a polymorphic association with superclasses
using the <any> mechanism, I would still like to pursue the concept
mapping as I've drawn above.

Could anyone please say whether it is possible to do and also what
performance implications there are when choosing either method?

_________________
Cheers,

Bonny

please don't forget to rate :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 26, 2005 7:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Currently this is not possible, leaf classes would need to have their own tables. I'd like to be able to handle this case though.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 27, 2005 9:27 pm 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
Gavin,

Thanks for the reply. Does this mean that I cannot (even with the <any>
construct) create a collection representing a one-to-many relationship
like
Code:
Project <>---+ DrawingTool
(this is the impression
I get from the Hibernate reference document)

_________________
Cheers,

Bonny

please don't forget to rate :)


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