미해결
자바 ORM 표준 JPA 프로그래밍 - 기본편
Custom Dialect 관련 질문있습니다.
안녕하세요.
저는 기본문법에서 Custom Dialect로 세팅 뒤 group_concat을 사용하는 부분을 듣고있는데요.
아래와 같은 에러가 발생해서 질문드립니다.
현재 세팅에서는 Gradle과 Postgresql 을 사용중인데요.
호출한 query는 아래와 같고,
String query = "select group_concat(m.username) From Member m";
Custom Dialect 구현체는 다음과 같습니다.
public MyPostDialect() { super(); this.registerFunction("group_concat", new StandardSQLFunction("group_concat", new StringType()));}
ERROR: ERROR: function group_concat(character varying) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 60
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1613)
at org.hibernate.query.Query.getResultList(Query.java:165)
at jpql.JpaMain.main(JpaMain.java:41)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:103)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2297)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2050)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2012)
at org.hibernate.loader.Loader.doQuery(Loader.java:948)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
at org.hibernate.loader.Loader.doList(Loader.java:2843)
at org.hibernate.loader.Loader.doList(Loader.java:2825)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2657)
at org.hibernate.loader.Loader.list(Loader.java:2652)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:506)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1414)
at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1636)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1604)
... 2 more
Caused by: org.postgresql.util.PSQLException: ERROR: function group_concat(character varying) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 60
혹시 어느 부분을 수정해야되는지 알 수 있을까요 ?