Hello,
I am using Hibernate 3.5.0.cr1 and I thought I could use a formula to map a many to one class.
What I am trying to do is convert this mapping to an annotated decorator.
Code:
<hibernate-mapping package="com.netmemex.netmx.domain">
<class name="MeetingAttendee" table="MX_MTG_ATTENDEE">
...
<many-to-one name="indOrg" class="com.netmemex.netmx.domain.lookup.IndOrg">
<formula>
(select mt.MT_MEMEX_INDORG from mx_member_type mt where mt.MT_CODE = MT_CODE)
</formula>
</many-to-one>
<many-to-one name="memberType" column="MT_CODE" class="com.netmemex.netmx.domain.MemberType"/>
...
</class>
</hibernate-mapping>
I tried this
Code:
@ManyToOne
@JoinColumnsOrFormulas( {
@JoinColumnOrFormula(formula= @JoinFormula(value="(select mt.MT_MEMEX_INDORG from mx_member_type mt where mt.MT_CODE = MT_CODE)"))})
but it gives me an error
Code:
ORA-01799: a column may not be outer-joined to a subquery
I would appreciate any help or point to a direction where I can go forward with
Thanks,
s.