对于下面的一对一映射,请注意以下问题,您能告诉我这是什么问题吗?
Exception Description:
The join-column element definition for attribute
[public com.grc.sdb.beans.offer.ContinuityItem com.grc.sdb.beans.offer.BackendOffer.getContinuityItem()] from the entity class [class com.grc.sdb.beans.offer.BackendOffer] is incomplete.
When the source entity class uses a composite primary key, a join-column element must be specified for each join column. Both the name and the referenced-column-name attributes must be specified in each such join-column.
一对一maping发生的问题
com.grc.sdb.beans.offer.ContinuityItem, com.grc.sdb.beans.offer.BackendOffer
-
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0">
<entity class="com.grc.sdb.beans.offer.Offer">
<table name="S_OFFERS" />
<named-query name="offersByStatus">
<query>SELECT o FROM Offer o WHERE o.status=:status</query>
</named-query>
<named-query name="getAllOffers">
<query>SELECT o FROM Offer o ORDER BY o.lastUpdateDate DESC</query>
</named-query>
<named-query name="getOffersByProductLine">
<query>SELECT o FROM Offer o WHERE o.productLineCode =
:productLineCode AND NOT o.status = :excludeStatus</query>
</named-query>
<named-query name="getOfferByOfferCode">
<query>SELECT o FROM Offer o WHERE o.code = :code</query>
</named-query>
<entity-listeners>
<entity-listener class="com.grc.sdb.listener.CodeGeneratorListener">
<pre-persist method-name="prePersist" />
<pre-update method-name="preUpdate" />
</entity-listener>
<entity-listener class="com.grc.sdb.listener.BeanChangeActivityListener">
<pre-persist method-name="prePersist" />
<post-persist method-name="postPersist" />
<pre-remove method-name="preRemove" />
<pre-update method-name="preUpdate" />
<post-update method-name="postUpdate" />
</entity-listener>
</entity-listeners>
<attributes>
<id name="id">
<column name="OFFER_ID" />
<generated-value generator="seqOffers" strategy="SEQUENCE" />
<sequence-generator name="seqOffers"
sequence-name="SEQ_OFFERS" allocation-size="1" />
</id>
<basic name="code">
<column name="OFFER_CODE" />
</basic>
<basic name="status">
<column name="status" />
</basic>
<basic name="description">
<column name="OFFER_DESCRIPTION" />
</basic>
<basic name="beginDate">
<column name="begin_date" />
<temporal>DATE</temporal>
</basic>
<basic name="endDate">
<column name="end_date" />
<temporal>DATE</temporal>
</basic>
<basic name="creationDate">
<column name="creation_date" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="createdBy">
<column name="created_by" />
</basic>
<basic name="currencyCode">
<column name="currency_code" />
</basic>
<basic name="productLineCode">
<column name="product_line_code" />
</basic>
<basic name="clubTypeCode">
<column name="club_type_code" />
</basic>
<basic name="lastUpdatedBy">
<column name="last_updated_by" />
</basic>
<basic name="firstOrderRushAvailableFlag">
<column name="FIRST_RUSH_AVAILABLE_FLAG" />
</basic>
<basic name="firstOrderRushAmount">
<column name="FIRST_RUSH_AMOUNT" />
</basic>
<basic name="firstOrderRushMethod">
<column name="FIRST_RUSH_METHOD_CODE" />
</basic>
<basic name="mpgCode">
<column name="MPG_CODE" />
</basic>
<basic name="contTable">
<column name="CONT_TABLE_CODE" />
</basic>
<basic name="edsKeyCode">
<column name="EDS_KEY_CODE" />
</basic>
<basic name="availableForCanada">
<column name="FIRST_CANADA_AVAILABLE_FLAG" />
</basic>
<basic name="legacyType">
<column name="LEGACY_OFFER_TYPE" />
</basic>
<basic name="continuityKey">
<column name="CONTINUITY_KEY" />
</basic>
<basic name="ffcCode">
<column name="FFC_CODE" />
</basic>
<version name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</version>
<one-to-many name="orderItems" target-entity="com.grc.sdb.beans.offer.OfferItem"
mapped-by="offer" fetch="LAZY">
<join-column name="offer_id" referenced-column-name="offer_id" />
<cascade>
<cascade-all />
</cascade>
</one-to-many>
<embedded name="firstOrderDetail">
<attribute-override name="numPayments">
<column name="FIRST_NUM_PAYMENTS" />
</attribute-override>
<attribute-override name="numSHPayments">
<column name="FIRST_SHIP_NUM_PAY" />
</attribute-override>
<attribute-override name="firstPaymentAmount">
<column name="FIRST_PAYMENT" />
</attribute-override>
<attribute-override name="firstSHAmount">
<column name="FIRST_SHIP_HAND" />
</attribute-override>
<attribute-override name="addlPaymentAmount">
<column name="FIRST_ADDL_PAYMENT" />
</attribute-override>
<attribute-override name="addlSHAmount">
<column name="FIRST_ADDL_SHIP_HAND" />
</attribute-override>
<attribute-override name="canadaSHAmount">
<column name="FIRST_CANADA_SHIP_HAND" />
</attribute-override>
<attribute-override name="shipMethod">
<column name="FIRST_SHIP_HAND_METHOD_CODE" />
</attribute-override>
<attribute-override name="shipInterval">
<column name="FIRST_CONT_SHIP_INTERVAL" />
</attribute-override>
<attribute-override name="payTable">
<column name="FIRST_PAYTABLE" />
</attribute-override>
<attribute-override name="billingInterval">
<column name="FIRST_BILLING_INTERVAL" />
</attribute-override>
<attribute-override name="totalPaymentAmount">
<column name="FIRST_SHIP_UNIT_PRICE" />
</attribute-override>
<attribute-override name="paymentPlanId">
<column name="FIRST_OMX_PLAN_ID" />
</attribute-override>
</embedded>
<embedded name="contOrderDetail">
<attribute-override name="numPayments">
<column name="CONT_NUM_PAYMENTS" />
</attribute-override>
<attribute-override name="numSHPayments">
<column name="CONT_SHIP_NUM_PAY" />
</attribute-override>
<attribute-override name="firstPaymentAmount">
<column name="CONT_FIRST_PAYMENT" />
</attribute-override>
<attribute-override name="firstSHAmount">
<column name="CONT_FIRST_SHIP_HAND" />
</attribute-override>
<attribute-override name="addlPaymentAmount">
<column name="CONT_ADDL_PAYMENT" />
</attribute-override>
<attribute-override name="addlSHAmount">
<column name="CONT_ADDL_SHIP_HAND" />
</attribute-override>
<attribute-override name="canadaSHAmount">
<column name="CONT_CANADA_SHIP_HAND" />
</attribute-override>
<attribute-override name="shipMethod">
<column name="CONT_SHIP_HAND_METHOD_CODE" />
</attribute-override>
<attribute-override name="shipInterval">
<column name="CONT_SHIP_INTERVAL" />
</attribute-override>
<attribute-override name="payTable">
<column name="CONT_PAYTABLE" />
</attribute-override>
<attribute-override name="billingInterval">
<column name="CONT_BILLING_INTERVAL" />
</attribute-override>
<attribute-override name="totalPaymentAmount">
<column name="CONT_SHIP_UNIT_PRICE" />
</attribute-override>
<attribute-override name="paymentPlanId">
<column name="CONT_OMX_PLAN_ID" />
</attribute-override>
</embedded>
<transient name="firstOrderItems" />
<transient name="contOrderItems" />
</attributes>
</entity>
<entity class="com.grc.sdb.beans.offer.OfferItem">
<table name="S_OFFER_ITEMS" />
<named-query name="removeOfferItems">
<query>DELETE FROM OfferItem oi WHERE oi.offer.id=:offer_id</query>
</named-query>
<named-query name="getOfferItem">
<query>SELECT oi FROM OfferItem oi WHERE oi.offer.id=:offer_id AND
oi.code=:item_code</query>
</named-query>
<named-query name="getOfferItems">
<query>SELECT oi.orderType, oi.code, oi.startCode FROM OfferItem oi
WHERE oi.offer.id=:offer_id</query>
</named-query>
<named-query name="getOfferItemsByType">
<query>SELECT oi FROM OfferItem oi WHERE oi.offer.id=:offer_id AND
oi.orderType=:order_type</query>
</named-query>
<attributes>
<id name="id">
<column name="OFFER_ITEM_ID" />
<generated-value generator="seqOfferItemId"
strategy="SEQUENCE" />
<sequence-generator name="seqOfferItemId"
sequence-name="SEQ_OFFER_ITEM_ID" allocation-size="1" />
</id>
<basic name="offerId">
<column name="OFFER_ID" insertable="false" updatable="false" />
</basic>
<basic name="code">
<column name="ITEM_CODE" />
</basic>
<basic name="orderType">
<column name="SHIPMENT_NO" />
</basic>
<basic name="createdBy">
<column name="CREATED_BY" />
</basic>
<basic name="creationDate">
<column name="CREATION_DATE" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="lastUpdatedBy">
<column name="LAST_UPDATED_BY" />
</basic>
<basic name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</basic>
<basic name="startCode">
<column name="START_ITEM_CODE" />
</basic>
<basic name="webCartTitle">
<column name="WEB_CART_TITLE" />
</basic>
<basic name="webCartText">
<column name="WEB_CART_TEXT" />
</basic>
<basic name="webCartMaxQty">
<column name="WEB_CART_MAX_QTY" />
</basic>
<many-to-one name="offer">
<join-column name="OFFER_ID" nullable="false"
insertable="true" updatable="true" />
</many-to-one>
<transient name="description" />
<transient name="sequenceNumber" />
<transient name="webCartTextOverridden" />
<transient name="resetWebCartText" />
<transient name="webCartTextUpdated" />
</attributes>
</entity>
<entity class="com.grc.sdb.beans.offer.Item">
<table name="S_ITEMS" />
<named-query name="getItemByCode">
<query>SELECT i FROM Item i WHERE i.status=:status AND
i.orgCode=:org_code AND i.code=:code</query>
</named-query>
<named-query name="getItemByCodeAnyStatus">
<query>SELECT i FROM Item i WHERE i.orgCode=:org_code AND
UPPER(i.code)=:code</query>
</named-query>
<named-query name="searchItemsForProductLineByCode">
<query>SELECT i FROM Item i WHERE i.status=:status AND
i.orgCode=:org_code AND i.productLineCode=:product_line_code AND
UPPER(i.code) LIKE :code_filter ORDER BY i.code</query>
</named-query>
<named-query name="searchItemsForContinuity">
<!-- not checking for status because we want any the Item related to the
Continuity even if Inactive -->
<query>
SELECT i FROM Item i WHERE i.orgCode=:org_code
AND i.code IN
(SELECT coi.contItemCode FROM ContinuityItem coi WHERE
coi.continuityKey=:continuityKey)
</query>
</named-query>
<named-query name="countItemsForProductLineByCode">
<query>SELECT COUNT(i) FROM Item i WHERE i.status=:status AND
i.orgCode=:org_code AND i.productLineCode=:product_line_code AND
UPPER(i.code) LIKE :code_filter</query>
</named-query>
<attributes>
<id name="code">
<column name="item_code" />
</id>
<basic name="description">
<column name="item_description" />
</basic>
<basic name="productLineCode">
<column name="product_line_code" />
</basic>
<basic name="orgCode">
<column name="org_code" />
</basic>
<basic name="company">
<column name="company" />
</basic>
<basic name="edsProductNumber">
<column name="eds_product_no" />
</basic>
<basic name="status">
<column name="item_status" />
</basic>
<basic name="invOrg">
<column name="inv_org" />
</basic>
<basic name="invSeq">
<column name="inv_seq" />
</basic>
<basic name="opUnit">
<column name="op_unit" />
</basic>
<basic name="sequenceNumber">
<column name="SEQ_NUM" />
</basic>
<basic name="mnShippingStatusCode">
<column name="MN_SHIP_STATUS_CODE" />
</basic>
<basic name="mnShippingReadinessFlag">
<column name="MN_SHIP_READINESS_FLAG" />
<enumerated>STRING</enumerated>
</basic>
<basic name="supplySize">
<column name="SUPPLY_SIZE" />
</basic>
<basic name="productDescription1">
<column name="PRODUCT_DESCRIPTION_1" />
</basic>
</attributes>
</entity>
<entity class="com.grc.sdb.beans.payment.PaymentPlan">
<table name="S_OMX_PAYMENT_PLANS" />
<attributes>
<id name="id">
<column name="OMX_PLAN_ID" />
<generated-value generator="seqPlanId" strategy="SEQUENCE" />
<sequence-generator name="seqPlanId"
sequence-name="SEQ_OMX_PLAN_ID" allocation-size="1" />
</id>
<basic name="cID">
<column name="CID" />
</basic>
<basic name="planID">
<column name="PLAN_ID" />
</basic>
<basic name="description">
<column name="PLAN_DESCRIPTION" />
</basic>
<basic name="paymentPlanType">
<column name="PAYMENT_PLAN_TYPE" />
</basic>
<basic name="recurrenceXML">
<column name="RECURRENCE_XML" />
</basic>
<basic name="createdBy">
<column name="CREATED_BY" />
</basic>
<basic name="creationDate">
<column name="CREATION_DATE" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="lastUpdatedBy">
<column name="LAST_UPDATED_BY" />
</basic>
<basic name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</basic>
<one-to-many name="paymentPlanDetails"
target-entity="com.grc.sdb.beans.payment.PaymentPlanDetail"
mapped-by="paymentPlan" fetch="EAGER">
<join-column name="OMX_PLAN_ID" referenced-column-name="OMX_PLAN_ID" />
<cascade>
<cascade-all />
</cascade>
</one-to-many>
</attributes>
</entity>
<entity class="com.grc.sdb.beans.payment.PaymentPlanDetail">
<table name="S_OMX_PAYMENT_PLAN_DETAILS" />
<attributes>
<id name="id">
<column name="OMX_PLAN_DETAIL_ID" />
<generated-value generator="seqPlanDetailId"
strategy="SEQUENCE" />
<sequence-generator name="seqPlanDetailId"
sequence-name="SEQ_OMX_PLAN_DETAIL_ID" allocation-size="1" />
</id>
<basic name="planID">
<column name="OMX_PLAN_ID" />
</basic>
<basic name="paymentID">
<column name="PAYMENT_ID" />
</basic>
<basic name="delayInDays">
<column name="DELAY_IN_DAYS" />
</basic>
<basic name="fraction">
<column name="FRACTION" />
</basic>
<basic name="includeSH">
<column name="INCLUDE_SH" />
</basic>
<basic name="includeTax">
<column name="INCLUDE_TAX" />
</basic>
<basic name="includeNonPrimaryProduct">
<column name="INCLUDE_NON_PRIMARY_PRODUCT" />
</basic>
<basic name="fixedPaymentAmount">
<column name="FIXED_PAYMENT_AMOUNT" />
</basic>
<basic name="createdBy">
<column name="CREATED_BY" />
</basic>
<basic name="creationDate">
<column name="CREATION_DATE" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="lastUpdatedBy">
<column name="LAST_UPDATED_BY" />
</basic>
<basic name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</basic>
<many-to-one name="paymentPlan">
<join-column name="OMX_PLAN_ID" nullable="false"
insertable="false" updatable="false" />
<cascade>
<cascade-all />
</cascade>
</many-to-one>
</attributes>
</entity>
<entity class="com.grc.sdb.beans.offer.Continuity">
<table name="S_CONTINUITIES" />
<named-query name="getAllContinuityOrders">
<query>SELECT co FROM Continuity co ORDER BY co.lastUpdateDate DESC,
co.code ASC</query>
</named-query>
<attributes>
<id name="key">
<column name="continuity_key" />
<generated-value generator="seqContinuities"
strategy="SEQUENCE" />
<sequence-generator name="seqContinuities"
sequence-name="SEQ_CONTINUITY_KEY" allocation-size="1" />
</id>
<basic name="code">
<column name="continuity_code" />
</basic>
<basic name="mpgCode">
<column name="mpg_code" />
</basic>
<basic name="creationDate">
<column name="creation_date" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="createdBy">
<column name="created_by" />
</basic>
<basic name="lastUpdatedBy">
<column name="last_updated_by" />
</basic>
<basic name="productLineCode">
<column name="product_line_code" />
</basic>
<basic name="ffcCode">
<column name="ffc_code" />
</basic>
<basic name="firstToContShipInterval">
<column name="FIRST_CONT_SHIP_INTERVAL" />
</basic>
<version name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</version>
<one-to-many name="items"
target-entity="com.grc.sdb.beans.offer.ContinuityItem" mapped-by="continuity"
fetch="LAZY">
<order-by>sequenceNumber ASC</order-by>
<join-column name="continuity_key"
referenced-column-name="continuity_key" />
<cascade>
<cascade-all />
</cascade>
</one-to-many>
<embedded name="detail">
<attribute-override name="numPayments">
<column name="NUM_PAYMENTS" />
</attribute-override>
<attribute-override name="numSHPayments">
<column name="SHIP_NUM_PAY" />
</attribute-override>
<attribute-override name="firstPaymentAmount">
<column name="FIRST_PAYMENT" />
</attribute-override>
<attribute-override name="firstSHAmount">
<column name="FIRST_SHIP_HAND" />
</attribute-override>
<attribute-override name="addlPaymentAmount">
<column name="ADDL_PAYMENT" />
</attribute-override>
<attribute-override name="addlSHAmount">
<column name="ADDL_SHIP_HAND" />
</attribute-override>
<attribute-override name="canadaSHAmount">
<column name="CANADA_SHIP_HAND" />
</attribute-override>
<attribute-override name="shipMethod">
<column name="SHIP_HAND_METHOD_CODE" />
</attribute-override>
<attribute-override name="shipInterval">
<column name="SHIP_INTERVAL" />
</attribute-override>
<attribute-override name="payTable">
<column name="PAYTABLE" />
</attribute-override>
<attribute-override name="billingInterval">
<column name="BILLING_INTERVAL" />
</attribute-override>
<attribute-override name="totalPaymentAmount">
<column name="UNIT_PRICE" />
</attribute-override>
<attribute-override name="paymentPlanId">
<column name="CONT_OMX_PLAN_ID" />
</attribute-override>
</embedded>
</attributes>
</entity>
<entity class="com.grc.sdb.beans.offer.ContinuityItem">
<table name="S_ITEM_CONTINUITIES" />
<attributes>
<id name="continuityKey">
<column name="continuity_key" insertable="false" updatable="false" />
</id>
<id name="contItemCode">
<column name="cont_item_code" />
</id>
<id name="startItemCode">
<column name="start_item_code" />
</id>
<id name="sequenceNumber">
<column name="SEQ_NUM" />
</id>
<basic name="omxSOCId">
<column name="OMX_SOC_ID" />
</basic>
<basic name="itemContinuityCode">
<column name="item_continuity_code" />
</basic>
<basic name="creationDate">
<column name="creation_date" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="createdBy">
<column name="created_by" />
</basic>
<basic name="lastUpdatedBy">
<column name="last_updated_by" />
</basic>
<basic name="productLineCode">
<column name="product_line_code" />
</basic>
<basic name="ffcCode">
<column name="ffc_code" />
</basic>
<version name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</version>
<many-to-one name="continuity">
<join-column name="continuity_key" nullable="false"
insertable="true" updatable="true" />
</many-to-one>
<one-to-one name="backendOffer">
<join-column name="BACKEND_OFFER_ID" nullable="false"
insertable="true" updatable="true" />
<cascade>
<cascade-all />
</cascade>
</one-to-one>
</attributes>
</entity>
<entity class="com.grc.sdb.beans.offer.Soc">
<table name="S_OMX_SOC" />
<attributes>
<id name="id">
<column name="OMX_SOC_ID" />
<generated-value generator="sequenceSocId" strategy="SEQUENCE" />
<sequence-generator name="seqSocId"
sequence-name="SEQ_OMX_SOC_ID" allocation-size="1" />
</id>
<basic name="cid">
<column name="CID" />
</basic>
<basic name="config">
<column name="CONFIGURATION_ID" />
</basic>
<basic name="description">
<column name="SOC_DESCRIPTION" />
</basic>
<basic name="recurrencePattern">
<column name="OMX_RECURRENCE_PATTERN_ID" />
</basic>
<basic name="itemCode">
<column name="ITEM_CODE" />
</basic>
<basic name="discountPercentage">
<column name="DISCOUNT_PERCENT" />
</basic>
<basic name="discountAmount">
<column name="DISCOUNT_AMOUNT" />
</basic>
<basic name="noBackorderFlag">
<column name="NO_BACKORDER_FLAG" />
</basic>
<basic name="active">
<column name="ACTIVE" />
</basic>
<basic name="creationDate">
<column name="CREATION_DATE" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="createdBy">
<column name="CREATED_BY" />
</basic>
<basic name="lastUpdatedBy">
<column name="LAST_UPDATED_BY" />
</basic>
<basic name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</basic>
</attributes>
</entity>
<entity class="com.grc.sdb.beans.offer.BackendOffer">
<table name="S_BACKEND_OFFERS" />
<attributes>
<id name="backendOfferID">
<column name="BACKEND_OFFER_ID" />
<generated-value generator="seqBackendOffers"
strategy="SEQUENCE" />
<sequence-generator name="seqBackendOffers"
sequence-name="seq_backend_offer_id" allocation-size="1" />
</id>
<basic name="backendOfferCode">
<column name="backend_Offer_Code" />
</basic>
<basic name="backendOfferDescription">
<column name="backend_Offer_Description" />
</basic>
<basic name="creationDate">
<column name="creation_date" />
<temporal>TIMESTAMP</temporal>
</basic>
<basic name="createdBy">
<column name="created_by" />
</basic>
<basic name="lastUpdatedBy">
<column name="last_updated_by" />
</basic>
<version name="lastUpdateDate">
<column name="LAST_UPDATE_DATE" />
</version>
<one-to-one name="continuityItem">
<join-column name="continuity_key" nullable="false" insertable="true" updatable="true"/>
<cascade>
<cascade-refresh />
</cascade>
</one-to-one>
</attributes>
</entity>
<embeddable class="com.grc.sdb.beans.offer.OrderDetail">
<attributes>
<basic name="numPayments" />
<basic name="numSHPayments" />
<basic name="firstPaymentAmount" />
<basic name="firstSHAmount" />
<basic name="addlPaymentAmount" />
<basic name="addlSHAmount" />
<basic name="canadaSHAmount" />
<basic name="shipMethod" />
<basic name="shipInterval" />
<basic name="payTable" />
<basic name="billingInterval" />
<basic name="totalPaymentAmount" />
<basic name="paymentPlanId" />
</attributes>
</embeddable>
</entity-mappings>