Hibernate 中的 SQL 查询
我正在执行一个 SQL 查询,如下所示:
SELECT thi.*
FROM track_history_items thi
JOIN artists art
ON thi.artist_id = art.id
WHERE thi.type = TrackBroadcast
Group By art.name
ORDER thi.created_at DESC
当我从 MySql Workbench 直接在数据库上运行它时,效果很好,但是当我通过 Hibernate 运行时,我得到一个 No Dialect mapping for JDBC type: -1错误。
任何人都知道可能是什么原因造成的?
I'm carrying out a SQL query which looks like:
SELECT thi.*
FROM track_history_items thi
JOIN artists art
ON thi.artist_id = art.id
WHERE thi.type = TrackBroadcast
Group By art.name
ORDER thi.created_at DESC
This works fine when I run it directly on my database from MySql Workbench, but when I run in through Hibernate, I get a No Dialect mapping for JDBC type: -1
error.
Anyone have any ideas what could be causing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
mysql 方言可能不支持查询中的一列或多列...尝试扩展 * 并一次添加一列,直到找到有问题的列。
然后只需决定是否需要该列即可。
Probably one or more of the columns in the query is not supported by the mysql dialect... try expanding the * and add one column at a time until you find the offending one.
Then it is just a matter of deciding whether you need that column or not.