@Service
@Transac.Readonly
public List<Chat> read(Chat c) throws Exception
{
Criteria<Chat> _ = data.criteria(Chat.class);
User me = new User().id(sess.me);
Criterion out = Restrictions.eq("out", me);
if (c.in != null)
out = Restrictions.and(out, // chats from me
Restrictions.eq("in", c.in));