Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gluon mobile 如何获取GluonObservableObject以移除带有Gluon Connect的对象?_Gluon Mobile - Fatal编程技术网

Gluon mobile 如何获取GluonObservableObject以移除带有Gluon Connect的对象?

Gluon mobile 如何获取GluonObservableObject以移除带有Gluon Connect的对象?,gluon-mobile,Gluon Mobile,我想从服务器上的数据库中删除一个对象。我正在使用 RestClient del = RestClient.create().method("DELETE") .host("http://localhost:8080/host") .path("path"); DataProvider.removeObject(???, del.createO

我想从服务器上的数据库中删除一个对象。我正在使用

RestClient del = RestClient.create().method("DELETE")
                                    .host("http://localhost:8080/host")
                                    .path("path");

DataProvider.removeObject(???, 
    del.createObjectDataRemover(MyClass.class)
我需要以某种方式获得一个
GluonObservableObject
,但我不知道该怎么做,因为它没有我可以使用的构造函数。我也不明白为什么我需要传递一个
GluonObservableObject
,而不是像
storeObject
那样传递对象本身。我有一个要存储/删除的对象-我传递它

我还尝试从
GluonObservableList
中检索对象,但它们也只是对象而不是可观察对象


如何删除对象?

DataProvider.removeObject
用于从数据源而不是数据库中删除对象。你检查过样品了吗?有一个
NoteService::remove
方法从数据库中删除该项,该方法由
ListHandler::removietem
调用。您可以在服务器中实现这些方法,然后只需要一个GET/POST-RestClient,路径为
“/remove/{id}”
@JoséPereda,谢谢。我不应该使用DELETE来请求删除而不是GET/POST吗?那么,您也可以使用
@DELETE
来定义REST端点。