Exemplo n.º 1
0
 public List<Post> news() {
   return Post.find(
           "SELECT p FROM Post p, IN(p.author.friendedBy) u WHERE u.from.id = ?1 and (U.accepted = true or u.to.id = ?1) order by p.updatedAt desc",
           this.id)
       .fetch();
 }