Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#33 Bi-directional relationships are mapped with 2 unidirections

open
Niko Schmuck
5
2005-09-29
2005-09-29
jjy
No

Channel and Item should be a single bi-directional
mapping. However from the current head of CVS, the
mapping files are defining 2 unidirectional relationships.

Currently Channel has a one-to-many uni relationship to
Item. And Item has a many-to-one uni relationship to
Channel.

It's important to fix this so that hibernate would not get
confused during deleting and update operations.

Discussion

  • jjy
    jjy
    2005-09-30

    Logged In: YES
    user_id=1353701

    Correction: The one-to-many and many-to-one relationships
    mappings from channel->item are correctly mapped as bi-
    directional.

    The one-to-one mapping in the channel object are correct and
    are intentionally left as uni-directional.

    The intended bi directional one-to-one mapping at the item
    level are mapped as 2 uni-directional mappings.
    Item->ItemGuid
    Item->ItemSource
    Item->ItemEnclosure

    According to hibernate documentation, child objects like
    ItemGuid should be using a one-to-one mapping instead.