【发布时间】:2014-07-05 20:59:49
【问题描述】:
我正在使用 Google App engine1.9.3、Eclipse、Objectify5.03。我的班级如下:
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Load;
@Entity
public class User {
@Id private Long userId;
private String userName;
@Load private Ref<UserDetails> userDetails;
@Load private Ref<UserPassword> userPassword;
//getters & setters
}
当我尝试通过 Eclipse 为此类创建 google 端点时,我收到以下错误: java.lang.IllegalArgumentException:不支持参数化类型 com.googlecode.objectify.Ref
这是我第一次尝试 Objectify。
任何想法我做错了什么。从我目前所读到的任何内容来看,GAE 端点和 Objectify 应该可以工作,对吗?
【问题讨论】:
-
您可能应该用与 Endpoints 相关的内容来标记这个问题,因为那是可以回答您问题的社区。span>
-
我猜你的
User类会有一个getter 来返回UserDetails和UserPassword对象,而不是它们各自的Ref<>s?如果是这样,您可能需要查看 Endpoint annotation docs 中的@ApiResourceProperty,因为您可能需要告诉 Cloud Endpoints 忽略您的私有 ObjectifyRef<>成员。
标签: eclipse google-app-engine google-cloud-endpoints objectify