Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: APPLICATION is not mapped

2.87K viewsExceptionJava
0

Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: APPLICATION is not

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crudServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genRepository': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JpaRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract int
Mounika Changed status to publish October 28, 2020
Add a Comment
0
Solution 1:
Please just add nativeQuery = true
@Query( value = "any sql query .........", nativeQuery = true)

Example :
@Query(value="select * from Employee",nativeQuery = true)
public List<employee> getEmployeesList();


Solution 2:
There is a table name issue, the table name not matched, please check your table name once.

Wromg Query :
String queryParam = "FROM EMPLOYYE";
Query query = session.createQuery(queryParam);
List employeesList = query.list();


Currect Query :
String queryParam = "FROM Employee";  
Query query = session.createQuery(queryParam);
List employeesList = query.list();

 

Mounika Changed status to publish October 28, 2020
Add a Comment
Write your answer.