I have a question related to javax.validation.constraints.NotNull annotation
.
In my project i do have classes tree like following :
@Inheritance(strategy = InheritanceType.JOINED)
class Ssss {
@ManyToOne
private Xxxx x;
public Xxxx getXxxx() {
return x;
}
}
@Inheritance(strategy = InheritanceType.JOINED)
class Yyyy extends Ssss {
@Override
//some not important annotations
public Xxxx getXxxx() {
return super.getXxxx();
}
}
@Inheritance(strategy = InheritanceType.JOINED)
class Zzzz extends Ssss {
@Override
//some not important annotations
@NotNull
public Xxxx getXxxx() {
return super.getXxxx();
}
}
This three classes are stored in database as three tables.
For schema creation i'm using Hibernate
:
hibernate.hbm2ddl.auto=create
Is it an expected behavior that Hibernate adds NOT NULL
on xxxx_object_id
field stored in table generated for super class ssss like following:??
I could not find any relevant information about how hibernate treats @NotNull on inherited getters.
Can anyone help me on this issue?
Best Regards.
Michal