• Post Reply Bookmark Topic Watch Topic
  • New Topic

findby method returning multiple records..  RSS feed

 
suresh Krishnan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when u do
RemoteType findByMethod1(String email) in Finder class....
and finds that there are 2 records in db with same email??
Where can I find EJB specs 1.1 and 2.0 link plz?

 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We return a Collection, usually an ArrayList. Something like this in the home:

and then in the ejb-jar.xml:

The specs can be found at: http://java.sun.com/products/ejb/?frontpage-javaplatform

Hmmm, didn't like the xml posted here. If you need it, I can e-mail it to you.
[This message has been edited by Michael Hildner (edited March 27, 2001).]
 
suresh Krishnan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think u have mistaken my question...
2 records in database
id email
1 ted@mail.com
2 ted@mail.com
RemoteInterfaceType findByEmail(String emailid) throws FinderException blah balh...
what happens when i call above method...against above database
I knwo we can use collection or enumeration...
but what happens 4 above case?
 
Madhu Juneja
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The signature that you have given here is method declaration for home interface. The return depends on what return type (whether primary key class or Enumeration) you have given in the bean defininition and the logic you have provided in case of Bean managed persistence.
HTH
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!