Details

      Description

      Service Builder's one to many mapping is useless.

      The reasons are very simple:
      1) On the one side, we generate sql like this(Use TrashEntry as example):
      SELECT

      {TrashVersion.*} FROM TrashVersion INNER JOIN TrashEntry ON (TrashEntry.entryId = TrashVersion.entryId) WHERE (TrashEntry.entryId = ?)

      This is logically the same as :
      SELECT {TrashVersion.*}

      FROM TrashVersion WHERE (TrashVersion.entryId = ?)

      The inner join is useless and inefficient.

      The service layer should contain the business logic to eliminate the possibility that we have a "Many side record without the one side counterpart".

      2) On the many side, we already generate a finder to the one side, i.e. TrashEntry, that would be the "EntryId" finder in TrashVersion.
      Since we inject all persistence automatically into service, developer can always call the many side finder to do the query which is much more efficient at both the sql level and cache level.

        Attachments

          Activity

            People

            • Assignee:
              david.truong David Truong
              Reporter:
              shuyang.zhou Shuyang Zhou
              Recent user:
              Shalaka Tendulkar
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Subcomponents