This is the code
Code:
@Entity
public class Sinistre implements Serializable{
...
@Id
private long idH;
...
@AttributeOverrides({
@AttributeOverride(name="villeLieu", column=@Column(name="ville")),
@AttributeOverride(name="adresseLieu", column=@Column(name="adresse")),
@AttributeOverride(name="codePostalLieu", column=@Column(name="postal_code"))
})
private Adresse lieuDepannage;
@Column(name="lieuSinistre")
@AttributeOverrides({
@AttributeOverride(name="ville", column=@Column(name="ville")),
@AttributeOverride(name="adresse", column=@Column(name="adresse")),
@AttributeOverride(name="codePostal", column=@Column(name="postal_code"))
})
An this is the log error :
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
at project.control.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:108)
at project.control.Application.getAllFile(Application.java:108)
at project.control.Application.main(Application.java:80)
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: project.model.hibernate.Sinistre column: adresse (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:670)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:692)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:688)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:714)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:468)
at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at projectcontrol.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:101)
... 2 more