title: Hibernate NullableType Performance Problem
body: <p>I'm having a problem with the performance of one of my queries and after profiling with jprofiler I have established that 60% of the query time is in joda's hibernate library with calls to nullSafeSet and nullSafeGet. I can't for the life of me work out why it would spend so much time there.</p>
  
  <p>The domain object being retrieved contains two DateTime attributes, both of which may be null. The query I'm executing (which takes &lt;1ms) does an equality check on one of the date times to ensure it is null and a less than comparison on the other date. Jprofiler calls nullSafeSet once and nullSafeGet is called twice. The nullSafeGet executions take a total of 19.7ms and the nullSafeSet takes 25.9ms. The method that the nullSafeSet calls and spends most of it's time is <code>java.sql.PreparedStatement.setTimestamp</code> and for the nullSafeGet invocations the time is spend in the constructor of <code>org.joda.time.convert.ConverterManager</code>. </p>
  
  <p>Does anyone have a suggestion as to how I can improve this situation?!</p>
  
  <p>I'm not sure if the screenshot below will be useful or not, or even whether it will be legible. It's an output from jprofiler showing where the time is spent and the query being executed. </p>
  
  <p><img src="https://i.stack.imgur.com/Ab4EK.png" alt="enter image description here"></p>