• Post Reply Bookmark Topic Watch Topic
  • New Topic

can an Entity Bean be a private class?  RSS feed

 
Cainiao Zou
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what class can be defined as Entity Bean, i mean use the @Entity annotation.

public -> OK
final -> NO
abstract -> OK
protected -> ?
private -> ?
default -> ?
 
Ran Pleasant
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public - an Entity Bean must be public. If the bean is protected or private I don't think the JPA manager would not be able to see the bean.

final- I assume this would have no affect since that only keeps the class from being subclassed.

abstract- Your entity beans can be based off of an abstract bean. However, I'm not sure if you can configure the abstract bean itself to a table.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!