@RooWebJson生成无效的Aspect文件

时间:2012-02-07 23:34:42

标签: java json aspectj spring-roo

我有一个简单的对象:

@RooJavaBean
@RooToString
@RooJpaActiveRecord
@RooJson
public class HJAddress {
    private String id;

}

一个简单的空控制器:

@RooWebJson(jsonObject = HJAddress.class)
@Controller
@RequestMapping("/hjaddresses")
public class HJAddressController {

}

Roo为控制器生成的.aj文件很好,除了deleteFromJson方法的结尾。它总是为我生成编译器错误。看着它,它确实:

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
public ResponseEntity<String> HJAddressController.deleteFromJson
        (@PathVariable("id") Long id) {
    HJAddress hJAddress = HJAddress.findHJAddress(id);
    HttpHeaders headers = new HttpHeaders();
    headers.add("Content-Type", "application/json");
    if (hJAddress == null) {
        return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
    }
>>> HJAddress_.remove();
    return new ResponseEntity<String>(headers, HttpStatus.OK);
}

就在最后,它说HJAddress_.remove()而不是hJAddress.remove()。所有其他方法确实使用此HJAddress_命名方案。

我不确定从哪里开始,因为它是Roo内部的东西。

编辑:这是基于eclipse indigo使用roo 1.2和STS。

1 个答案:

答案 0 :(得分:0)