title: Hibernate Could not determine type for collection
body: <p>I'm getting error like:</p>
  
  <blockquote>
    <p>org.hibernate.MappingException: Could not determine type for: java.util.Collection, at table: customers, for columns: [org.hibernate.mapping.Column(contacts)]</p>
  </blockquote>
  
  <p>My code looks like:</p>
  
  <pre><code>@Setter
  @MappedSuperclass
  @NoArgsConstructor
  @EqualsAndHashCode(callSuper = true)
  public abstract class PersonEntity&lt;C extends ContactEntity&gt; extends BaseEntity {
  
      protected String firstName;
      protected String lastName;
  
      @Column(name = FIRST_NAME_COLUMN, nullable = false)
      public String getFirstName() {
          return firstName;
      }
  
      @Column(name = LAST_NAME_COLUMN, nullable = false)
      public String getLastName() {
          return lastName;
      }
  
      public abstract Collection&lt;C&gt; getContacts();
  }
  </code></pre>
  
  <p>PersonEntity</p>
  
  <pre><code>@Setter
  @MappedSuperclass
  @NoArgsConstructor
  @EqualsAndHashCode(callSuper = true)
  public abstract class ContactEntity extends BaseEntity {
  
      private String contact;
  
      @Column(name = CONTACT_COLUMN, nullable = false)
      public String getContact() {
          return contact;
      }
  }
  </code></pre>
  
  <p>Customer</p>
  
  <pre><code>@Entity
  @Setter
  @NoArgsConstructor
  @EqualsAndHashCode(callSuper = true)
  @Table(name = TABLE_NAME)
  public class Customer extends PersonEntity&lt;CustomerContact&gt; implements User {
  
      private Collection&lt;CustomerContact&gt; contacts;
  
      @Id
      @Override
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQUENCE_NAME)
      @SequenceGenerator(name = SEQUENCE_NAME, sequenceName = SEQUENCE_NAME, allocationSize = 1)
      public Long getId() {
          return this.id;
      }
  
      @Override
      @OneToMany(targetEntity = CustomerContact.class, mappedBy = "customer", cascade = {CascadeType.PERSIST, CascadeType.MERGE}, orphanRemoval = true)
      public Collection&lt;CustomerContact&gt; getContacts() {
          return contacts;
      }
  }
  </code></pre>
  
  <p>ContactEntity</p>
  
  <pre><code>@Entity
  @Setter
  @NoArgsConstructor
  @Table(name = TABLE_NAME)
  @ToString(exclude = "customer")
  public class CustomerContact extends ContactEntity {
  
  
      private Customer customer;
  
      @Id
      @Override
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQUENCE_NAME)
      @SequenceGenerator(name = SEQUENCE_NAME, sequenceName = SEQUENCE_NAME, allocationSize = 1)
      public Long getId(){
          return this.id;
      }
  
      @ManyToOne
      @JsonIgnore
      @JoinColumn(name = CUSTOMER_COLUMN, nullable = false)
      public cCustomer getCustomer() {
          return customer;
      }
  }
  </code></pre>
  
  <p>CustomerContact</p>
  
  <p>Is it not possible to add abstract method to the parent class with generic type and then override it with chosen type?</p>