• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: Changing the discriminator

 
Christopher Olbertz
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a class hierarchy. The superclass in Person. It has a subclass Lodger which has a subclass Alumni.

When a lodger moves out, he becomes an alumni. An alumni can come back and move in again, then he becomes a lodger. I mapped the hierarchy with a discriminator and everythings works fine.

When I want to change a lodger to an alumni or contrary, I have to change the discriminator from "l" to "a" respectively from "a" to "l".

Is there a simple way to achieve this?

Greetings,

Christopher
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Years back, i was advised not to update the discriminator.
 
Christopher Olbertz
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

thank you for your answer. I read this thread and it confirmed what I was afraid of. But I hoped that there is a possibility. Then I will delete the object and create a new one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic