我没有在stackOverFlow中找到关于我的问题的答案。HSQL。如何使用区别排除dublicate元素
我有重复的结果在Hibernate查询,如:
select new ValueObject(h.id, c.firstName, c.lastName)
from HistoryTable as h left join CustomerTable as c
where h.customerId = c.id and c.notDeleted
order by c.firstName, c.lastName
但是,当我使用DISTINCT,重复的结果不断出现
select distinct new ValueObject(h.id, c.firstName, c.lastName)
from HistoryTable as h left join CustomerTable as c
where h.customerId = c.id and c.notDeleted
order by c.firstName, c.lastName
但我的问题是,如果有是否有可能使用DISTINCT排除在HSQLDB查询中创建新的ValueObject的重复项?
谢谢你的事情与setResultTransformer。我不知道这个功能。但真正明显的是左外连接的工作,并且我在安置该职位后立即找到了错误原因。 – Aventes 2014-09-23 20:10:14