vbe*_*nce 10
关于concat
:它与MySQL中的工作方式完全相同(它连接字符串,它不是聚合函数).
您可以将group_concat
sql函数添加到配置中.这样你就可以假设底层数据库知道这个函数,并且你将程序绑定到MySQL.
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.type.StringType;
// ...
myConf.addSqlFunction("group_concat", new StandardSQLFunction("group_concat", new StringType()));
Run Code Online (Sandbox Code Playgroud)
您还指出函数的输出是一个字符串.如果你没有这个group_concat
数字字段,Hibernate将假设结果也是数字和崩溃.
归档时间: |
|
查看次数: |
21007 次 |
最近记录: |