Reagrding Create method

Hi Gurus !!!!!!!!!!!Plz tell me can we have ejbs without any create method.I have read that entity bean can be without create method but it should have findermethod.Plz explanin
[219 byte] By [rajpuniaa] at [2007-10-3 3:46:38]
# 1
Yes, in EJB 2.x (and earlier), Entity beans are not required to have a create method.This is one way (security authorization being the other) to prevent new entity bean identities from being created. --ken
ksaksa at 2007-7-14 21:43:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thanks for Ur reply........I want to Know that whether an ejb(entity or session) can be without any create. If Yes then what situation it should be used.Also I had Read thatIn any problem NOUN should be an Entity Bean?
rajpuniaa at 2007-7-14 21:43:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

In EJB 2.x and earlier, only entity beans can be designed without a create method.The reason you would do that is if you don't want anyone creating new entities.E.g., if you had a pre-populated read-only database and you didn't want any new records created.If there's no create method, noone would be able to create new entity beans through your J2EE program.

In EJB 2.x and earlier, session beans must have a create method.In EJB 3.0, session beans no longer have a Home interface so is there is no create method.

You can find more information on EJB 3.0 in the Java EE 5 tutorial :

http://java.sun.com/javaee/5/docs/tutorial/doc/

--ken

ksaksa at 2007-7-14 21:43:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
but,how i to get a ejb object if no create()?
chip0013a at 2007-7-14 21:43:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

Instead of looking of a Home and calling create, you just cast the result of the lookup to the business interface.In the case of a stateful session bean, the container returns a reference to a new bean for every lookup.You can also have the EJB reference injected into your component using the @EJB annotation.We have some very simple Hello,World samples here :

https://glassfish.dev.java.net/javaee5/ejb/EJB30.html

--ken

ksaksa at 2007-7-14 21:43:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...