日期:2014-05-17  浏览次数:20906 次

这是个什么错?求大神帮忙!!!
org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.article.model.UserInfo.articlecontent#admin]

下面是两个实体类
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "UserInfo", schema = "scott")
public class UserInfo {
        private String username;// varchar2(50) primary key, --用户名称
        private String pasword;// varchar2(50) , --密码
        private String email;// varchar2(50) not null,--电子邮箱
        private String telepone;// varchar2(12),--电话
        private int logintimes;// default(0),--登录次数
        private String articIDs;// varchar2(1000)--文章编号
        private Set<ArticleContent> articlecontent = new HashSet<ArticleContent>();

        @Id
        @GeneratedValue
        public String getUsername() {
                return username;
        }

        public void setUsername(String username) {
                this.username = username;
        }

        public String getPasword() {
                return pasword;
        }

        public void setPasword(String pasword) {
                this.pasword = pasword;
        }

        public String getEmail() {
                return email;
        }

        public void setEmail(String email) {
                this.email = email;
        }

        public String getTelepone() {
                return telepone;
        }

    &nbs