Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Primitive type can be the return type of the SELECT clause?

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Primitive type can be the return type of the SELECT clause? like int, long... if the cmp field is a primitive type field?
 
Rancher
Posts: 3645
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it can,
but you can get primitives only in "select" methods, not in "finders"
 
Mikalai Zaikin
Rancher
Posts: 3645
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the example:


The following EJB QL query selects the names of all products that have been ordered. It illustrates the selection of values other than entity beans, therefore it can be used only for SELECT methods, not for FINDER methods:


for details see this page.
cheers !
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clear! Thank you, Mikalai Zaikin!
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic