Hi!
I have two entities A and B, each one has its own subclasses (with TABLE_PER_CLASS inheritance strategy and TABLE id generation strategy) and there is a OneToMany relationship between them. When the application is being deployed I get the following exception:
org.hibernate.MappingException: Could not determine type for: java.util.List, at table: B, for columns: [org.hibernate.mapping.Column(objects)]
neither entity has an 'objects' attribute.
Any help appreciated
Regards
Code:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class A {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
protected Long id;
@OneToMany(fetch = FetchType.LAZY, mappedBy="a", cascade = CascadeType.REFRESH)
protected List<B> bs;
...
Code:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class B {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
protected Long id;
@ManyToOne(optional = false, fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
protected A a;
...