使用hibernate时出现 staff is not mapped [from staff a where a.username=?];

我检查之后发现数据库内的字段名和我建立的实体类和映射类的字段名相同,所以不存在是字段名的问题引起的。它的错误语句是: List<Staff> list= (List<Staff>) this.getHibernateTemplate().find("from staff a where a.username=?", username);其中staff是我数据库中表的名字。我建立的实体类是大写的Staff。这里应该是实体类名,而不应该是表名。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-04-16
  • 2022-12-23
  • 2021-06-16
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2021-10-12
  • 2021-06-13
  • 2022-02-21
  • 2022-12-23
  • 2021-06-14
  • 2021-06-10
相关资源
相似解决方案