获取org.postgresql.util.PSQLException:错误:“或”附近的语法错误。在JPA中

时间:2018-08-01 15:17:50

标签: spring postgresql spring-data-jpa jpql

我收到以下错误消息。

2018-08-01 20:32:29.330[0;39m [33m WARN[0;39m [35m11960[0;39m [2m---[0;39m [2m[nio-9092-exec-5][0;39m [36mo.h.engine.jdbc.spi.SqlExceptionHelper  [0;39m [2m:[0;39m SQL Error: 0, SQLState: 42601
[2m2018-08-01 20:32:29.330[0;39m [31mERROR[0;39m [35m11960[0;39m [2m---[0;39m [2m[nio-9092-exec-5][0;39m [36mo.h.engine.jdbc.spi.SqlExceptionHelper  [0;39m [2m:[0;39m ERROR: syntax error at or near "."
  Position: 16
[2m2018-08-01 20:32:29.347[0;39m [31mERROR[0;39m [35m11960[0;39m [2m---[0;39m [2m[nio-9092-exec-5][0;39m [36mo.a.c.c.C.[.[.[/].[dispatcherServlet]   [0;39m [2m:[0;39m Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause

org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
  Position: 16

我想在存储库界面中返回一个如下所示的自定义对象。

@Query(value="SELECT " +
        "   new com.telenor.wipro.logging.jpa.entity.setTPSEntities(COUNT(distinct gu_id), service_name) "
        + "FROM fuse_logs WHERE GROUP BY service_name",nativeQuery=true)
public List<FuseTPS> findByTPS();

请帮助。

0 个答案:

没有答案