Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create() in Home

 
Bojan Knezovic
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do Home interfaces necessarily declare at least one create() method for entity beans? What if I don't want to permit creation of new entities?

The same goes for remove().

Thanks,
Bojan
 
Mahesh Desai
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The create() method in the entity bean home interface is optional. Making this method optional gives us the option of preventing the client from inserting data into the database.
The only one method, findByPrimaryKey(), that is required to put into the entity bean home interface.

The following two methods defined in the javax.ejb.EJBHome interface used by entity beans to delete/remove an actual entity in the database.

void remove(Handle handle) throws RemoveException, RemoteException;
void remove(Object primaryKey) throws RemoveException, RemoteException;


Thanks,
Mahesh

----------
SCJP 1.4 | SCWCD 1.4 | SCBCD 1.3 | SCEA Part I - In Progress
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic