在Hibernate

时间:2017-03-27 16:06:31

标签: java hibernate join

我有连接子类的hibernate映射:

<joined-subclass name="CSomeClass"
          extends="CParentClass"
          table="some_class">

    <key column="id" />
    .....
</joined-subclass>

我想添加使用join的属性:

<join table="another_class" optional="true" inverse="true">
    <subselect>SELECT owner_id, id FROM another_class WHERE owner_type = 4</subselect>
    <key column="owner_id"/>
    <many-to-one name="another" class="..." column="id" unique="true" lazy="proxy"/>
</join>

有没有办法在不将join-subclass更改为其他内容的情况下执行此操作?(因为我不想更改不是我的代码)或者可能会以某种方式更改所有内容现在都适用于join-subclass

UPD 我的Hibernate版本是3.5,我无法改变它 error

0 个答案:

没有答案