File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CONSTRUCTOR IN ENTITY BEANS

 
AvatarKrishna Allada
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Can any one explain me why there is No "CONSTRUCTOR IN ENTITY BEANS"
 
James Hobson
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not be using Entity Beans directly, use the Home interface create method, which will use ejbCreate.
Constructing an EJB with a public constructor would completely break the EJB model.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are constructors but they are of the default kind. Remember if you don't specify a constructor then the compiler will supply a default (no args) constructor for you. It is this constructor that is used by the EJB Container to create an instance of your Bean's implementation class. You could explicitly define this default constructor if it makes you feel better.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic