在我的Spring Web服务中,我正在使用JPA + Hibernate访问我的sql数据库。 当我更改数据库中的数据库架构时,这些更改不会从我的Web服务中反映出来。

更详细地讲,我在applicationforms表中添加了新列formcategoryid,并将其作为字段添加到JPA注释类。 现在,当我执行查询时

 SELECT x.formid,x.formcategoryid,x.formname FROM com.business.objects.ApplicationForms AS x WHERE x.adminroleid LIKE '3'

它给出了例外,

Caused by: org.hibernate.QueryException: could not resolve property: formcategoryid of: com.business.objects.ApplicationForms

有什么想法吗?


更新

我的ApplicationForms类就像

    package com.business.objects;

    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.Id;
    import javax.persistence.Table;

    @Entity
    @Table(name = "applicationforms")
    public class ApplicationForms {

        @Id
        @GeneratedValue
        private int formid;
        private int formcategoryid;
        private int adminroleid;
        private String formname;
        .
        .


        public int getFormid() {
            return formid;
        }

        public void setFormid(int formid) {
            this.formid = formid;
        }



        public int getFormcategoryid() {
            return formcategoryid;
        }

        public void setFormcategoryid(int formcategoryid) {
            this.formcategoryid = formcategoryid;
        }

        public int getAdminroleid() {
        return adminroleid;
        }

        public void setAdminroleid(int adminroleid) {
        this.adminroleid = adminroleid;
        }

        public String getFormname() {
        return formname;
        }

        public void setFormname(String formname) {
        this.formname = formname;
        }

}

  ask by Thudani Hettimulla translate from so

本文未有回复,本站智能推荐: