Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2388

Roo Finder is not correctly generated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.3.RELEASE
    • Fix Version/s: 1.1.4.RELEASE
    • Component/s: None
    • Labels:
      None
    • Environment:
      STS 2.6.0.RELEASE
      DBSystem: Mysql

      Description

      public static TypedQuery<Controlway> Controlway.findControlwaysByGroups(Set<Controlgroup> groups) {
      if (groups == null) throw new IllegalArgumentException("The groups argument is required");
      EntityManager em = Controlway.entityManager();
      StringBuilder queryBuilder = new StringBuilder("SELECT o FROM Controlway AS o WHERE");
      for (int i = 0; i < groups.size(); i++)

      { if (i > 0) queryBuilder.append(" AND"); queryBuilder.append(" :groups_item").append(i).append(" MEMBER OF controlway.groups"); // here the 'controlway' is wrong if i change it to 'o' than it works }

      TypedQuery<Controlway> q = em.createQuery(queryBuilder.toString(), Controlway.class);
      int groupsIndex = 0;
      for (Controlgroup _controlgroup: groups)

      { q.setParameter("groups_item" + groupsIndex++, _controlgroup); }

      return q;
      }

      If I start the Roo shell it will override my changes and this is very annoying

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stewarta Alan Stewart
              Reporter:
              matthes matthias
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: