HSQL DB的插入语句出错
我有Spring数据休息应用程序和单元测试这些服务,我在内存数据库中使用Spring Boot&HSQL。 但在运行时将数据插入到HSQL表中时,出现错误。 当其他插入语句正在工作时,我只有1个插入语句出现此错误。
错误
造成者:java.sql.SQLException:列计数在语句中不匹配
在SQL文件中插入语句
Insert into countries (ID,COUNTRY,CODE) values (2,'UNITED STATES','US');
注意: - 在同一个应用程序中插入其他表正在工作并从表中检索数据也是成功的。
实体 - 使用此HSQL创建表。
@Entity
@Table(name = "COUNTRIES")
public class Country implements Describable, Serializable {
    @Id
    @SequenceGenerator(name="CountriesSeq",sequenceName="SEQ_COUNTRIES")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "CountriesSeq")
    protected Integer id;
    @Column(name = "CODE")
    private String code;
    @Column(name = "COUNTRY")
    private String country;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getCountry() {
        return country;
    }
    public void setCountry(String country) {
        this.country = country;
    }   
}
谢谢
此问题已解决。 桌子上有触发器,我没有注意到。 感谢您输入Acewin。
链接地址: http://www.djcxy.com/p/88633.html