이있는 등의 다 대다 매핑 테이블을 가입 할 수 있습니다. 가장 최근의 의견을 바탕으로
<class name="MarketReport">
<id column="reportid" />
<bag name="ReportTargets" table="reporttargets">
<key column="marketreportid"/>
<many-to-many column="targetid" class="Target"/>
</bag>
</class>
<class name="Target">
<id column="targetid" />
<bag name="DataPoints" inverse="true">
<key column="targetid"/>
<one-to-many class="DataPoint"/>
</bag>
</class>
<class name="DataPoint">
<id column="datapointid" />
</class>
는 다음 중 하나가
ternary association, 또는
component collection을하고자합니다. 두 매핑을 모두 포함했습니다.
<class name="MarketReport">
<id column="reportid" />
<map name="ReportTargets" table="reporttargets">
<key column="marketreportid"/>
<index-many-to-many column="targetid" class="Target"/>
<many-to-many column="datapointid" class="DataPoint"/>
</map>
</class>
<class name="MarketReport">
<id column="reportid" />
<bag name="ReportTargets" table="reporttargets">
<key column="marketreportid"/>
<composite-element class="ReportTarget">
<many-to-one name="Target" column="targetid"/>
<many-to-one name="DataPoint" column="datapointid"/>
</composite-element>
</bag>
</class>
<class name="Target">
<id column="targetid" />
</class>
<class name="DataPoint">
<id column="datapointid" />
</class>
안녕하세요 Lachlan, 지속적인 도움에 감사드립니다. 최근의 편집은 Target과 DataPoint 사이에서 직접적인 일대일 작업을 설정합니다. 즉, 같은 조인 테이블을 통해 어떻게 링크를 생성합니까? ReportTargets : MarketReport와 Target 간의 많은 연결에 사용됩니다. 비즈니스 로직은 많은 데이터 포인트가 타겟과 시장보고 사이의 특정 관계와 연관되어 있다는 것입니다. 감사. – Matt