我在服务器端编写如下代码并生成云端点类。我生成云端点客户端库以在客户端使用它。
package com.my;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.persistence.Entity;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.Named;
@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class Process {
@PrimaryKey
@Persistent
private long UID;
@Persistent
private String Key;
/* public Process(long uid, String ki){
this.setUID(uid);
this.setKey(ki);*/
//}
public long getUID() {
return UID;
}
public void setUID(long uID) {
UID = uID;
}
public String getKey() {
return Key;
}
public void setKey(String key) {
Key = key;
}
public void test(){
}
}
然后在客户端,当我尝试使用setter / getters时,它正在工作。但是,我不能使用测试方法。我检查了客户端生成的库,它没有测试方法。
我必须使用数据存储区,所以我需要@Persistent。我也尝试过@ApiMethod,但它没有用。
我想知道如何在云端点客户端库中添加除setter / getters之外的方法? 感谢