0

我有 3 个表:Messages、MessageTypes、MessageReceivers (MSSQL)

这是我的代码: query = session.createQuery("from Messages as m left join m.messageReceivers as mr join m.messageTypes as mt " + " where mt.typeName = 'Assignment' " + "and mr.accounts.accId = :ID”); query.setParameter("id", recID); 返回查询.list();

它返回一个Object[](称为O),O的每个元素都是一个Messages-一个MEssageReceiver-oneMessagesType的组合

现在我只想从这三个表中获取消息列表,我该怎么做?

4

1 回答 1

1

添加select m到您的查询。

query = session.createQuery("select m from Messages as  m left join ...");
于 2013-10-13T05:26:04.020 回答