Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

EJB-QL with non-CM fields

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

is it possible to write an EJB-QL query that uses normal CMP entity beans, together with plain database fields (not wrapped with an e-bean).

With other words, I need to write a where clause that does something like this:

WHERE myBean.thingyFK.value = ?1

'myBean' is a normal entity bean and has a foreign key to a database table 'thingy'. From this table, I need the column 'value'. The table 'thingy' has no entity bean. (And it is not possible to introduce a new entity bean for this...)

Otherwise I'll have to use a fastlane or something, but at this point I rather want the EJB-QL solution.

Thanks a lot!
Kris
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJBQL is writting for an abstract schema. You describe the schema in the ejb-jar.xml file. So only fields described in the ejb-jar.xml can be used in a ejb query.
 
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic