GAE后端服务插入不起作用

时间:2016-04-13 18:34:54

标签: google-app-engine google-cloud-endpoints backend

我的实体类是

  with  cte
          as (select  cp.parent_payee_id,
                      cp.payee_id,
                      cp.payee_pct,
                      0 as level
              from    dbo.tp_contract_payee cp
              where   cp.participant_id = 12067
                      and cp.payee_id = cp.parent_payee_id
              union all
              select  cp.parent_payee_id,
                      cp.payee_id,
                      cp.payee_pct,
                      c.level + 1 as level
              from    dbo.tp_contract_payee cp
              inner join cte c
              on      cp.parent_payee_id = c.payee_id
              where   cp.participant_id = 12067
             )
    select  *
    from    cte

我生成了一个端点类,然后将其部署到GAE。

我去了api explorer

@PersistenceCapable
public class User {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;

    @Persistent
    private String userName;

    @Persistent
    private String password;

    public User() {

    }

    public User(String userName, String password) {
        this.userName = userName;

        this.password = password;

    }

    public String getUserName() {
        return userName;

    }

    public void setUserName(String userName) {
        this.userName = userName;

    }

    public String getPassword() {
        return password;

    }

    public void setPassword(String password) {
        this.password = password;

    }

    public Key getId() {
        return id;
    }
}

1 个答案:

答案 0 :(得分:0)

调用方法NullPointerException时,您有一个UserEndpoint.containsUser(UserEndpoint.java:152)。 您的异常包含在应用程序上的google api端点层提供的后端服务异常类中。 只需检查该课程上的代码,您就会发现问题所在。