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

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Complete
    • 1.2.5.RELEASE
    • 1.3.0.RELEASE
    • PERSISTENCE
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: