• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Entity Class Must Not be final ?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is that the entity class must not be final ?

 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"The Entity Class Must Not Be Final".This statement is in EJB3.0 specification.

 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved then?
 
Uppala Ramana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul,

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

 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.)
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic