• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get Primary Key via HomeObject?

 
Yi Zhou
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iknow it is a stupid question. but I cannot handle it with getPrimaryKey()
who can give me a hand?
Thanks
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Yi Zhou!
The home object is not associated with any particular entity beans and thus cannot give you access to their primary keys. What you can do is write a finder method into the home interface, which will give you a reference to the corresponding entity bean--from which you would have to use getPrimaryKey()...
Why is it that you can't use getPrimaryKey()?
 
Yi Zhou
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much and I can't agree with you more.
But what i am doing is to modify some horrible programme somebody wrote two years ago. I cannot modify the servlet class and EJB because the source code is unavailable.
So I have to handle it in JSP.
In my JSP I try to write : OrderKey orderKey = (OrderKey) order.getPrimaryKey . I remember the line worked fine one year ago ,but now when run it , it throws exception. I am sure I have imported neccessary packages.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of an exception it is throwing?
 
Yi Zhou
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Object java.rmi.RemoteException: CORBA NO_IMPLEMENT 1 No; nested exception is: org.omg.CORBA.NO_IMPLEMENT: Unable to locate value class ordergoodsprocess.OrderKey minor code: 1 completed: Nonaming

I get the information by running the lines as follows
"catch (Exception e) {
out.print(e);
} "
but i am still confused.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid this is new to me. I've never seen such an exception. Btw, which application server you're using? Borland?
 
Yi Zhou
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Websphere
maybe We should use Weblogic !
Anyway, Thank you so much.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!