Joined: Thu Oct 06, 2005 5:36 am Posts: 8
|
We have a problem switching classes on an update of a classes hierarchy :
The Hierarchy :
@Entity
@Table(name = "TOTO")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "TOTO_KIND", length = 4)
Class A
{
}
@Entity
@DiscriminatorValue(value = "A")
Class B extends A
{
}
@Entity
@DiscriminatorValue(value = "B")
Class C extends A
{
}
The problem is :
- save an B.
- Clear the session.
- load a B and switch it to a C (make a C with the same ID).*
- Clear the session.
- load the object with the id and instead of a C we're getting a B.
* DiscriminatorValue is not changed on this step
Is there a way fixing this ?
|
|