select j.* from journal j left join friend f on f.friendName=j.userName left join user u on u.userName=f.userName where u.userName=?
差不多应该就是这样
select * from journal,friend,user where friend.userName=user.userName and friend.friendName=journal.userName and user.userName='你的值'
在 配置文件中 对应设置关联表属性中添加 cascade=“all”,试试!