I should add it is on a foreign key if that wasn't clear from the sql. I'm using annotations and here is where the relationship is defined. I did try it using mapping files and saw the same behavior.
Code:
@Entity
@Table(name = "A")
public class A
{
@Id
@GeneratedValue
@Column(name = "A_ID")
private Long id;
@Column(name = "A_TEXT")
private String text;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "B_ID")
private B b;
...
}
@Entity
@Table(name = "B")
public class B
{
@Id
@GeneratedValue
@Column(name = "B_ID")
private Long id;
@Column(name = "B_TEXT")
private String text;
@OneToOne(mappedBy = "b")
private A a;
...
}