gpt4 book ai didi

java - 如何使用ReSTClient API将空参数传递给执行Web Service的方法

转载 作者:行者123 更新时间:2023-11-30 03:05:35 25 4
gpt4 key购买 nike

我正在使用 WizTools.org RESTClient 3.2.2 并希望将输入参数传递为

{
"user_id": "",
"user_email_id": "a@a.a",
"user_password": "fdsdsdf",
"firstname": "sdfsdf",
"lastname": "sfdsdfds",
"mobile_number": "1234567890",
"user_status": 1,
"isdeleted": 0,
"created_by": 1,
"profile_picturename": "kfksdjfhksjd",
"address": "sfdsdfsd"

}

在这里创建一条新记录,我想将用户ID传递为“user_id”:“”,但其余客户端显示异常为“java.sql.SQLException:不正确的整数值:''对于行中的列'pv_user_id' 44 英寸

任何人都可以建议我如何将 null 值传递给 userID,我的模型类如下

@Column(name = "user_id")
private String user_id;
@Id
@Column(name = "user_email_id")
@NotEmpty(message = "Please enter your email_Id.")
@Email
@NotNull(message = "Enter last name")
private String user_email_id;
@NotEmpty(message = "Please enter your password.")
@Column(name = "user_password")
private String user_password;
@NotNull(message = "Enter last name")
@NotEmpty(message = "Please enter your firstName.")
@Column(name = "firstname")
private String firstname;
@NotNull(message = "Enter last name")
@NotEmpty(message = "Please enter your lastName.")
@Column(name = "lastname")
private String lastname;
// @NotNull
@NotEmpty
@Pattern(regexp = "(^[0-9]{10,12}$)", message = "Please enter your Mobile Number.")
@NumberFormat
// @Size(min = 10, max = 12)
@Column(name = "mobile_number")
private String mobile_number;
@Column(name = "user_status")
private Integer user_status;
@Column(name = "isdeleted")
private Integer isdeleted;
@Column(name = "created_by")
private Integer created_by;
@Column(name = "profile_picturename")
private String profile_picturename;
@Column(name = "address")
private String address;

提前致谢

最佳答案

如果您不传递 userId 参数,它将采用 userId=null,因为 userId 是 String,如果您不传递任何内容,它将自动将其视为 null。

即使这个链接也有助于理解原因..

What is a Java String's default initial value?

关于java - 如何使用ReSTClient API将空参数传递给执行Web Service的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34852956/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com