wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJB Entity Class, its methods and Persistence variables must not be final Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "EJB Entity Class, its methods and Persistence variables must not be final" Watch "EJB Entity Class, its methods and Persistence variables must not be final" New topic
Author

EJB Entity Class, its methods and Persistence variables must not be final

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
EJB Persistence Spec Section 2.1 : The entity class must not be final. No methods or persistent instance variables of the entity class may be
final.


Hi ,
As you know that Entity class must not be declared as final. The only reason , I can think of it is that the Application server might be extending the user written entity class. Cause the excat reverse of this is the purpose of final. Is this explanation correct?
Question 2: If yes can i see the resulting class which could have extended my Entity class?
Queston 3: Further to this rule, any method in the entity class must not be declared as final. This means that Application server again would be extending the class and overriding all the methods in the entity class. Is this correct?
I think if one can get to see the resulting class, these questions can be answered very easily.
Question 4: Whats with not allowing to declare variables with final? Why is this rule applied ?

I hope to get answers to my questions.


SCJP, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Entity Class, its methods and Persistence variables must not be final
 
Similar Threads
Coffe Cream on EB: mistakes/doubts #1
Primary key and reflection
ejbFind in entity beans
needs clerification from chapter 6 Entity Bean Synchronization
My Study Notes