0
我正在使用Roo 1.3.2。我有一個抽象類,具體實現如下:Spring Roo在ActiveRecord.aj中爲EntityManager生成錯誤
@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){
....
}
}
然而ActiveRecord.aj文件生成產生以下代碼
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;
}
而且從IDE的錯誤消息:
The type new Task(){} must implement the inherited abstract Task.execute(Object ...)
如果我從Task類中刪除抽象關鍵字,則錯誤消失,因爲Roo不會嘗試生成上面列出的代碼。
我該如何得到這個工作?這是一個Roo錯誤嗎?
感謝您的回覆,我會嘗試一下您的建議。我已經記錄了一個錯誤。出於興趣,你可以在這裏找到[ROO-3688](https://jira.spring.io/browse/ROO-3688?jql=project%20%3D%20ROO) – Neriyan
謝謝你報告:) – jmvivo