次の問題があります: https://*.appspot.com/_ah/api#p/questionendpoint/v1/questionendpoint.removeQuestion に移動し、たとえば "ahFzfnRyaXZpYWwtcGVyc3VpdHIQCxIIUXVlc3Rpb24Y4toBDA2" のような文字列 ID を入力すると、すべて正常に動作します。
私のページから次のコードを呼び出すと、削除に失敗します。なんで?私は何を間違っていますか?removeQuestion
上記と同じキーで関数を呼び出します...しかし、機能しません...req
正しく見え、正しいrpcParams、文字列キーが含まれています。そして data は value を保持しますfalse
。何が間違っているのかわかりません...
var req = gapi.client.questionendpoint.removeQuestion(key);
req.execute(function( data )
{
addInfo(data);
});
エンドポイント関数は次のようになり、機能しています (_ah/api/...
リンクを介して)
@ApiMethod(name = "removeQuestion")
public Question removeQuestion(@Named("id")
String id)
{
EntityManager mgr = getEntityManager();
Question question = null;
try
{
question = mgr.find(Question.class, id);
mgr.remove(question);
}
finally
{
mgr.close();
}
return question;
}
私の質問クラスのキーは次のように定義されています:
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
private String key;