title: Why can't JPA entity classes can have custom instance variables?
body: <p>Suppose that I have a JPA entity class named <code>Photo</code> for storing photos. I also have another non-entity class named <code>PhotoStatus</code> to hold these count informations such as <code>shareCount</code>, <code>likeCount</code>, and <code>commentCount</code>. Now, if add an instance variable(<code>private PhotoStatus status;</code>) to the entity class <code>Photo</code>to hold these status information, The following error message is shown:</p>
  
  <blockquote>
    <p>Basic attributes can only be of the following types: Java primitive
    types, wrapper of primitive types, String, java.math.BigInteger,
    java.math.BigDecimal, java.util.Date, java.util.Calendar,
    java.sql.Date, java.sql.Time, java.sql.TimeStamp, byte[], Byte[],
    char[], Character[], enums, or any Serializable type.</p>
  </blockquote>
  
  <p>Why it is so?</p>