[ROO-3688] Generating errors in ActiveRecord.aj for EntityManager Created: 26/Nov/15  Updated: 07/Jan/16  Resolved: 07/Jan/16

Status: Resolved
Project: Spring Roo
Component/s: PERSISTENCE
Affects Version/s: 1.3.2.RELEASE
Fix Version/s: 2.0.0.M2

Type: Bug Priority: Minor
Reporter: Neriyan Assignee: Juan Carlos García del Canto
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

STS 3.7.1


Reference URL: http://stackoverflow.com/questions/33868300/spring-roo-generating-errors-in-activerecord-aj-for-entitymanager

 Description   

I have an abstract class and a concrete implementation as follows:

@RooJavaBean
@RooToString
@RooJpaActiveRecord(inheritanceType="TABLE_PER_CLASS")
public abstract class Task {
@Size(min = 2)
private String name;
public abstract void execute(Object... parameters);
}

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class ImportLoadPlanTask extends Task {
@Size(min = 2)
private String svnFile;

@Override
public void execute(Object... parameters)

{ .... }

}

However the ActiveRecord.aj file generated produces the following code:

public static final EntityManager Task.entityManager() {
EntityManager em = new Task() {
public void execute(java.lang.Object parameters)

{ throw new UnsupportedOperationException(); }

}.entityManager;
if (em == null) throw new IllegalStateException("Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)");
return em;
}

And the error message from the IDE is :

The type new Task(){} must implement the inherited abstract Task.execute(Object ...)

This looks like a Roo bug.



 Comments   
Comment by Juan Carlos García del Canto [ 07/Jan/16 ]

Solved on ROO-3689

ActiveRecord data model support has been removed in favor of the Repository (Spring Data) based one.

Generated at Tue Oct 22 23:48:07 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.