title: SQL Error: 1064 Hibernate
body: <p>This is my Character class:</p>
  
  <pre><code>package webgame.model;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  @Entity
  @Table(name = "character")
  public class Character {
  
      @Id
      @Column(name = "id")
      @GeneratedValue
      private int id;
  
      @Column(name = "nivel")
      private int nivel;
  
      @Column(name = "experiencia")
      private int experiencia;
  
      @Column(name = "fuerza")
      private float fuerza;
  
      @Column(name = "inteligencia")
      private float inteligencia;
  
      @Column(name = "aguante")
      private float aguante;
  
      @Column(name = "agilidad")
      private float agilidad;
  
      @Column(name = "suerte")
      private float suerte;
  
      @Column(name = "dinero")
      private float dinero;
  
      public Character() {
      }
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public int getNivel() {
          return nivel;
      }
  
      public void setNivel(int nivel) {
          this.nivel = nivel;
      }
  
      public int getExperiencia() {
          return experiencia;
      }
  
      public void setExperiencia(int experiencia) {
          this.experiencia = experiencia;
      }
  
      public float getFuerza() {
          return fuerza;
      }
  
      public void setFuerza(float fuerza) {
          this.fuerza = fuerza;
      }
  
      public float getInteligencia() {
          return inteligencia;
      }
  
      public void setInteligencia(float inteligencia) {
          this.inteligencia = inteligencia;
      }
  
      public float getAguante() {
          return aguante;
      }
  
      public void setAguante(float aguante) {
          this.aguante = aguante;
      }
  
      public float getAgilidad() {
          return agilidad;
      }
  
      public void setAgilidad(float agilidad) {
          this.agilidad = agilidad;
      }
  
      public float getSuerte() {
          return suerte;
      }
  
      public void setSuerte(float suerte) {
          this.suerte = suerte;
      }
  
      public float getDinero() {
          return dinero;
      }
  
      public void setDinero(float dinero) {
          this.dinero = dinero;
      }
  }
  </code></pre>
  
  <p>And my BD:
  <img src="https://i.stack.imgur.com/qacfi.jpg" alt="enter image description here"></p>
  
  <p>Im using Spring, and when i enter to the path "/" i execute the insert, but i am geting:</p>
  
  <pre><code>SQL Error: 1064, SQLState: 42000
  2015-03-26 13:09:20.050 ERROR 5764 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : 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 'character (agilidad, aguante, dinero, experiencia, fuerza, inteligencia, nivel, ' at line 1
  </code></pre>
  
  <p>This is how i call the insert:</p>
  
  <pre><code>@RequestMapping(value="/", method = RequestMethod.GET)
  public String indexForm(Model model) {
  
      Character c = new Character();
      c.setNivel(1);
      c.setExperiencia(2);
      c.setFuerza(5);
      c.setInteligencia(10);
      c.setAguante(5);
      c.setAgilidad(3);
      c.setSuerte(2);
      c.setDinero(100);
  
      Session session = HibernateUtil.getSession();
      session.beginTransaction();
      session.save(c);
      session.getTransaction().commit();
      session.close();
  
  
      return "index";
  }
  </code></pre>
  
  <p>I have search and i dont think i have a sql reserved keyword.</p>