title: hibernate.MappingException persistent class not known
body: <p>I have this exception : </p>
  
  <blockquote>
    <p>org.hibernate.MappingException: persistent class not known:
    java.lang.Long</p>
  </blockquote>
  
  <p>I'm using Hibernate 5.1.0.Final and spring-orm 4.2.4.RELEASE</p>
  
  <p>My spring configuration file (<code>spring.xml</code>) :</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:aop="http://www.springframework.org/schema/aop"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"&gt;
  &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
      destroy-method="close"&gt;
      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
      &lt;property name="url" value="jdbc:mysql://localhost/ecollection" /&gt;
      &lt;property name="username" value="root" /&gt;
      &lt;property name="password" value="" /&gt;
  &lt;/bean&gt;
  &lt;bean id="hibernateAnnotatedSessionFactory" 
      class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"&gt;
  
      &lt;property name="dataSource" ref="dataSource" /&gt;
  
      &lt;property name="annotatedClasses"&gt;
          &lt;list&gt;
              &lt;value&gt;com.ecollection.model.Adresse&lt;/value&gt;
              &lt;value&gt;com.ecollection.model.Utilisateur&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5InnoDBDialect&lt;/prop&gt;
              &lt;prop key="hibernate.current_session_context_class"&gt;thread&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;false&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  
  &lt;/bean&gt;
  &lt;bean id="utilisateurDao" class="com.ecollection.dao.UtilisateurDaoImpl"&gt;
      &lt;property name="sessionFactory" ref="hibernateAnnotatedSessionFactory" /&gt;
  &lt;/bean&gt;
  &lt;bean id="adresseDao" class="com.ecollection.dao.AdresseDaoImpl"&gt;
      &lt;property name="sessionFactory" ref="hibernateAnnotatedSessionFactory" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>And I have two MySQL tables, <code>User</code> and <code>Address</code>.</p>
  
  <pre><code>User = Id, Name and Firstname
  Address = Id, Street, City and UserId
  </code></pre>
  
  <p>for UserId in my Address entitybean, I'm doing this :</p>
  
  <pre><code>@OneToOne
  @JoinColumn(name="id")
  public Long getIdUtilisateur() {
      return idUtilisateur;
  }
  </code></pre>