title: EclipseLink JPA 2 Type Not Valid For Serialized Mapping
body: <p>I am getting the following error when my application first runs...</p>
  
  <p>Caused by: Exception [EclipseLink-7155] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: The type [class Lap] for the attribute [lapId] on the entity class [class Novartis.OTM.Data.Db.Entities.DtsTmpClass] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.</p>
  
  <p>Here are the relevant entities.</p>
  
  <pre><code>@SequenceGenerator(name="SEQ_DTS_TMP_CLASS", sequenceName="SEQ_DTS_TMP_CLASS", allocationSize=1)
  @Entity
  @Table(name = "DTS_TMP_CLASS")
  @NamedQueries({
      @NamedQuery(name = "DtsTmpClass.findAll", query = "SELECT d FROM DtsTmpClass d"),
      @NamedQuery(name = "DtsTmpClass.findByDtsTmpClassId", query = "SELECT d FROM DtsTmpClass d WHERE d.dtsTmpClassId = :dtsTmpClassId")})
  public class DtsTmpClass implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @Basic(optional = false)
      @Column(name = "DTS_TMP_CLASS_ID")
      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_DTS_TMP_CLASS")
      private Integer dtsTmpClassId;
      @JoinColumn(name = "LAP_ID", referencedColumnName = "LAP_ID")
      @ManyToOne(optional = false, fetch=FetchType.EAGER)
      private Lap lapId;
      ...
  }
  </code></pre>
  
  <p>As you can see below, type Lap implements Serializable!</p>
  
  <pre><code>@SequenceGenerator(name="SEQ_LAP", sequenceName="SEQ_LAP", allocationSize=1)
  @Entity
  @Table(name = "LAP")
  @NamedQueries({
      @NamedQuery(name = "Lap.findAll", query = "SELECT l FROM Lap l"),
      @NamedQuery(name = "Lap.findByLapId", query = "SELECT l FROM Lap l WHERE l.lapId = :lapId"),
      @NamedQuery(name = "Lap.findByDeprecate", query = "SELECT l FROM Lap l WHERE l.deprecate = :deprecate")})
  public class Lap implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @Basic(optional = false)
      @Column(name = "LAP_ID")
      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_LAP")
      private Integer lapId;
      @Column(name = "DEPRECATE")
      private Character deprecate;
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "lapId")
      private Collection&lt;LapAnal&gt; lapAnalCollection;
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "lapId")
      private Collection&lt;LapDomain&gt; lapDomainCollection;
      @JoinColumn(name = "ASSAY_PLATFORM_ID", referencedColumnName = "LOOKUP_ID")
      @ManyToOne(optional = false, fetch=FetchType.EAGER)
      private Lookup assayPlatformId;
      @JoinColumn(name = "LABORATORY_ID", referencedColumnName = "LOOKUP_ID")
      @ManyToOne(optional = false, fetch=FetchType.EAGER)
      private Lookup laboratoryId;
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "lapId")
      private Collection&lt;DtsTmpClass&gt; dtsTmpClassCollection;
      ...
  }
  </code></pre>
  
  <p>What really odd is that I just shortened the table and column names so Oracle wouldn't barf over the 30 character limit. It was just working.</p>
  
  <p>I'm baffled!</p>
  
  <p>Thanks,</p>
  
  <p>Chris</p>