I found that this is actually not possible in as much as being able to update via either the fk or the entity. Hibernate doesn't let you which makes complete sense. However you can populate both, you just have to pick which one will be the one that's updatable/insertable. You make both properties point to the same fk column and you're golden. So this question becomes a lot more similar once you know that so it gets an upvote. Either way here's the annotated version of how it's possible:
public class A{
@Column(name="b_id")
private long bfk;
@OneToOne
@JoinColumn(name="b_id", insertable=false, updatable=false)
private B b;
//other stuff...id, setters/getters etc.
}
At least in my case I think it's a lot better to have the fk as the insertable/updatable property.