Hi guys,
I have a OneToMany relashionship between entities A and B and want to
select atributes from B in resulting criteria query, example:
List<User> users = criteria().
select(User.class,attribute(User_.id), attribute(User_.name),
attribute(Tweet_.content)).
join(User_.tweets,
where(Tweet.class,javax.persistence.criteria.JoinType.LEFT).
likeIgnoreCase(Tweet_.content, "%tweet%")).
distinct().
createQuery().setFirstResult(0).setMaxResults(2).
getResultList();
in example above I was not able to select the column named 'content' from
Tweet table.
Any ideas? thanks in advance.
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
http://rpestano.wordpress.com/
@realpestano