-->
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: Obtaining a custom type via formula (Bug?)
PostPosted: Sun Jun 27, 2010 9:06 am 
Newbie

Joined: Sat Mar 20, 2010 7:26 am
Posts: 6
Hi,

there is the following object structure (all custom types)
Code:
AClass
|- BClass embeddedB
    |-CClass embeddedC

(i.e. AClass has a field embeddedB which has a field CClass embeddedC).

There should be a reference to CClass embeddedC in AClass.
This shall be done via BClass' reference to CClass with the following simple formula (in AClass):
Code:
embeddedC formula: "(SELECT b.embeddedC_id FROM BClass b WHERE b.id = embeddedB_id)"


This however results in an
Code:
org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column

exception.

In case embeddedC is not a custom type but e.g. a String, this works well using the slightly modified formula
Code:
embeddedC formula: "(SELECT b.embeddedC FROM BClass b WHERE b.id = embeddedB_id)"


Is this a bug or is it not possible at all to reference custom types using formulas?

According to http://docs.jboss.org/hibernate/core/3. ... pping.html (search for "formula (optional): an SQL expression that defines the value for a computed foreign key.") to me it seems possible.

I'd be glad for receiving answers.
Thank you
Fatzopilot


Top
 Profile  
 
 Post subject: Re: Obtaining a custom type via formula (Bug?)
PostPosted: Fri Jul 09, 2010 8:17 pm 
Newbie

Joined: Sat Mar 20, 2010 7:26 am
Posts: 6
Can somebody comment on this?
This would help me to decide whether I could hope for a potentially very neat solution to my problem or whether I should opt for a different approach.

Thanks a lot
fatzopilot


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.