```
public class Driver {

    @OneToOne
    private License license;

    //.. getter setter
};

public class License {

    @OneToOne(mappedBy='license')
    private Driver driver;

   //.. getter setter
}

```

I get a join column license\_id in the driver table in Db via this mapping. The problem is that: 

```
Driver driver = new Driver();
// save driver then get it etc...

License license = new License();
license.setDriver(driver); 
// save license...

driver.getLicense();

```

Although I set parent from child, the column is still empty and I get null.
How to avoid this?