• Post Reply Bookmark Topic Watch Topic
  • New Topic

About Entity bean

 
Senthil Somasundaram
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
I am new to EJB.
I want to retrieve all the data from a table via an entity bean.
I studied that we can get the Collection of entity remote object by finder methods Query.
But, is there any way to get the content of the table direcly rather then invoking get method of entity remote object?
Thanks,
Sen
-------
SCJP 1.4
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could have a home business method (available from EJB 2.0). Let's say you declare a method named getAllAccounts() in your bean. This method could return a Collection of String objects containing the Accounts data. Or, better still, return a Collection of transfer objects - let's call the objects' class AccountsData - which contain the data plus the necessary getters. The client can then make local calls to retrieve the data from the AccountsData objects without having to make remote calls on the component interface.
 
Senthil Somasundaram
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roger,

Thanks for your reply.Could you give any good references (URL or book)for any additional info.
Thanks,
Sen
----------
SCJP 1.4
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lot of people like Mastering Enterprise JavaBeans
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!