I am getting Error like:
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]; I have created the Modal like given below
@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 } My Dao Implementation:
@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; } } I am missing something.
I am not able to identify what exactly.