Joined: Tue Aug 02, 2005 11:41 am Posts: 1
|
Hibernate 3.2
Parent class:
@Entity
@Table(name="message")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
name="MESSAGE_CLASS",
discriminatorType=DiscriminatorType.INTEGER
)
public abstract class Message {...
Subclass:
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorValue("1")
public class StructuredLetter extends Message {...
When I run the following code I get a java.lang.ClassCastException: com.gudrun.gdp3000.business.messagecenter.domain.Message$$EnhancerByCGLIB$$8c8c7d71
StructuredLetter letter = (StructuredLetter) messageDAO.get(id);
This is logical because this Hibernate-cglib class is put in between because of lazy loading.
But how can I get my StructuredLetter?
|
|