-->
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.  [ 3 posts ] 
Author Message
 Post subject: discrimination on property
PostPosted: Sun May 16, 2004 11:26 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
As I read the hibernate reference document, I see that a discrimination for classes is possible where as for properties not possible.
But I believe that this would be very nice. (By sense, to do this, there must be a "table" property for the properties.)

Suppose that, I have a persistent class Book that has ID,name,type and stockarea. For the type value(discriminator), I need to get "stockarea" from lets say 4 tables. (Suppose that an idiot made this db schema and u have to get data from that schema and dont have the chance to change it:))).
In this architecture, I need to write 4 more classes that extend Book and then use discriminator value for each of them. That I means I have to write 4 meaningless classes just for getting one attribute.

In Addition to the mapping of classes , for some cases the hibernate may give the chance to map the attributes independent of the object and the object Table. I mean, it can be great if hibernate may "in some cases" attemp to a single attribute as a object.

<property name= ....
discriminator value=....
table=....
column =....
class = .....


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 11:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I'd suggest you create a view or something. We can really not support every available broken database model.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 12:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I don't really understand what you are talking about, but it looks like you can do it with a UserType. (Perhaps even with an <any> mapping).


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