• 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

Uregent --Help with Custom Finder

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
We are using WS v5.1.1 and EJB 2.0 .In our project we have to use db-tables which are present in the same database but doesn't have the corresponding entity beans.If I write a EJBQL finder query for accessing that table(ProductInfo)

Select object(o) from ShowRoom o where o.pid in(select p.id from ProductInfo p where p.name='abc')

I get the following error --abstract schema ProductInfo not defined.
Productinfo has schema mapping with the entity bean in a different ear file deployed as a different project.I am able to access all the entities from this ear file from my project but cann't use the tables from the other project to query .

Is there any way I can query these tables from my project without creating corresponding entities for them.

with our EJB 1.1 we had the flexibity of querying any table with or without corresponding entity using the WhereClauseFinderDescriptor .Does EJB 2.0 have any of that features in EJBQL.

Thanks in advance
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi dhanu9uk,

Welcome to JavaRanch, the absolute best site on the www for Java information. We don't have many rules around here, but we do have one. Please change your display name to a first and last name to comply with the JavaRanch Naming Policy. You can change it here. Thank you for your cooperation.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by dhanu9uk:
Hi ,
We are using WS v5.1.1 and EJB 2.0 .In our project we have to use db-tables which are present in the same database but doesn't have the corresponding entity beans.If I write a EJBQL finder query for accessing that table(ProductInfo)

Select object(o) from ShowRoom o where o.pid in(select p.id from ProductInfo p where p.name='abc')

I get the following error --abstract schema ProductInfo not defined.
Productinfo has schema mapping with the entity bean in a different ear file deployed as a different project.I am able to access all the entities from this ear file from my project but cann't use the tables from the other project to query .

Is there any way I can query these tables from my project without creating corresponding entities for them.

with our EJB 1.1 we had the flexibity of querying any table with or without corresponding entity using the WhereClauseFinderDescriptor .Does EJB 2.0 have any of that features in EJBQL.

Thanks in advance



Nope, sorry. EJB 2.0 limits the scope of EJB-QL finder queries to the same EJB-JAR file. You're going to have to copy your EJB's (and more importantly, their deployment descriptors) into your second JAR file to make this work.

Kyle
 
dhanu varma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kyle thanks for the reply.

I cannot import the other project and its deplyoment descriptor into my first project.Is there any way I can query the tables in the DB (like using finder Interface or some other options).


Thanks in advance.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dhanu, you're still not complying with the naming policy... It requires a first name and last name.
 
See where your hand is? Not there. It's next to this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic