- ¿A que se debe este tipo de error? comprendo que es algun tipo de colision en la configuracion de mapeo de hibernate, pero no me queda claro
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/java.lang.J9VMInternals.ensureError(J9VMInternals.java:206)
at java.base/java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:195)
at com.tienda.pruebas.PruebaDesempeno.main(PruebaDesempeno.java:12)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: tienda] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1597)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1503)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at com.tienda.utils.JPAUtils.<clinit>(JPAUtils.java:8)
... 1 more
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.tienda.modelo.Cliente column: dni (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:895)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:913)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:935)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:637)
at org.hibernate.mapping.RootClass.validate(RootClass.java:267)
at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:359)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498)
... 5 more"
cliente.java
@Entity
@Table(name = "clientes")
public class Cliente {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String nombre;
private String dni;
@Embedded
private DatosPersonales datosPersonales;
DatosPersonales.java
@Embeddable
public class DatosPersonales {
private String nombre;
private String dni;