hibernate不能实现的数据库函数怎么使用呢

重写hibernate方言

package com.ayu.hibernate.test;

import org.hibernate.Hibernate;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.function.StandardSQLFunction;

public class AyuMySQLDialect extends MySQLDialect {

protected void registerVarcharTypes() {
   registerFunction("group_concat", new StandardSQLFunction("group_concat",Hibernate.STRING));
}
}

com.ayu.hibernate.test.AyuMySQLDialect

hql语句:select f.fid,group_concat(f.fname) from Fund f group by f.user.uid

你可能感兴趣的:(ssh)