title: Using JPA to access a view without a unique id returns null
body: <p>I am using JPA and have a view I would like to access. I am using a mapped entity with an embedded Id in many of my other classes to access tables with similar requirements. However here whenever there are nulls in the view that comprise the id, the whole object is returned as null. There are the right number of entities returned when i query, but they are null.</p>
  
  <p>Here are the classes:</p>
  
  <pre><code>{
  @Entity
  @Table(name = "VW_PRODUCT")
  public class VwProduct implements Serializable {
      @EmbeddedId
      private VwProductId id;
  
      public VwProduct() {
      }
  }
  
  {
  @Embeddable
  public class VwProductId implements java.io.Serializable {
  
      @Column(name = "PROD_NAME", nullable=true)
      private String prodName;
      @Column(name = "PROD_CTGRY", nullable=true)
      private String prodCtgry;
      @Column(name = "PROD_SBCTGRY", nullable=true)
      private String prodSbctgry;
  }
  </code></pre>
  
  <p>I omitted things like getters and setters and hashcode but i think my question is clear; how do I access this view, when some of its values are null?
  Thank you!</p>