O'Reilly logo

Head First EJB by Bert Bates, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Imagine what else you might want to do with your EJB object reference...

You’re a client. You have a reference to the AdviceBean’s component interface. You know you can call getAdvice(). But now that you’ve gone to all the trouble of getting the stub, are there other things you might want to do?

image with no caption

What YOU write:

image with no caption

EJBObject (the bean’s bodyguard for business methods)

What the CLIENT sees:

image with no caption

Remember, the container implements your component interface and matching stub.

The container must implement EVERYTHING from Advice and EJBObject.

Note

You better know these other methods inside and out.

The exam expects you to know all five of the methods in EJBObject. You have to know that they’re available to Remote clients, and exactly how they’re used!

If you’re a client, and you want to...

  1. get the primary key of an entity bean

    We won’t go into this now, since we have 10 million pages on entity beans coming up. Just know that this does not apply to session beans, which don’t have a unique identity exposed to the client. But if the client somehow gets a reference to an entity bean (maybe by searching on a customer’s name) and wants the actual primary key, this is the method to call. Try it on a session bean, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required