Applying the Hibernate filter attribute to a Bag with a many-to-many relationship

前端 未结 1 518
夕颜
夕颜 2020-12-30 07:07

Consider the following Hibernate mapping file:



    

        
相关标签:
1条回答
  • 2020-12-30 07:55

    Figured it out. For anyone interested, I had my <filter> attribute in the wrong place:

    Before:

    <bag name="Clips" table="ctv_bb_contentAudVidLinks">
      <key column="fk_contentPackageId"></key>
      <many-to-many class="Clip" column="fk_AudVidId"></many-to-many>
      <filter name="effectiveDate" condition=":asOfDate BETWEEN startDate and endDate" />
    </bag>
    

    After:

    <bag name="Clips" table="ctv_bb_contentAudVidLinks">
      <key column="fk_contentPackageId"></key>
      <many-to-many class="Clip" column="fk_AudVidId">
        <filter name="effectiveDate" condition=":asOfDate BETWEEN startDate and endDate" />
      </many-to-many>
    </bag>
    
    0 讨论(0)
提交回复
热议问题