When I'm trying to save an U object I got next exception:

org.springframework.orm.jpa.JpaSystemException: attempted to assign id from null one-to-one property [com.roc.domain.A.user]; nested exception is org.hibernate.id.IdentifierGenerationException: attempted to assign id from null one-to-one property [com.roc.domain.A.user]

I have two tables: 
 1. user that columns are id(auto incr, primary), name.
 2. contact that columns are id, user\_id(that is foreign key -> user.id) and address.

```
@Entity
@Table(name = "a")
public class A {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "id")
  private Long id;

  @Column(name="address")
  private String address;

  @OneToOne
  @MapsId
  private U user;

  public A() {

  }
   // getters and setters

}

@Entity
@Table(name = "u")
public class U {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "id")
  private Long id;
  @Column(name="username")
  private String userName;
  @JoinColumn(name = "user_id", referencedColumnName = "id")
  @OneToOne(mappedBy = "user", cascade = CascadeType.ALL)
  private A a;

  public U(){};

}

@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTest {

  @Autowired
  private URepository uRepository;

  @Test
  public void simpleCrudTest() {
    U user = new U("name", new A("address"));
    uRepository.save(user);

  }
}

```