This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Alibabra Sanjie
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?
 
Mikalai Zaikin
Ranch Hand
Posts: 3416
16
  • 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
Ranch Hand
Posts: 3416
16
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!