title: Mapping Exception with Hibernate 4.0, UserType 3.0.0.CR4 and Joda Time 2.1
body: <p>I am currently trying to persist Joda Time in Hibernate using <a href="http://usertype.sourceforge.net/" rel="nofollow noreferrer">usertype</a>, but I keep on getting the following error in eclipse.</p>
  
  <p><img src="https://i.stack.imgur.com/vAqAL.png" alt="Error Message"></p>
  
  <p>(failed.org.hibernate.MappingException: Could not determine type for: org.jadira.usertype.dateandtime.jsr310.PersistentLocalDateTime, at table: MODEL_OBJECT, for columns: [org.hibernate.mapping.Column(MODIFIED_DATE_TIME)])</p>
  
  <p>my xml file looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE ibernate-mapping PUBLIC 
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping package="model" &gt;
      &lt;class name="ModelObject" table="MODEL_OBJECT"&gt;
          &lt;id name="id" column="MODEL_ID" &gt;
              &lt;generator class="native"&gt;&lt;/generator&gt;
      &lt;/id&gt;
      &lt;property name="modifiedDateTime"             
              type="org.jadira.usertype.dateandtime.jsr310.PersistentLocalDateTime"
              column="MODIFIED_DATE_TIME"/&gt;
          &lt;property name="creationDateTime"
              type="org.jadira.usertype.dateandtime.jsr310.PersistentLocalDateTime"
              column="CREATION_DATE_TIME"/&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;`
  </code></pre>
  
  <p>and my java file looks like this</p>
  
  <pre><code>package model;
  import java.beans.PropertyChangeListener;
  import java.beans.PropertyChangeSupport;
  import org.joda.time.LocalDateTime;
  
  public abstract class ModelObject  {
  
  private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
  
  private long id;
  private LocalDateTime  modifiedDateTime = new LocalDateTime ();
  private LocalDateTime  creationDateTime = new LocalDateTime ();
  
  public Long getId(){
      return id;
  }
  
  public void setId(Long id){
      firePropertyChange("id", this.id, this.id = id);
  }
  
  public LocalDateTime  getModifiedDateTime(){
      return modifiedDateTime;
  }
  
  public void setModifiedDateTime(LocalDateTime  modifiedDateTime) {
      firePropertyChange("modifiedDateTime", 
                  this.modifiedDateTime, 
                  this.modifiedDateTime = modifiedDateTime);
  }
  
  public LocalDateTime  getCreationDateTime(){
      return creationDateTime;
  }
  
  public void setCreationDateTime(LocalDateTime  creationDateTime){
      firePropertyChange("creationDateTime", 
                  this.creationDateTime, 
                  this.creationDateTime = creationDateTime);
  }
  
  public void addPropertyChangeSupportListener(PropertyChangeListener listener){
      changeSupport.addPropertyChangeListener(listener);
  }
  
  public void removePropertyChangeListener(PropertyChangeListener listener){
      changeSupport.removePropertyChangeListener(listener);
  }
  
  public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener){
      changeSupport.addPropertyChangeListener(propertyName, listener);
  }
  
  public void removePropertyChangeListener(String propertyName, 
                                               PropertyChangeListener listener){
      changeSupport.addPropertyChangeListener(propertyName, listener);
  }
  
  protected void firePropertyChange(String propertyName, Object oldValue, Object newValue){
      changeSupport.firePropertyChange(propertyName, oldValue, newValue);
  }
  
  }
  </code></pre>
  
  <p>I have added usertype.spi-3.0.0.jar and usertype.core.3.0.0.CR3.jar to my class path.</p>
  
  <p>I have no idea what is going on here so help would be greatly appreciated</p>