Take the 2-minute tour ×  Given the following:
CriteriaQuery<SomeDTO> cQuery; CriteriaBuilder cb;
Root<SomeClass> r;  Is there a way inwith the JPA criteria api
and a static metamodel to create a select, which returns a fixed
value for one column? The respective SQL should be something
like  SELECT 'FIXED VALUE', someValue FROM someClassTable WHERE
...;  Thanks in advance!  share|improve this question Are you
referring 'FIXED VALUE' to fixed length of column or some
constant which should be return while executing select query – 
Nayan Wadekar Mar 29 '12 at 12:00 The latter, a fixed value
(e.g. a certain string) which should be returned for all found
rows. –  DaDaDom Mar 29 '12 at 13:15 OK, I think while I wrote
the response to your comment, I found the answer by myself: The
word "literally" popped up in my head and looking for that in
the criteria builder actually provided me with
CriteriaBuilder.literal()! That is what I was looking for!
Anyway, @NayanWadekar, if you write that as an answer, I will
grant yo