如何在AngularJS JavaScript中使用Objectify



我是Angularjs编程的新手。我正在尝试将数据插入Google Cloud Endpoints JavaScript,但是我们可以通过创建新类并添加Objectify来在Java中进行。如何在JavaScript中使用类对象并使用Objectify @ID对字符串进行报道。当我获得" com.googlecode.obignify.saveexception:错误保存com.example.mohanvaradarajan.app:无法用null String @ID @ID:com.example.mohanvaradarajan.app"响应

"
$scope.callgapi = function () {
                   $scope.gresult = "Inserting data...";
                   GApi.execute('myApi', 'insert',datanew).then(function (resp) {
                       $scope.gresult = resp.result.data;
                   }, function (resp) {
                       console.log('Error: (' + resp);
                       $scope.gresult="An error has occurred.";
                   });
               }

问题是服务器端。您拥有一个具有String ID的实体,并且没有初始化它。如果您想要自动化ID,请使用Long作为ID类型。

最新更新