Я получаю сообщение об ошибке типа:
org.hibernate.hql.internal.ast.QuerySyntaxException: Employee is not mapped [from Employee]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Employee is not mapped [from Employee]",
"trace": "org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: Employee is not mapped [from Employee];
Я создал модал, как показано ниже
@Entity
@Table(name="employee_list")
public class Employee {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column
private Integer id;
@Column
private String name;
@Column
private String gender;
@Column
private String department;
@Column
private Date dob;
// getters/setters
}
Моя реализация Дао:
@Repository
public class EmployeeDAOImpl implements EmployeeDAO {
@Autowired
private EntityManager entityManager;
@Override
public List<Employee> get() {
Session currentSession = entityManager.unwrap(Session.class);
Query<Employee> query = currentSession.createQuery("from Employee", Employee.class);
List<Employee> list = query.getResultList();
return list;
}
}
Я что-то упустил.
Я не могу точно определить, что именно.