title: Handling NULL values in @DiscriminatorColumn
body: <p>I have a legacy MS SQL Server 2000 datatabase I am trying to map with JPA (EclipseLink to be precise).</p>
  
  <p>I have a table "CONTACT1" with a text field "KEY1" which can be either 'Contact' or 'Asset', and I am using:</p>
  
  <pre><code>@Table(name = "CONTACT1")
  @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
  @DiscriminatorColumn(discriminatorType = DiscriminatorType.STRING, name = "KEY1")
  public abstract class Record {
  </code></pre>
  
  <p>to map it to two different classes (Contact and Asset).</p>
  
  <pre><code>@Entity
  @DiscriminatorValue(value = "Contact")
  public class Contact extends Record {...}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@Entity
  @DiscriminatorValue(value = "Asset")
  public class Asset extends Record {...}
  </code></pre>
  
  <p>Unfortunately I found out some or the records are missing, and after further analysis I realised some contact records have the "KEY1" field set to NULL.</p>
  
  <p>While I could just run an update query to fix the problem I would like to avoid that - is there a way to map that 'NULL' value to a Contact class?</p>
  
  <p>Failing that, is there a mechanism in JPA where I can pre-filter the recordsets making JPA believe that field is not NULL but it has 'Contact' written in it?</p>