title: Hibernate dont use dialect INNODB
body: <p>Im using Spring and Hibernet to develop a Java webapp.</p>
  
  <p>I want declare foreign keys, so I need use INNODB engine. I have declarated it at the datasource.XML, but the table are created automatically by Hibernate using MYSAM engine.</p>
  
  <p>Here my Entity:</p>
  
  <pre><code>package com.atlantis.atecliente.model;
  
  import java.util.List;
  </code></pre>
  
  <p>import javax.persistence.*;</p>
  
  <pre><code>@Entity
  @Table(name="Expediente")
  public class Expediente {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private int codigo;
  
  @ManyToOne
  @JoinColumn(name = "tipoExpediente")
  private TipoExpediente tipoExpediente;
  
  @Column(length = 30)
  private String estado;
  
  public int getCodigo() {
      return codigo;
  }
  
  public void setCodigo(int codigo) {
      this.codigo = codigo;
  }
  
  public TipoExpediente getTipoExpediente() {
      return tipoExpediente;
  }
  
  public void setTipoExpediente(TipoExpediente tipoExpediente) {
      this.tipoExpediente = tipoExpediente;
  }
  
  public String getEstado() {
      return estado;
  }
  
  public void setEstado(String estado) {
      this.estado = estado;
  }
  
  }
  </code></pre>
  
  <p>And here the datasource.XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:tx="http://www.springframework.org/schema/tx"     xmlns:jdbc="http://www.springframework.org/schema/jdbc"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans.xsd
     http://www.springframework.org/schema/tx 
     http://www.springframework.org/schema/tx/spring-tx-3.1.xsd     http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"&gt;
  
  &lt;!--    &lt;jdbc:embedded-database id="dataSource" /&gt;--&gt;
  
      &lt;!-- data source for our database --&gt;
  &lt;bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName"
          value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" /&gt;
      &lt;property name="url" value="jdbc:mysql://SBPORTALPRE/atclientepre" /&gt;
      &lt;property name="username" value="********" /&gt;
      &lt;property name="password" value="********" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sessionFactory"     class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;property name="packagesToScan"&gt;
          &lt;list&gt;
              &lt;value&gt;com.atlantis.atecliente.model&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="dialect"&gt;org.hibernate.dialect.MySQL5InnoDBDialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt;
  &lt;bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Some help please?</p>