When I try to create any query to database with Hibernate, i get the same error: Error code
DaoMethod:
@Override
public List findAll() {
openCurrentSessionWithTransaction();
List books = currentSession.createQuery("from AuthorEntity").list();
closeCurrentSessionWithTransaction();
return books;
}
AuthorEntity(Setters and hashcode&equals are present but hidden):
import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "author")
public class AuthorEntity {
private long authorId;
private String name;
@Id
@Column(name = "author_id")
public long getAuthorId() {
return authorId;
}
@Basic
@Column(name = "name")
public String getName() {
return name;
}
}
Why does this error occur? I do this on IntellijIdea 2018, Java 1.8. hibernate.cfg.xml