如何解决为什么绑定变量数量无效?
我像这样覆盖 CQL 语句:
@Query("INSERT INTO message (content,email,magic_number,title) VALUES (?,?,?);")
Message save(Message message);
但是 Spring 抛出了无效数量的绑定变量。
这里出了什么问题?
编辑:
我正在添加消息类:
@Table(value = "message")
@Data
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class Message {
@Column("email")
private String email;
@Column("title")
private String title;
@Column("content")
private String content;
@PrimaryKey
@Column("magic_number")
private int magicNumber;
}
还有 json whitch 被发送到 api:
{
"email": "name@example.com","title": "title","content": "text123","magic_number": 101
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。