org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped

后端 未结 19 1720
滥情空心
滥情空心 2020-12-04 14:59

I have example web application Hibernate 4.3.5 + Derby database 10.10.1.1+ Glassfish4.0 with IDE NetBeans 8.0Beta.

I have the next exception:

Caused          


        
19条回答
  •  Happy的楠姐
    2020-12-04 15:25

    If you are using the JPA annotations to create the entities and then make sure that the table name is mapped along with @Table annotation instead of @Entity.

    Incorrectly mapped :

    @Entity(name="DB_TABLE_NAME")
    public class DbTableName implements Serializable {
       ....
       ....
    }
    

    Correctly mapped entity :

    @Entity
    @Table(name="DB_TABLE_NAME")
    public class DbTableName implements Serializable {
       ....
       ....
    }
    

提交回复
热议问题