my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB" Watch "EJB" New topic
Author

EJB

Hari Prasad M
Greenhorn

Joined: Feb 27, 2006
Posts: 3
How to call an entity bean in the session with session facade design pattern ?

where we can write the database code ( which method)in session bean without entity bean ?


hari.mprasad@gmail.com


Hari Prasad Mallidi
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Hi Hari,
There is a "EJB and Other J2EE Technologies" forum here:
http://www.coderanch.com/forums/f-11/EJB-JEE


[My Blog]
All roads lead to JavaRanch
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
I would take it that you are using ejb 2.0 or earlier. you should perform a JNDI lookup of your entity bean from your session fascade layer. if your session beans and entity beans are within the same EJB container then you can use your entity beans as local otherwise remote. session fascade pattern minimises your network trips.


If you do no want to use entity beans then use other O-R mapping tools like Hibernate, iBatis, TopLink etc. You should write your database logic in a DAO layer( look at DAO pattern).

Session beans layer calls --> business manager layer calls --> DAO layer (can use Hibernate etc or pure JDBC) calls --> Database


java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
GeeCON Prague 2014
 
subject: EJB