java - org.hibernate.exception.SQLGrammarException : could not execute query

标签 java hibernate hibernate-mapping playframework

我用的是游戏框架!!但是当我运行我的项目时,它给了我这个

org.hibernate.exception.SQLGrammarException: 无法执行查询

谁能帮帮我?

这是我的模型:

package models;
import java.util.*;
import javax.persistence.*;
import play.db.jpa.*;
import play.db.jpa.Model;

@Entity
@Table(name="GxkAccount")
public class GxkAccount extends Model {

    private String Account;
    private String Psw;

    public String getAccount() {
        return Account;
    }
    public void setAccount(String account) {
        Account = account;
    }
    public String getPsw() {
        return Psw;
    }
    public void setPsw(String psw) {
        Psw = psw;
    }

    public static List<GxkAccount> GetList()
    {
        List<GxkAccount> infoList=GxkAccount.findAll();
        return infoList;
    }


}

最佳答案

您完全缺少类属性的映射注释。

P.S. 请尽量关注Java naming conventions

关于java - org.hibernate.exception.SQLGrammarException : could not execute query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4083949/

相关文章:

线程 "AWT-EventQueue-0"java.lang.StackOverflowError 中的 Java 错误异常

java - org.postgresql.util.PGobject 无法转换为 org.postgis.PGgeometry

Java Hibernate将对象保存在一个数据库中的不同模式中

java - 滑动拼图,开关图标

java - 如何为 ListView 项目设置高亮颜色?

java - 一段时间不活动后,我得到 'No more data to read from socket'。 Weblogic 和 Oracle 数据库

java - Hibernate 包内的唯一性

java - 使用 JPA 时多个数据源抛出错误

java - 删除实体@OneToMany @ManyToOne。键仍然从表中引用

java - JPA 嵌套映射到没有基表的 View