我用GAE创建了一个简单的项目,然后我将我的软件包放入' model' PMF.java(Persistence Manager Factory类)和一个类(Employee.java),我可以在这里向您展示:
@PersistenceCapable
public class Employee {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String firstName;
@Persistent
private String lastName;
@Persistent
private Date hireDate;
public Employee(String firstName, String lastName, Date hireDate) {
this.firstName = firstName;
this.lastName = lastName;
this.hireDate = hireDate;
}
// Accessors for the fields. JDO doesn't use these, but your application does.
public Key getKey() {
return key;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public Date getHireDate() {
return hireDate;
}
public void setHireDate(Date hireDate) {
this.hireDate = hireDate;
}
}
当我点击Google->生成Cloud Enpoint客户端库时,我收到以下错误消息:
Error in Generating API: this project does not have cloud endpoint classes
。这是什么意思?非常感谢你
答案 0 :(得分:1)
您已经完成了第一部分,即创建了您的模型。
当您尝试生成Cloud Endpoint Client Library时,该工具会查找使用@API注释进行注释的Java类,以便它知道哪些类是您的端点。
您应该尝试的是以下一系列步骤:
Employee
Employee
生成端点类。生成Cloud Endpoint类。这将生成Endpoint类EmployeeEndpoint以及PMF。的java。