Hi I am still really new to Hibernate and I was trying to follow the test set at org.hibernate.test.dynamicentity.tuplizer2 for my class. I have an interface like:
Code:
public interface User extends Persistent //Persistent is just setId(), getId()
{
void setUserName(String name);
void getUserName();
.....
}
with an implementation of adminUser
Code:
@Entity
@DiscriminatorValue(value="user")
@Table(name="TBLUSER") //tblUsers
public class RAPIDUser implements User
{
.....
@Override
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="id", updatable=false, nullable = false)
public Long getId()
{
}
public void setId(Long id)
{
this.id=id;
}
........
}
currently I am getting a Hibernate Mapping Exception because right now I am trying to persist my interface but really I need to persist my subclass. Would it be better to move my persistance code over to the interface and just make the subclass mapped class? Basically I am confusing myself in how to map my interface implementation classes with annotations.
Thank you