• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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.
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!