title: hibernate 4 difference between xml and java config dialect
body: <p>I have a hibernate project and I am trying to configure it with xml and annotations, but</p>
  
  <p>When I write</p>
  
  <pre><code>&lt;bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
      &lt;property name="database" value="INFORMIX" /&gt;
      &lt;property name="databasePlatform" value="mypackage.MyInformixDialect" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>It works ok, but if I write:</p>
  
  <pre><code>@Bean
  public HibernateJpaVendorAdapter jpaVendorAdapter() {
      HibernateJpaVendorAdapter h = new HibernateJpaVendorAdapter();
      h.setDatabase(Database.INFORMIX);
      h.setDatabasePlatform("mypackage.MyInformixDialect");
      return h;
  }
  </code></pre>
  
  <p>It says that</p>
  
  <pre><code>Unable to resolve name mypackage.MyInformixDialect as strategy [org.hibernate.dialect.Dialect]
  </code></pre>
  
  <p>Why?</p>