• 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

WSAD EJB

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am trying to add a finder method to my entity bean.
has any body done it succesfully ?
I am trying to add a
public java.util.Enumeration findByName(String name) method to the remote interface.
Then I went to the "EJB Extension editor" and selected the where clause where I added
WHERE NAME = ?
I am able to succesfully deploy it, but when I run it I am getting an ORA-0068, Missing expresion error ?
Here are my questions :
1. When I add the finder method clause in extension file, where can I see the generated SQL statements ?
2. In case of any deployment problems in WSAD ejbs where can I see the errors ?
please help
Thanks
Maya
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change your where clause to T1.NAME = ?1 First, you don't enter "WHERE" in the where clause finder -- it's added automatically. Also, note that the "1" is important -- this is how the finder distinguishes different parameters. It's also important to use the table identifier in your where clause also.
Kyle
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle,
Thanks for the response. I tried and it works.
Well, I have a couple of questions
1. When i try T1.NAME = ?1 and deployed it, I checked the EJS file that is getting generated and saw the select statement which is selecting all the fields, Is it so ? Can I tell it to select only the fields I want ?
2. Also, is it possible to do a JOIN in WHERE clause, say
T1.NAME = ? AND T2.ID = 100;
Thanks
Maya
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maya,
No, and no. Welcome to CMP in EJB 1.1... Things are much better in EJB 2.0 (WAS 5.0) BTW...
Kyle
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kyle,
Well here is another question
In my where clause I am going to put a sub select query.
T1.id = (SELECT MAX(T1.id) FROM xxx T1 WHERE Name LIKE ?1) AND T1.name LIKE ?1.
If you check this query, My subselect and the real where clause takes "same parameter".. Its like that.
But my method is like this
findbyname(String name).
When I deploy it, and run IT IT GIVES COMPLAINT SAYING
ORA-01008: not all variables bound
Is there a way for me to modify my where clause so that I dont need to modify the signature of the method like this
findByname(String name, String name1) where name and name1 are the same...
Please help
Thanks
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic