• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

EJB QL Question

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys
take an example EJB QL



From the above, Player is an abstract schema as per my knowledge.. My question is why select object(p)?... I mean what does the parenthesis "object(p)" signify?.. can ne1 point out this to me...
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is how it goes

when the container looks at this query it first compiles and parses the ejb ql very much like the query execution . so it looks @ player which referes to the abstract schema . gets all the cmp field mappings .Constructs a sql query . Using the datasource definitions provided in the descriptors , connects to the database , executes the query and gets the result set . The container then utilises its OR mapping part to create ejb objects from the result set and thats the reason its object(p) where p is an alias to the schema Player . So the query says to create objects of Player schema only . Similar to the alias used in sql query .

Murugan
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic