Details

    • Similar Issues:
      Show 5 results 

      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.

        Activity

        Hide
        Shuyang Zhou added a comment -

        It worked, in an inefficient way. But it may be used by some customers.

        All usage can be safely switched to the many side finder.

        Show
        Shuyang Zhou added a comment - It worked, in an inefficient way. But it may be used by some customers. All usage can be safely switched to the many side finder.

          People

          • Assignee:
            David Truong
            Reporter:
            Shuyang Zhou
            Recent user:
            Randy Zhu
            Participants of an Issue:
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Structure Helper Panel