@onetomany关系(set< >)与orm.xml中的可嵌入对象

h43kikqp  于 2021-07-14  发布在  Java
关注(0)|答案(0)|浏览(223)

我正在使用orm.xml,不知道如何添加一些可嵌入对象的集合。
实体:

class User:

private final Set<MovieSourceId> favourites;

orm.xml文件:

<entity class="io.github.mmpodkanski.auth.User" access="FIELD">
    <table name="users"/>
        <attributes>

            <embedded name="sourceId">     #<------------------- there I want Set of MovieSourceId
                <attribute-override name="id">
                     <column name="source_id"/>
                </attribute-override>
            </embedded>

        </attributes>
</entity>

<embeddable class="io.github.mmpodkanski.auth.vo.MovieSourceId" access="FIELD">
        <attributes>
            <basic name="id">
                <column nullable="false"/>
            </basic>
        </attributes>
</embeddable>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题