title: Cannot add or update a child row: a foreign key constraint fails - using Generator
body: <pre><code>CREATE TABLE `examrequisitions` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `doctorId` bigint(20) unsigned NOT NULL,
    `patientId` bigint(20) unsigned NOT NULL,
    `examId` bigint(20) unsigned NOT NULL,
    `dateRequisition` datetime NOT NULL,
    `price` decimal(7,2) unsigned NOT NULL,
    `status` enum('Realized','Opened') NOT NULL DEFAULT 'Opened',
    `obs` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `doctorId` (`doctorId`),
    KEY `patientId` (`patientId`),
    KEY `examId` (`examId`),
    CONSTRAINT `doctorId` FOREIGN KEY (`doctorId`) REFERENCES `doctors` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `examId` FOREIGN KEY (`examId`) REFERENCES `exams` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `patientId` FOREIGN KEY (`patientId`) REFERENCES `patients` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  
  CREATE TABLE `reports` (
    `id` bigint(20) unsigned NOT NULL,
    `status` enum('Validated','Invalidated') NOT NULL DEFAULT 'Invalidated',
    `outcome` varchar(100) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `id_UNIQUE` (`id`),
    CONSTRAINT `id` FOREIGN KEY (`id`) REFERENCES `examrequisitions` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>This following query is working:</p>
  
  <pre><code>INSERT INTO `systemcardiologyreports`.`reports` VALUES(1,'Invalidated', null);
  </code></pre>
  
  <p>But using Hibernate, trying to send the same values from the front end gives me: Cannot add or update a child row: a foreign key constraint fails (<code>systemcardiologyreports</code>.<code>reports</code>, CONSTRAINT <code>id FOREIGN KEY (</code>id<code>) REFERENCES</code>examrequisitions<code>(</code>id`) ON DELETE NO ACTION ON UPDATE NO ACTION)</p>
  
  <p>Model:</p>
  
  <pre><code>@Id
  @GenericGenerator(name = "generator", strategy = "foreign",
              parameters = @Parameter(name = "property", value = "examrequisitions"))
  @GeneratedValue(generator = "generator")
  @Basic(optional = false)
  @Column(nullable = false, unique = true)
  private Long id;
  
  @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "id")
  @OneToOne(cascade = CascadeType.ALL)
  private Examrequisitions examrequisitions;
  </code></pre>
  
  <p>Primefaces:</p>
  
  <pre><code>&lt;p:outputLabel value="#{bundle.CreateReportsLabel_examrequisitions}" for="examrequisitions" /&gt;
  &lt;p:selectOneMenu id="examrequisitions" value="#{reportsController.selected.examrequisitions}" required="true" requiredMessage="#{bundle.CreateReportsRequiredMessage_examrequisitions}"&gt;
      &lt;f:selectItems value="# examrequisitionsController.itemsAvailableSelectOne}" var="examrequisitionsItem" itemValue="#{examrequisitionsItem}"/&gt;
  &lt;/p:selectOneMenu&gt;
  &lt;p:outputLabel value="#{bundle.CreateReportsLabel_status}" for="status" /&gt;
  &lt;p:selectOneRadio id="status" value="#{reportsController.selected.status}"&gt;
       &lt;f:selectItems value="#{reportsController.status}"  var="status" itemLabel="#{status}" itemValue="#{status}" /&gt;
  &lt;/p:selectOneRadio&gt;
  &lt;p:outputLabel value="#{bundle.CreateReportsLabel_outcome}" for="outcome" /&gt;
  &lt;p:inputTextarea id="outcome" value="#{reportsController.selected.outcome}" title="#{bundle.CreateReportsTitle_outcome}" rows="7" maxlength="100" /&gt;
  </code></pre>