title: JPA: Column 'AdressId' cannot be null
body: <p>i'm trying to persist school entity that have a unidirectional oneToOne relationship with Adresse, but i'm getting <code>Column 'AdressId' cannot be null</code>, note that MySQL DB generate ids for School and Adresse  here is my code:
  in JSF, when submit button is clicked the createSchool method is invoked.</p>
  
  <pre><code>@Named
  @RequestScoped
  public class SchoolAdd extends BaseBacking implements Serializable{
  private static final long serialVersionUID = 1L;
  private static final String INSCRIPTION_RETURN = "/login.xhtml?faces-redirect=true";
  private static final String RB_Name = "Bundle.messages";
  private static final String USER_NOT_FOUND = "user.not.found";
  
  private String userEmail;
  
  private User user;
  private School school;
  private Adresse adress;
  
  @EJB
  private SchoolPr schoolPr;
  
  @EJB
  private UserPr userPr;
  
  
  public SchoolAdd() {
      school = new School();
      adress = new Adresse();
  
      school.setPhoneNumbers(new HashMap&lt;PhoneTypeSchool, String&gt;());
  }
  
  public String createSchool() {
      userEmail = getRequest().getUserPrincipal().getName();
      System.out.println(userEmail);
      try {
          user = userPr.getUserByEmail(userEmail);
      } catch (Exception e1) {
          getContext().addMessage(null, new FacesMessage(ResourceBundleLoader.getBundle(RB_Name, USER_NOT_FOUND)));//DEL DEBUG
      }
      school.setUser(user);
      school.setAdresse(adress);
      System.out.println("1: " + adress.getCountry());
      System.out.println("2: " + school.getAdresse().getCountry());
      schoolPr.createSchool(school);
  
      return INSCRIPTION_RETURN;
  }+getters &amp; stters for school &amp; adress
  </code></pre>
  
  <p>School Entity</p>
  
  <pre><code>@Entity
  @Table(schema = "school", name = "school")
  public class School implements Serializable {
  
  private static final long serialVersionUID = 1L;
  
  @Id
  private BigInteger id;
  
  private String name;
  
  @ManyToOne(fetch=FetchType.EAGER, optional=false)
  @JoinColumn(name = "userId")
  private User user;
  
  @OneToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL, optional = false)
  @JoinColumn(name = "adressId", referencedColumnName = "ID")
  private Adresse adresse;
  
  @Temporal(TemporalType.DATE)
  private Date creationDate;
  
  @ElementCollection
  @CollectionTable(name="SCHOOL_PHONE")
  @MapKeyEnumerated(EnumType.STRING)
  @MapKeyColumn(name="PHONE_TYPE")
  @Column(name="PHONE_NUM")
  private Map&lt;PhoneTypeSchool, String&gt; phoneNumbers;
  
  @Column(name = "JOIN_DATE")
  private Timestamp joinDate;
  </code></pre>
  
  <p>Adresse Entity:</p>
  
  <pre><code>@Entity
  @Table(schema = "school", name = "adress")
  public class Adresse implements java.io.Serializable {
  private static final long serialVersionUID = 1L;
  
  @Id
  //@GeneratedValue(strategy=GenerationType.AUTO)
  private BigInteger id;
  
  private String country;
  
  private String state;
  
  private String city;
  
  private String street;
  
  private String number;
  
  private String zip;
  </code></pre>
  
  <p>UPDATE:
  if @GeneratedValue(strategy=GenerationType.AUTO) is used I get:</p>
  
  <pre><code>Avertissement: Local Exception Stack: 
  Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b):         org.eclipse.persistence.exceptions.DatabaseException
  Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mysql.sequence' doesn't exist
  Error Code: 1146
  Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
  bind =&gt; [2 parameters bound]
  Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?")
  at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
  </code></pre>