title: OneToMany bidirectional mapping, missing column
body: <p>I can't figure out what's the problem. For some reason Hibernate is throwing error about &quot;missing route_id column in bus table&quot;. If I create the column and let it be empty then everything works as I want. Why does it need it? I dont need it. Maybe someone can help me, thanks in advance</p>
  <pre><code>@Entity
  @Getter
  @Setter
  @Table(name = &quot;bus&quot;)
  public class Bus {
      @Id
      @Column(name = &quot;bus_id&quot;, columnDefinition = &quot;VARCHAR(36)&quot;)
      private String id = UUID.randomUUID().toString();
  
      @NotBlank
      @Length(min = 4, max = 15)
      private String name;
  
      @OneToMany(mappedBy = &quot;bus&quot;, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
      private Set&lt;Route&gt; routes;
  }
  
  </code></pre>
  <pre><code>CREATE TABLE bus
  (
      id     BIGINT       NOT NULL AUTO_INCREMENT PRIMARY KEY,
      bus_id VARCHAR(36)  NOT NULL UNIQUE,
      name   VARCHAR(255) NOT NULL UNIQUE
  );
  </code></pre>
  <pre><code>@Entity
  @Getter
  @Setter
  @Table(name = &quot;route&quot;)
  @SecondaryTables({
          @SecondaryTable(name = &quot;location&quot;),
          @SecondaryTable(name = &quot;bus&quot;)
  })
  public class Route {
      @Id
      @Column(name = &quot;route_id&quot;, columnDefinition = &quot;VARCHAR(36)&quot;)
      private String id = UUID.randomUUID().toString();
  
      private int leaving;
      private int arrival;
      @Column(columnDefinition = &quot;DECIMAL&quot;, precision = 4, scale = 2)
      private BigDecimal price;
  
      @ManyToOne
      @JoinColumn(name = &quot;bus_id&quot;, referencedColumnName = &quot;bus_id&quot;)
      private Bus bus;
  
      @ManyToOne
      @JoinColumn(name = &quot;route_to&quot;, referencedColumnName = &quot;name&quot;)
      private Location routeTo;
  
      @ManyToOne
      @JoinColumn(name = &quot;route_from&quot;, referencedColumnName = &quot;name&quot;)
      private Location routeFrom;
  }
  </code></pre>
  <pre><code>CREATE TABLE route
  (
      id         BIGINT        NOT NULL AUTO_INCREMENT PRIMARY KEY,
      route_id   VARCHAR(36)   NOT NULL UNIQUE,
      bus_id     VARCHAR(36)   NOT NULL,
      route_from VARCHAR(255)  NOT NULL,
      route_to   VARCHAR(255)  NOT NULL,
      leaving    INT(4) UNSIGNED,
      arrival    INT(4) UNSIGNED,
      price      DECIMAL(4, 2) NOT NULL,
      FOREIGN KEY (bus_id) REFERENCES bus (bus_id) ON DELETE CASCADE,
      FOREIGN KEY (route_from) REFERENCES location (name) ON UPDATE CASCADE ON DELETE CASCADE,
      FOREIGN KEY (route_to) REFERENCES location (name) ON UPDATE CASCADE ON DELETE CASCADE
  );
  </code></pre>