-->
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: Using 'component' in multiple 'class'es.
PostPosted: Sat Sep 20, 2003 1:59 pm 
Newbie

Joined: Sat Sep 20, 2003 1:09 pm
Posts: 8
Hello,

I have a component 'Value' which has the following
properties :
- amount
- quantity (length, mass, time, etc.)
- dimension (m, kg, sec, etc.)

I use this Value in multiple classes and sometimes I use
multiple Values in one class.

I would like to make Value a 'component'.
But according to the hibernat-mapping-dtd a 'component' can
only be declared inside a 'class'-element. That means that I
have to declare it x-times.
It would be nice if I could declare it on the same level as
the class-element and than make a reference to it.
As I sometimes use multiple 'Values' in one class I could also
have use to prefix a property-name.

Something like this:
Code:
<hibernate-mapping>
  <class name="Article">
    <component name="intakeSpeed" type="Value" prefix="intakeSpeed"/>
    <component name="maxTemperature" type="Value" prefix="maxTemp"/>
  </class>

  <component name="Value">
     <property name="amount"/>
     <property name="quantity"/>
     <property name="dimension"/>
  </component>
</hibernate-mapping>


This would create in the database the following columns :
intakeSpeed_amount, intakeSpeed_quantity, intakeSpeed_dimension,
maxTemp_amount, maxTemp_quantity and maxTemp_dimension.

Any thoughts on this ?

Kees Kuip.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 20, 2003 3:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
standard xml entities would also work for this - much simpler ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 6:32 am 
Newbie

Joined: Sat Sep 20, 2003 1:09 pm
Posts: 8
max wrote:
standard xml entities would also work for this - much simpler ;)


Could you give me a hint for this simple solution ?
I cannot see how to do this with entities.

Kees.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.