在orm中的列中获取不同的值 [英] Getting distinct values in a column in orm

查看:184
本文介绍了在orm中的列中获取不同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过

   <cfquery name="keyTypeGroup">
      SELECT DISTINCT keyTypeGroup
      FROM data.keyType
   </cfquery>

我可以通过orm拉取所有数据

I can pull all the data via orm

...
return EntityLoad("data_KeyType");
...

我绑了

   <cfdump var="#ORMExecuteQuery('SELECT DISTINCT KeyGroupType FROM data.KeyType', true)#">

但我得到

Error while executing the Hibernate query. 

org.hibernate.hql.ast.QuerySyntaxException: data.KeyType is not mapped [SELECT DISTINCT KeyGroupType FROM data.KeyType]

如何解决这个问题?

推荐答案

b
$ b

Try

<cfdump var="#ORMExecuteQuery('SELECT DISTINCT KeyGroupType FROM data.keyType', true)#">

我在这种情况下遇到了问题。

I have seen issues with case in situations like this.

这篇关于在orm中的列中获取不同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆