0
我目前正在开发一个需要将数据插入到azure Mobile Service数据库中的android应用程序。准确地说,一个id字符串和一个第一个登录整数。但是,正在抛出以下错误。插入数据“MobileServiceTable必须定义一个id属性”
“抛出:IllegalArgumentException:表示MobileServiceTable的类必须定义一个单一的id属性”
id值,我需要插入到数据库中正在使用passId片段接口传递回( )。在这里覆盖的内容是我试图将值插入azure,如下所示。
@Override
public void passId(String id) {
userInstance user = new userInstance();
user.user_id = id;
user.first_login = 0;
mClient.getTable(userInstance.class).insert(user, new TableOperationCallback<userInstance>() {
public void onCompleted(userInstance entity, Exception exception, ServiceFilterResponse response) {
if (exception == null) {
// Insert succeeded
} else {
// Insert failed
}
}
});
移动客户端VAR代表MobileServicesClient如下图所示
try {
mClient = new MobileServiceClient(
"https://xxxx.azure-mobile.net/",
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
this);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (Exception e){
e.printStackTrace();
}
表名,我试图将数据插入到是“USER_TABLE”有没有什么帮助的。
我希望你能提供帮助,并提前感谢你们给我的任何帮助。