I get this error:
org.hibernate.AnnotationException:
No identifier specified for entity: com.ubosque.modelo.Ciudadano
my class:
@Entity
@Table(name="ciudadano")
public class Ciudadano implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private int id;
private String nombre;
private String apellido;
@Column(name="fecha_nac")
private Date fechaNac;
@Column(name="lugar_nac")
private String lugarNac;
private String direccion;
private String telefono;
@Column(name="estado_civil")
private String estadoCivil;
private String email;
@Column(name="desc_perfil_prof")
private String descPerfilProf;
// setters & getters ...
I know this error is because there is no @Id
annotation, but if I add @Id
to the id variable, when I deploy this error appears:
javax.servlet.ServletException:
javax.persistence.Table.indexes()[Ljavax/persistence/Index;
and this error ONLY disappears when I remove the @Id
annotation, so any suggestions will be appreciated.
my project is made with Maven 3
and the dependencies donwloaded through pom
are:
- mysql-connector-java-5.0.8
- hibernate-core-4.3.9.Final