Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejbCreate() legal declarations  RSS feed

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you tell me why:

public int ejbCreate() throws javax.ejb.CreateException

is not a valid create method in a CMP entity bean?
 
Will Hunt
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to EJB specification Page 197, the return type of ejbCreate()
should be primary key class, which must provide suitable implementation of hashCode() and equals(Object) methods.

So that will rule out primitives, it can be wrapper classes though.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!