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

Compilation error on Jpa_ActiveRecord.aj when Abstract class implements an Interface

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.2.5.RELEASE
    • Fix Version/s: 1.3.0.RELEASE
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      When an Abstract-entity-class implements an interface, the related Jpa_ActiveRecord.aj is generated with a compilation error.

      Example:

      1. Launch clinic.roo
      2. Create an interface AnInterface on domain package:

      AnInterface.java
      public interface AnInterface {
          public int getInt();
      }
      

      3. Make AbstractPerson implements AnInterface

      AbstractPerson.java
      @RooJavaBean
      @RooToString
      @RooJpaActiveRecord
      public abstract class AbstractPerson implements AnInterface {
      
      ...
      

      4. Implements getInt() on Owner and Vet

      Vet.java
      ...
          public int getAnInt(){
            return 0;
          }
      ...
      

      When you run mvn clean compile you get:

      [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project petclinic: Compiler errors:
      [ERROR] error at EntityManager em = new AbstractPerson() {
      [ERROR] ^^^^^^^
      [ERROR] /../.../src/main/java/com/springsource/petclinic/domain/AbstractPerson_Roo_Jpa_ActiveRecord.aj:18:0::0 The type new AbstractPerson(){} must implement the inherited abstract method AnInterface.getAnInt()
      

      A project backup with this example is attached.

        Attachments

          Activity

            People

            • Assignee:
              jcgarcia Juan Carlos García del Canto
              Reporter:
              jmvivo Jose Manuel Vivó ( Chema ) - DISID.
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: