title: Preventing NaN from being persisted by Hibernate
body: <p>I am using Hibernate as my JPA provider with it connecting to a Progress database. When a NaN value is persisted it is causing lots of problems - it prevents the row from being read in certain circumstances. Is there a way to hook in to the standard double type persistence to convert NaN (and probably + and - infinity) to a different value? It does not matter if the NaN or infinity information is lost, I just want a readable row!</p>
  
  <p>I know I could do something like this:</p>
  
  <pre><code>@Column(name = "doubleColumn")
  public double getDoubleColumn() {
      return PersistedDouble.convert(doubleColumn);
  }
  </code></pre>
  
  <p>But I am worried about maintenance as that will have to be manually added for any doubles mapped to the database.</p>