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