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

In XxxBean_Roo_ManagedBean.aj, the completeYyy(java.lang.String query) method calls EntityManager#toString

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Complete
    • 1.2.0.RC1
    • 1.2.0.RC1
    • JSF
    • None

    Description

      To replicate, run this script:

      project --topLevelPackage com.example
      jpa setup --database HYPERSONIC_IN_MEMORY --provider HIBERNATE 
      entity jpa --class ~.domain.Thing
      field string name
      web jsf setup 
      web jsf all --package ~.web
      entity jpa --class ~.domain.Owner
      focus --class ~.domain.Thing
      field reference --fieldName owner --type ~.domain.Owner

      The ITD ThingBean_Roo_ManagedBean.aj contains this method:

      public List<Owner> ThingBean.completeOwner(java.lang.String query) {
              List<Owner> suggestions = new ArrayList<Owner>();
              for (Owner owner : Owner.findAllOwners()) {
                  String ownerStr = owner.getEntityManager() +  " "  + owner.getId() +  " "  + owner.getVersion();
                  if (ownerStr.toLowerCase().startsWith(query.toLowerCase())) {
                      suggestions.add(owner);
                  }
              }
              return suggestions;
      }

      It seems wrong to be referencing the EntityManager at all here, let alone calling toString() on it. I've logged this as a bug because my multimodule JSF/MVC project fails to compile (in Maven) at this line.

      Attachments

        Activity

          People

            stewarta Alan Stewart
            aswan Andrew Swan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: