title: Storing Double.POSITIVE_INFINITY in MySQL (EJB entity/JBoss)
body: <p>I have the following simple JPA entity:</p>
  
  <pre><code>@Entity
  @Table( name = myentity_table )
  public class MyEntity {
  
    private double a;
    private double b;
    //(...)
  }
  </code></pre>
  
  <p><strong>a</strong> and <strong>b</strong> may be set to <code>Double.POSITIVE_INFINITY</code>. When I try to store entity with double set to +INF into database (MySQL) using standard entity manager I get exception:</p>
  
  <blockquote>
    <p>java.sql.SQLException: 'Infinity' is not a valid numeric or approximate numeric value</p>
  </blockquote>
  
  <p>As far as I know MySQL may not support NaN/-INF/+INF numbers. Is there any way to store this entity without writing HQL queries and translating +INF into null (or max double) ? Ideally,  I'd like to do it via entity manager as usual.</p>
  
  <p>Thanks in advance.</p>