Mam encję Comment
@Entity
@Table(name = "comments")
public class Comment {
// ...
}
CommentDaoImpl z metodą
@Override
@Transactional
public List<Comment> findAllPublishedByArticleId(int articleId) {
return sessionFactory.getCurrentSession().createQuery("from Comment where articleId = :articleId")
.setParameter("articleId", articleId).list();
}
i do tego cfg Hibernate
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">false</property>
<mapping class="path.to.model.Comment" />
</session-factory>
</hibernate-configuration>
Suma sumarum wywołuje mi to błąd:
HTTP Status 500 - Request processing failed; nested exception is org.hibernate.hql.internal.ast.QuerySyntaxException: Comment is not mapped [from Comment where articleId = :articleId]
Mapowanie Hbn niby mam, pole articleId w Comment istnieje i już nie wiem o co chodzi...