Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity Class Must Not be final ?

 
Uppala Ramana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is that the entity class must not be final ?

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does declaring a class final prevent? If you know the answer to this, you should be able to deduce the answer to the question.
 
Uppala Ramana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The Entity Class Must Not Be Final".This statement is in EJB3.0 specification.

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved then?
 
Uppala Ramana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,

I want to know the reason behind the statement "The Entity Class Must Not Be Final".

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I thought. That's why I asked you to do a little bit of thinking yourself. So... what does it mean to make a class final? What effect does it have on the class?

Clearly that effect prevents the ORM software from working correctly, and that's why it's prohibited.
 
Uppala Ramana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I thought. That's why I asked you to do a little bit of thinking yourself. So... what does it mean to make a class final? What effect does it have on the class?

Clearly that effect prevents the ORM software from working correctly, and that's why it's prohibited


Paul,

So, what the ORM software will do by creating a sub class of each Entity Bean ?
Is it will add some thing to each Entity ?

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uppala Ramana wrote:So, what the ORM software will do by creating a sub class of each Entity Bean ?
Is it will add some thing to each Entity ?


Yes, I would assume that's what it will do too.

(You may notice that we have now answered two questions in this thread simply on the basis of looking at the description of how something works, without actually knowing anything at all about the real details of how it works. We might be wrong, but in real life it doesn't matter, since all we have to do is to remember not to make the entity classes final and we can go on our way designing and implementing systems.)
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
We might be wrong, but in real life it doesn't matter


I've built my entire career around that particular sentiment.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic