将具有复合主键的PK类传递给REST资源

时间:2012-12-11 17:30:22

标签: java rest key composite

我正在开发一个Java Web项目,它使用NetBeans的自动机制从实体类创建RESTful Web服务(NetBeans 7.2,服务器GlassFish 3.1.2)。当我创建具有复合主键的实体类时,会创建两个类:EntityClassEntityClassPK,使用@Embeddable@EmbeddedId进行注释。我尝试使用GETREMOVE REST资源。

应用程序部署正常,但是当我在NetBeans中尝试操作"Test RESTful Web Services"时,WADL无法打开并附加此server.log:

SEVERE: The following errors and warnings have been detected with resource and/or provider classes: SEVERE: Missing dependency for method public void service.ColocacionesbyMadFacadeREST.remove(entity.ColocacionesbyMadPK) at parameter at index 0 
SEVERE: Method, public void service.ColocacionesbyMadFacadeREST.remove(entity.ColocacionesbyMadPK), annotated with DELETE of resource, class service.ColocacionesbyMadFacadeREST, is not recognized as valid resource method. 
SEVERE: Missing dependency for method public entity.ColocacionesbyMad service.ColocacionesbyMadFacadeREST.find(entity.ColocacionesbyMadPK) at parameter at index 0 
SEVERE: Method, public entity.ColocacionesbyMad service.ColocacionesbyMadFacadeREST.find(entity.ColocacionesbyMadPK), annotated with GET of resource, class service.ColocacionesbyMadFacadeREST, is not recognized as valid resource method.

任何想法?谢谢!

0 个答案:

没有答案