-->
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: mapping of generic values table
PostPosted: Mon Nov 06, 2006 6:55 pm 
Newbie

Joined: Mon Nov 06, 2006 6:13 pm
Posts: 1
Hi,

It is possible to integrate Hibernate into the following DB-Schema and object model without changings of the structure?

DB-Schema:
UnitReport 1-n UnitReport_Attribute_Value n-1 Attribute

UnitReport(Id, StartEndTime...)
Attribute(Id, Name, DatatypeID)
UnitReport_Attribute_Value (Id, ValueDouble, ValueString, ValueBoolean).

The obj model looks as follows. Each UnitReport contains a Map of attribute and value pairs, whereas the attribute has the same structure such as the corresponding table.
For each column in the ur_attribute_value exists a concrecte class (e.g. ValueDouble, ValueString, etc.), whereas all value class inherit from Value.
I know that I can do this with hibernates concept of mapping one table per class hierarchy, but the disriminator is defined in the attribute table.

Cu,
Marcel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 5:39 am 
Senior
Senior

Joined: Sat Nov 27, 2004 4:13 am
Posts: 137
use a discriminator formula

(see hibernate 3.2 docs)

_________________
don't forget to credit!

Amir Pashazadeh
Payeshgaran MT
پايشگران مديريت طرح
http://www.payeshgaran.co
http://www.payeshgaran.org
http://www.payeshgaran.net


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.