OpenJPA
  1. OpenJPA
  2. OPENJPA-357

Use case where FetchGroup A includes FecthGroup B is not honoured by fetch operations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.7, 1.0.0
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Given:
      Fetch group A contains

      {x,y}

      Fetch group B contains

      {z}.
      Fetch group A includes Fetch group B

      Assertions:
      1. Any fetch operation with fetch group A should fetch {x,y,z}.
      2. Any fetch operation with fetch group B should fetch {z}

      .

      Currently,
      Assertion #2 fails.

        Issue Links

          Activity

          Hide
          Teresa Kan added a comment -

          private boolean includes(FieldMetaData fmd) {
          String fmdName = fmd.getFullName(false);

          • if* ((fmd.isInDefaultFetchGroup() && hasFetchGroup(FetchGroup.*
            NAME_DEFAULT*))|| hasFetchGroup(FetchGroup.NAME_ALL)

          return true;

          // check any LoadFetchGroup associates with this field. We need to

          // include this LoadFetchGroup for fetch

          String[] fgs = fmd.getCustomFetchGroups();

          for (int i = 0; i < fgs.length; i++) {

          if (hasFetchGroup(fgs[i])) {

          String fg = fmd.getLoadFetchGroup(); //kan

          if (fg != null) { //kan

          if (!hasFetchGroup(fg))

          { //kan addFetchGroup(fg); //kan }

          }

          return true;

          }

          }

          return false;

          }

          On 9/8/07, Pinaki Poddar (JIRA) <jira@apache.org> wrote:

          Show
          Teresa Kan added a comment - private boolean includes(FieldMetaData fmd) { String fmdName = fmd.getFullName( false ); if* ((fmd.isInDefaultFetchGroup() && hasFetchGroup(FetchGroup.* NAME_DEFAULT*))|| hasFetchGroup(FetchGroup. NAME_ALL ) return true ; // check any LoadFetchGroup associates with this field. We need to // include this LoadFetchGroup for fetch String[] fgs = fmd.getCustomFetchGroups(); for ( int i = 0; i < fgs.length; i++) { if (hasFetchGroup(fgs [i] )) { String fg = fmd.getLoadFetchGroup(); //kan if (fg != null ) { //kan if (!hasFetchGroup(fg)) { //kan addFetchGroup(fg); //kan } } return true ; } } return false ; } On 9/8/07, Pinaki Poddar (JIRA) <jira@apache.org> wrote:
          Hide
          Michael Dick added a comment -

          Is this fix complete in trunk? If so we should merge the changes into 1.0.x.

          Show
          Michael Dick added a comment - Is this fix complete in trunk? If so we should merge the changes into 1.0.x.
          Hide
          Pinaki Poddar added a comment -

          First attempt to fix this and related OPENJPA-358
          is SVN revision 573750
          http://svn.apache.org/viewvc?rev=573750&view=rev

          Verified against the current test corpus and Teresa Kan's test cases.

          To Do: Write more test cases or integrate Teresa's cases.

          Show
          Pinaki Poddar added a comment - First attempt to fix this and related OPENJPA-358 is SVN revision 573750 http://svn.apache.org/viewvc?rev=573750&view=rev Verified against the current test corpus and Teresa Kan's test cases. To Do: Write more test cases or integrate Teresa's cases.

            People

            • Assignee:
              Pinaki Poddar
              Reporter:
              Pinaki Poddar
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development