Hi all
I'm trying to use JPA Annotations and I can't get it to work.
I think I've done everything well, but I keep getting this MappingException:
An AnnotationConfiguration instance is required to use <mapping class="com.video.bean.SimpleUser"/>
I'm testing Annotations with one particular class first.
hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
...........
<mapping class="com.video.bean.SimpleUser"/>
</session-factory>
</hibernate-configuration>
SimpleUser.java:
Code:
import javax.persistence.*;
@Entity
@Table(name = "SIMPLEUSER")
public class SimpleUser {
@Id @GeneratedValue
@Column(name = "MAIL")
private String mail;
@Column(name = "USERNAME")
private String userName;
@Column(name = "PASSWORD")
private String password;
I really don't know what am I doing wrong.
The exception seems pretty self explanatory, but in the book I'm reading says that adding the mapping tag in the hibernate.cfg.xml is enough.
Thanks,