• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I retrieve all Data with the EntityBean from my table?

 
Elena Taube
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
My LocalHome interface contains only 2 methods: create and findByPrimaryKey.
But how can I retrieve all primary keys?
Thanks a lot!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elena,
findByPrimaryKey returns the full object rather than just the primary key. What it does is let you search by the primary key.

To retrieve all the records, you need to add another finder. By convention, it is usually called findAll.
 
Elena Taube
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

thanks a lot for your reposponce.
I thought if I knew a list of my primary key, I could find all records That is why i have asked about the list of the pk.
Than I found that I can write find method, and I have implemented it together with ejb ql. It works fine!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic