openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Luis Cetina <maxtorz...@gmail.com>
Subject Re: how to query list property with criteria query?
Date Thu, 01 Jan 2015 05:31:40 GMT
Just

CriteriaQuery<String> cq = cb.createQuery(String.class);

And then:

List<String> lst = em.createQuery(cq).getResultList();

El mié, 31 de diciembre de 2014 22:34, zhourui <zhourui@zoneland.net>
escribió:

> have entity like:
> @Entity
> public class CompanyAttribute extends SliceJpaObject {
>         @PersistentCollection(fetch = FetchType.EAGER)
>         private List<String> attributeList = new ArrayList<String>();
>         ......
> }
>
> now need to select the List property 'attributeList' only in criteria
> query,
> CriteriaBuilder cb = em.getCriteriaBuilder();
> CriteriaQuery<List&lt;String>> cq = cb.createQuery(List<String>.class);
>
> CriteriaQuery<List&lt;String>> cq = cb.createQuery(List<String>.class);
is
> mistake.
> hoe to do it.
>
> thanks!
>
>
>
> --
> View this message in context: http://openjpa.208410.n2.
> nabble.com/how-to-query-list-property-with-criteria-query-tp7587532.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message