hibernate的join标签
<?xmlversion="1.0"?>
<!DOCTYPEhibernate-mappingPUBLIC
"-//Hibernate/HibernateMappingDTD3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<classname="com.citigroup.cib.marx.curve.CDSCurveDefinition"
table="instrument"lazy="false"><!--cds_curvewhere="status='ok'"-->
<idname="curveId"column="instrument_id"type="integer">
<generatorclass="assigned"/>
</id>
<many-to-onename="instrumentType"column="instrument_code"
class="com.citigroup.cib.marx.curve.InstrumentType"lazy="false"/>
<propertyname="instrumentDetails"column="instrument_details"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<many-to-onename="owner"column="owner_code"
class="com.citigroup.cib.marx.businessOrg.Desk"lazy="false"/>
<propertyname="status"column="status"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="enteredDate"column="entered_date"/>
<propertyname="enteredUser"column="entered_user"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<setname="levels"cascade="all"inverse="true"
collection-type="com.citigroup.cib.marx.levels.collections.LevelCollectionType">
<keycolumn="instrument_id"/>
<one-to-manyclass="com.citigroup.cib.marx.levels.CDSLevel"/>
</set>
<jointable="cds_instrument"optional="false">
<keycolumn="instrument_id"/>
<many-to-onename="referenceEntity"column="issuer_id"fetch="join"
lazy="false"
class="com.citigroup.cib.marx.referenceData.MarxReferenceEntity"/>
<many-to-onename="subord"lazy="false"
class="com.citigroup.cib.marx.referenceData.Tier"/>
<many-to-onename="currency"lazy="false"
class="com.citigroup.cib.marx.shared.Currency"/>
<many-to-onename="source"column="source"lazy="false"
class="com.citigroup.cib.marx.referenceData.Source"/>
<many-to-onename="type"lazy="false"
class="com.citigroup.cib.marx.curve.CurveType"/>
<propertyname="curve"column="external_name"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<!--<propertyname="recovery"/>-->
<propertyname="path"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="creditEntityId"column="credit_entity_id"/>
<propertyname="inactiveDate"column="inactive_date"/>
<propertyname="shortCode"column="short_code"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<many-to-onename="rollType"column="roll_type"
class="com.citigroup.cib.marx.referenceData.RollType"lazy="false"/>
<propertyname="maturityDate"column="maturity_date"/>
<propertyname="keyVersion"column="keyversion"/>
<propertyname="active"column="isActive"type="boolean"/>
<propertyname="stale"column="isStale"type="boolean"/>
<propertyname="defaulted"column="isDefaulted"type="boolean"/>
<propertyname="clearingEligible"column="isClearingEligible"type="boolean"/>
<propertyname="defaultDate"column="defaultDate"/>
<propertyname="noticeDate"column="noticeDate"/>
<propertyname="settlementDate"column="settlementDate"/>
<many-to-onename="docClause"column="doc_clause"class="com.citigroup.cib.marx.curve.DocClause"lazy="false"/>
<many-to-onename="txnTypeCurveExt"column="transaction_type"class="com.citigroup.cib.marx.referenceData.ReferenceEntityTxnType"lazy="false"/>
<propertyname="cdsStatus"column="status"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="cdsEnteredDate"column="entered_date"/>
<propertyname="cdsEnteredUser"column="entered_user"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
</join>
<jointable="curve_rules"optional="true">
<keycolumn="pr_curve_id"/>
<many-to-onename="refCurve"column="ref_curve_id"cascade="save-update"
lazy="false"
class="com.citigroup.cib.marx.curve.CDSCurveDefinition"/>
<propertyname="rulesType"column="type"type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="rulesIssuerId"column="issuer_id"type="integer"/>
<propertyname="rulesCurrency"column="currency"type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="rulesSubord"column="subord"type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="rulesRefSource"column="ref_source"type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="defaultCurve"column="is_default"type="boolean"/>
<propertyname="rulesEnteredUser"column="entered_user"/>
<propertyname="rulesEnteredDate"column="entered_date"/>
</join>
<jointable="blotter_curve"optional="true">
<keycolumn="instrument_id"/>
<propertyname="bsecBloombergTicker3"
column="bloomberg_ticker3"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="bsecBloombergTicker"
column="bloomberg_ticker"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="bsecBloombergTicker7"
column="bloomberg_ticker7"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="bsecBloombergTicker10"
column="bloomberg_ticker10"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="bsecFlag"column="manifold_flag"/>
<propertyname="bsecComment"column="comment"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
<propertyname="bsecEnteredDate"column="entered_date"/>
<propertyname="bsecEnteredUser"column="entered_user"
type="com.citigroup.cib.marx.persistence.util.TrimmedString"/>
</join>
</class>
</hibernate-mapping>