I have this parent class:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BSEntity")
@DiscriminatorColumn(name = "resourceType", discriminatorType = DiscriminatorType.STRING, length = 32)
public abstract class BaseEntity {
and the subclass
@Entity
@Table(name = "BSCategory")
@DiscriminatorValue("Category")
public class CategoryEntity extends BaseEntity {
But when I run the program, I get the following error:
2010-06-03 10:13:54,222 [main] WARN (org.hibernate.util.JDBCExceptionReporter:100) - SQL Error: 1364, SQLState: HY000
2010-06-03 10:13:54,222 [main] ERROR (org.hibernate.util.JDBCExceptionReporter:101) - Field 'resourceType' doesn't have a default value
Any thoughts?
Updated:
Database is MySQL. I have also changed inheritance strategy to JOINED instead of SINGLE_TABLE. Help