Is it valid to declare @OneToOne and @NotNull on both sides of a relationship, such as:
class ChangeEntry
{
@OneToOne(cascade=C
It should be persisting the transient value because of your cascade type.
If you are actually trying to persist the first element before you've set the other transient element, then you'd expect this error.
The constraint you've specified only specifies that the value cannot be null in the database, rather than in the data model, clearly when you construct a new instance of the object, the reference will be null. While the reference is null you cannot persist the entity.