title: Hibernate: Can't insert data into table
body: <p>I'm not able to insert data into all my tables, select works with no problems. The user used has the permissions to insert data, i also tried inserting data manually.</p>
  
  <p>All configuration files like hibernate.cfg, hibernate.reveng and hbm.xml are generated by <code>NetBeans</code>.</p>
  
  <p>Event.hbm.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated Apr 20, 2015 10:05:17 AM by Hibernate Tools 4.3.1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="at.ac.univie.salome.domain.Event" table="event" catalog="salomeapp" optimistic-lock="version"&gt;
          &lt;id name="id" type="java.lang.Integer"&gt;
              &lt;column name="id" /&gt;
              &lt;generator class="identity" /&gt;
          &lt;/id&gt;
          &lt;property name="title" type="string"&gt;
              &lt;column name="title" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;property name="desc" type="string"&gt;
              &lt;column name="desc" length="1024" /&gt;
          &lt;/property&gt;
          &lt;set name="partitions" table="partition" inverse="true" lazy="true" fetch="select"&gt;
              &lt;key&gt;
                  &lt;column name="event_id" not-null="true" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="at.ac.univie.salome.domain.Partition" /&gt;
          &lt;/set&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>hibernate.cfg.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5Dialect&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/salomeapp?zeroDateTimeBehavior=convertToNull&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;******&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;******&lt;/property&gt;
      &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;
      &lt;mapping resource="at/ac/univie/salome/domain/Partition.hbm.xml"/&gt;
      &lt;mapping resource="at/ac/univie/salome/domain/Chunk.hbm.xml"/&gt;
      &lt;mapping resource="at/ac/univie/salome/domain/Event.hbm.xml"/&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc) values ('Test', 'test')' at line 1
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      at com.mysql.jdbc.Util.getInstance(Util.java:386)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:187)
      ... 102 more
  </code></pre>
  
  <p>Im using <code>Netbeans</code>, <code>Glassfish 4</code>, <code>Hibernate 4.3</code> and <code>MySQL 5.6.23</code>.</p>