Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-1685

Problem with identifierField attribute on @RooEntity annotation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.6.0.RELEASE
    • Fix Version/s: 2.7.0.M1
    • Component/s: ROO
    • Environment:
      Windows XP

      Description

      If I specify and identifierField with a value other than "id" the <entity>_Roo_Entity.aj file has an error. For example, if I specify the following annotation on an entity named Document:

      @RooEntity(identifierField = "tid")

      the file Document_Roo_Entity.aj is modified to have the following code snippet:

      @Transactional
      public static Document Document.findDocument(Long id) {
      if (id == null) return null;
      Query query = entityManager().createQuery("select o from Document o where o.tid = :id").setParameter("id",tid);

      The parameter to the findDocument as well as the if statement should use the tid variable name. The same situation will be encountered if I use the --indentifierField option on the entity roo command.

        Attachments

          Activity

            People

            • Assignee:
              cdupuis Christian Dupuis
              Reporter:
              marioja Mario Jauvin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: