I have an abstract class A
, class B
and C
are subclasses of A
. Class B
has an embedded field d
. Now when I try to save an instance of B
everything is fine. However on creating an instance of C
and saving it, I get an error :
java.sql.SQLException: Field 'string' doesn't have a default value.
Eg classes:
public abstract class A {
}
@Embeddable
public class D {
private String string;
}
public class B extends A{
@Embedded
@NotNull
private D d;
}
public class C extends A {
}