title: Hibernate : Unknown column in field list
body: <p>I'am trying to do an unidirectional @OneTaMany relationship like in the <a href="http://docs.jboss.org/hibernate/orm/5.1/userguide/html_single/Hibernate_User_Guide.html#associations-one-to-many" rel="nofollow" title="Hibernate User Guide &#40;2.7.2&#41;">Hibernate User Guide (2.7.2)</a> but when I try to save the following object in a MariaDB Database:</p>
  
  <pre><code>Filter filter = new Filter("TLS_A320");
  filter.addConstraint(new Constraint(ConstraintType.DEPARTURE, "TLS"));
  filter.addConstraint(new Constraint(ConstraintType.AIRCRAFT, "A320"));
  session.save(filter);
  </code></pre>
  
  <p>I got this exception :</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Filter_idFilter' in 'field list'
  </code></pre>
  
  <p>Here are the 2 classes:</p>
  
  <p><strong>Filter.java</strong></p>
  
  <pre><code>public class Filter {
  
      @Id
      @Column(name = "idFilter")
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
  
      @Column(name = "name")
      private String name;
  
      @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
      private List&lt;Constraint&gt; constraintList;
  
      //more code
  };
  </code></pre>
  
  <p><strong>Constraint.java</strong></p>
  
  <pre><code>public class Constraint {
  
      @Id
      @Column(name = "idConstraint")
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
  
      @Column(name = "type")
      @Enumerated(EnumType.ORDINAL)
      private ConstraintType constraintType;
  
      @Column(name = "value")
      private String value;
  
      //more code
  }
  </code></pre>
  
  <p>And here is the tables definition :</p>
  
  <pre><code>CREATE TABLE `Constraint` (
      idConstraint INT NOT NULL AUTO_INCREMENT,
      type INT NOT NULL,
      value VARCHAR(10) NOT NULL,
  
      PRIMARY KEY (idConstraint)
  );
  
  CREATE TABLE Filter (
      idFilter INT NOT NULL AUTO_INCREMENT,
      name VARCHAR(50) UNIQUE NOT NULL,
  
      PRIMARY KEY (idFilter)
  );
  
  CREATE TABLE Filter_Constraint (
      idFilter INT UNIQUE NOT NULL,
      idConstraint INT NOT NULL,
  
      CONSTRAINT fk_Filter_Constraint_Filter FOREIGN KEY (idFilter) REFERENCES Filter(idFilter),
      CONSTRAINT fk_Filter_Constraint_Constraint FOREIGN KEY (idConstraint) REFERENCES `Constraint`(idConstraint)
  );
  </code></pre>
  
  <p>It seems to me that that Filter and Constraint insertions are fine and the exception happens when inserting in the Filter_Constraint table :</p>
  
  <pre><code>DEBUG org.hibernate.SQL - insert into Filter (name) values (?)
  DEBUG org.hibernate.id.IdentifierGeneratorHelper - Natively generated identity: 4
  DEBUG org.hibernate.SQL - insert into `Constraint` (type, value) values (?, ?)
  DEBUG org.hibernate.id.IdentifierGeneratorHelper - Natively generated identity: 5
  DEBUG org.hibernate.SQL - insert into `Constraint` (type, value) values (?, ?)
  DEBUG org.hibernate.id.IdentifierGeneratorHelper - Natively generated identity: 6
  DEBUG org.hibernate.SQL - insert into `Filter_Constraint` (Filter_idFilter, `constraintList_idConstraint`) values (?, ?)
  DEBUG org.hibernate.engine.jdbc.spi.SqlExceptionHelper - could not execute statement [n/a]
  DEBUG com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Filter_idFilter' in 'field list'
  </code></pre>
  
  <p>I'am pretty new to Hibernate and I just can't figure out what I did wrong.</p>