public class ProjectMySQL5InnoDBDialect extends MySQLDialect {
public ProjectMySQL5InnoDBDialect() {
super();
registerFunction("GROUP_CONCAT", new StandardSQLFunction("GROUP_CONCAT"));
}
}
spring:
profiles: db
application:
name: db
jpa:
show-sql: false
atabase-platform: com.........core.dialect.ProjectMySQL5InnoDBDialect
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
properties:
database-platform: com.........core.dialect.ProjectMySQL5InnoDBDialect
hibernate:
enable_lazy_load_no_trans: true
dialect: com.........core.dialect.ProjectMySQL5InnoDBDialect
@Repository
public interface ArticleCategoryContentViewRepository extends JpaRepository<ArticleCategoryContentView, String> {
@Query(
"select new ArticleCategoryContentView(" +
"a.contentImage," +
"a.contentTitle," +
"function('GROUP_CONCAT', a.categoryTitle)," +
"...%',COALESCE(:search,''),'%')" +
" group by a.contentImage, a.contentTitle, a.contentHddnCd, a.contentRegDt, a.contentNo"
)
Page<ArticleCategoryContentView> findArticleContent(
@Param("articleCategoryTypeCd") ArticleCategoryTypeCd articleCategoryTypeCd,
@Param("categoryNo") Long categoryNo,
@Param("lang") LangCd lang,
@Param("search") String search,
Pageable pageable);
}