Specify relationship in mapping using some condition not just id's.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CatchSandeepVaid
    New Member
    • Apr 2009
    • 15

    #1

    Specify relationship in mapping using some condition not just id's.

    Say i have one-to-one relationship
    Say i have one-to-many relationship between Product and ProductNames
    Product ----> PID (PK)
    ProductNames------> PID, USECODE, STARTTIME as composite ID and ENDTIME is another normal column.

    Now i want to fetch product with PID='1' and USECODE='100' and STARTTIME < CURRENTTIME < ENDTIME.

    CURRENTTIME value will be known at runtime.

    How to specify this in mapping and fetch Product & ProductNames using eager fetching?
Working...