[hibernate-dev] https://hibernate.atlassian.net/browse/HHH-9798 Unique constraint / not null of @JoinTable for @OneToOne not generated

Jason Pyeron jpyeron at pdinc.us
Sun Apr 19 11:49:20 EDT 2020



> -----Original Message-----
> From: Jason Pyeron
> Sent: Sunday, April 19, 2020 11:20 AM
> 
> I think I have found another corner case on the
> https://hibernate.atlassian.net/browse/HHH-9798 regression.
> 
> 
> 
<snip/>
> 
> 
> @OneToOne(fetch = FetchType.LAZY)
> 
>     @JoinTable(
> 
>         name = "ITEM_SHIPMENT", // Required!
> 
>         inverseJoinColumns =
> 
>             @JoinColumn(nullable = false,

Adding the nullable =false is correctly generating the join table with a not null, but is implying a optional=false on the OneToOne...

javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value : XXXX.auction

> 
>                         unique = true)
> 
>     )
> 
>     protected Item auction;
> 
> 
> 
> Thoughts?
> 
> -Jason





More information about the hibernate-dev mailing list