Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0 final with annotations 3.0 beta 1
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I have an interface class that I use to implement several concrete entities. For exaple:
Code:
public interface AgreementRole
{
public Agreement getAgreement();
}
@Entity
public class EmploymentAgreementRole implements AgreementRole
{
....
private EmploymentAgreement agreement;
@ManyToOne
@JoinColumn(name = "emp_agreement_id", referencedColumnName = "emp_agreement_id")
public EmploymentAgreement getAgreement()
{
return agreement;
}
}
As you can see from above, the implementation method
getAgreement returns a concrete implementation of the
Agreement interface but hibernate keeps asking for the interface:
Code:
org.hibernate.MappingException: Could not determine type for: com.xxx.Agreement, for columns: [org.hibernate.mapping.Column(agreement)]
How do I successfully use Abstract classes or Interface because it seems like hibernate keeps referring to them instead of the concrete entity classes.? I'm not using the inheritence annotations since I don't really need a main table for the parent class/interface.