Код: Выделить всё
java.lang.ClassCastException: org.hibernate.mapping.SingleTableSubclass cannot be cast to org.hibernate.mapping.RootClass
У меня есть абстрактный класс:
Код: Выделить всё
@Entity
@Table(name = "PRODUCTS")
public abstract class CommonProduct extends HibernatePersistentObject implements Serializable, UniqueObject {
@Ignore
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "products_seq")
@SequenceGenerator(name = "products_seq", sequenceName = "products_seq")
@Column(name = "productId")
protected Integer productId;
Код: Выделить всё
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Product extends CommonProduct
{
Код: Выделить всё
@Entity(name = "viewProductHistory")
@Table(name = "PRODUCT_HISTORY")
public class ProductHistory extends CommonProduct
{
@Id
@Column(name = "PRODUCT_HISTORY_ID")
private int ProductHistoryId;
Подробнее здесь: https://stackoverflow.com/questions/791 ... ate-mappin