@Override
@Transactional(propagation = Propagation.MANDATORY)
public ListMultimap<Long, HistoryEvent> getHistoryForItemIds(Collection<Long> ids)
{
if( ids.isEmpty() )
{
return ImmutableListMultimap.of();
}
List<Object[]> history = getHibernateTemplate().findByNamedParam(
"select h, i.id from Item i join i.history h where i.id in (:items) order by index(h)", "items", ids);
ListMultimap<Long, HistoryEvent> multiMap = ArrayListMultimap.create();
for( Object[] historyRow : history )
{
multiMap.put((Long) historyRow[1], (HistoryEvent) historyRow[0]);
}
return multiMap;
}
ItemDaoImpl.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:Equella
作者:
评论列表
文章目录