-->
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: attributes -multiple components of same type?
PostPosted: Tue Jan 03, 2006 6:52 am 
Newbie

Joined: Wed May 25, 2005 7:20 am
Posts: 3
Hi,

i've run into a problem which i can't seem to get past

my class PromotionByClub has two components of the type Moneyeffect

Code:
  <Serializable(), [Class](nametype:=GetType(PromotionByClub), table:="Promotions_PromotionByClub")> Public Class PromotionByClub


        <Id(0, Access:="field", name:="mId", Column:="id", TypeType:=GetType(Integer), unsavedvalue:="0"), Generator(1, Class:="identity")> _
      Private mId As Integer

        <ComponentProperty(2, access:="field", componenttype:=GetType(MoneyEffect), name:="mAdminChange")> _
        Private mAdminChange As new MoneyEffect
        <Component(2, access:="field", componenttype:=GetType(MoneyEffect), name:="mJoiningChange")> _
Private mJoiningChange As  new MoneyEffect

end class


trouble is in the class moneyeffect the mappings for the two are the same
Code:
    <Serializable(), Component(classtype:=GetType(MoneyEffect), access:="field")> Public Class MoneyEffect
        <[Property](access:="field", name:="mChanged", column:="changed", typetype:=GetType(Boolean))> _
        Private mChanged As Boolean
        <[Property](access:="field", name:="mType", column:="moneyeffecttype", typetype:=GetType(MoneyEffectType))> _
        Private mType As MoneyEffectType
        <[Property](access:="field", name:="mValue", column:="effectvalue", typetype:=GetType(Double))> _
        Private mValue As Double

..snip..


so when i try and save i am mapping the two to the same columns

there must be a way around this i guess, but i have been unable to find it..

any help would be so appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 5:10 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
Well, you probably already know that this isn't a problem if you're using mapping documents. Since the attributes rely on runtime hbm.xml generation, I would think that you could use a mapping doc for the special situations for which they may be required.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 6:09 pm 
Newbie

Joined: Wed May 25, 2005 7:20 am
Posts: 3
i was fearing that ....

oh well, something for the next release i guess.....

thx anyways


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.