title: Cannot instantiate abstract class or interface : problem while persisting
body: <p>i have a class campaign that maintains a list of AdGroupInterfaces. im going to persist its implementation</p>
  
  <pre><code>    @Entity
       @Table(name = "campaigns")
       public class Campaign implements Serializable,Comparable&lt;Object&gt;,CampaignInterface               {
  private static final long serialVersionUID = 1L;
  
  
      @Id 
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;
  
      @OneToMany (
          cascade = {CascadeType.ALL},
          fetch = FetchType.EAGER,
      targetEntity=AdGroupInterface.class
          )
  @org.hibernate.annotations.Cascade(
  value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN
  )
  @org.hibernate.annotations.IndexColumn(name = "CHOICE_POSITION")
   private List&lt;AdGroupInterface&gt; AdGroup;
  
  
  public Campaign() {
      super();
  }
  
  public List&lt;AdGroupInterface&gt; getAdGroup() {
      return AdGroup;
  }
  
  public void setAdGroup(List&lt;AdGroupInterface&gt; adGroup) {
      AdGroup = adGroup;
  }
  
  public void set1AdGroup(AdGroupInterface adGroup) {
      if(AdGroup==null)
          AdGroup=new LinkedList&lt;AdGroupInterface&gt;();
      AdGroup.add(adGroup);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>AdGroupInterface's implementation is AdGroups. when i add an adgroup to the list in campaign,</p>
  
  <p>campaign c;
  c.getAdGroupList().add(new AdGroups()), etc
  and 
  save campaign</p>
  
  <p>it says"Cannot instantiate abstract class or interface :" AdGroupInterface</p>
  
  <p>its not recognizing the implementation just before persisting...</p>
  
  <p>Whereas Persisting adGroups separately works. when it is a member of another entity, it doesnt get persisted.</p>
  
  <pre><code>         import java.io.Serializable;
           import java.util.List;
           import javax.persistence.*;
  
  
            @Entity
  
            @DiscriminatorValue("1")
  
            @Table(name = "AdGroups")
  
           public class AdGroups implements Serializable,Comparable,AdGroupInterface{
  
  
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  
  private Long Id;
  
  
  private String Name;
  
  
  private CampaignInterface Campaign;
  
  
  private MonetaryValue DefaultBid;
  
      public AdGroups(){
  
      super();
  }
  public AdGroups( String name, CampaignInterface campaign) {
      super();
      this.Campaign=new Campaign();
      Name = name;
      this.Campaign = campaign;
      DefaultBid = defaultBid;
      AdList=adList;
  }
  
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name="AdGroup_Id")
  public Long getId() {
      return Id;
  }
  
  public void setId(Long id) {
      Id = id;
  }
  
  @Column(name="AdGroup_Name")
  public String getName() {
      return Name;
  }
  
  public void setName(String name) {
      Name = name;
  }
  
  @ManyToOne
  @JoinColumn (name="Cam_ID", nullable = true,insertable = false)
  public CampaignInterface getCampaign() {
  
      return Campaign;
  }
  
  public void setCampaign(CampaignInterface campaign) {
      this.Campaign = campaign;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>what am i missing?? please look into it ...</p>