Why is a sub-class generated from my EJB?
They provide some services for you:
- <entitycmp/> if ejbSpec="1.1" generates a EJB 1.1-based CMP bean from your EJB 2.0-based abstract CMP schema and provides a optimistic locking scheme for you by putting and auto-updating a version field. For 1.1 it also does the modification/dirty check so the ejbStore is called only when something has changed. For both spec version it handles data-object generation automatically for you, so you should activate it if you want to use <dataobject/>.
- <entitybmp/> does all the optimistic-locking/dirty-flag/etc plus it calls the DAO class automatically.
<entitycmp/>/<entitybmp/> and <session/> all try to also generate as much as possible labor intensive code you normally write. For example you should remember to put a no-argument ejbCreate method in your stateless session bean or define a no-op ejbActivate and so on. These tasks try to do that for you automatically, so you just concentrate on the business logic. It also results in source code which is more readable because there's no empty ejbActivate/etc or void stuff like that in it, all is hidden in the sub-class.