Exception: Repeated column in mapping for entity: column: hash (should be mapped with insert=“false” update=“false”)

1 answer

I am very much new to Hibernate framework and getting an exception while running the code:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.hibernate.SessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is org.hibernate.MappingException: Repeated column in mapping for entity: LeiRecord column: hash (should be mapped with insert="false" update="false") 

This error i am getting in many places in SpringConfiguration, oracleDataDao and not understanding where the code is getting wrong as i have not defined repeated column in mapping

All answers to this question, which has the identifier 61232181

The best answer:

You should have class Address annotated as @Embeddable and then reference its instances in LeiRecord entity for addressLegal and addressHeadquearters

@Embeddable @Getter @Setter public class Address {     private String firstAddr;    private String nextAddr;    //... etc. }  @Getter @Data @Entity @Table(name = "BK_TEST") @Immutable public class LeiRecord { // ...     @Embedded     @AttributeOverrides(         {             @AttributeOverride(name = "firstAddr",   column = @Column(name = "legalAddress_firstAddr")),             @AttributeOverride(name = "nextAddr",    column = @Column(name = "legalAddress_nextAddr")),             @AttributeOverride(name = "region",      column = @Column(name = "legalAddress_region")),             @AttributeOverride(name = "postalCode",  column = @Column(name = "legalAddress_postalCode")),             @AttributeOverride(name = "city",        column = @Column(name = "legalAddress_city")),             @AttributeOverride(name = "country",     column = @Column(name = "legalAddress_country")),             @AttributeOverride(name = "mailRouting", column = @Column(name = "legalAddress_mailRouting"))         }     )     private Address addressLegal;      @Embedded     @AttributeOverrides(         {             @AttributeOverride(name = "firstAddr",   column = @Column(name = "headquartersAddress_firstAddr")),             @AttributeOverride(name = "nextAddr",    column = @Column(name = "headquartersAddress_nextAddr")),             @AttributeOverride(name = "region",      column = @Column(name = "headquartersAddress_region")),             @AttributeOverride(name = "postalCode",  column = @Column(name = "headquartersAddress_postalCode")),             @AttributeOverride(name = "city",        column = @Column(name = "headquartersAddress_city")),             @AttributeOverride(name = "country",     column = @Column(name = "headquartersAddress_country")),             @AttributeOverride(name = "mailRouting", column = @Column(name = "headquartersAddr_mailRouting"))         }     )     private Address addressHeadquarters;      //... other entity fields  } 

Last questions

how do i remove the switch on my home screen?
how to edit the JS date and time to update atuomatically?
How to utilize data stored in a multidimensional array
Powermockito not mocking URL constructor in URI.toURL() method
Android Bluetooth LE Scanner only scans when phone's Location is turned on in some devices
docker wordpress container can't connect to mysql container
How can I declare a number in java that is more than 64-bits? [duplicate]
Optaplanner solutionClass entityCollectionProperty should never return null error when simple JSON object passed to controller
Anylogic, get the time a pedestrain is in a queue
How do I fix this syntax issue with my .flex file?
Optimizing query in PHP
How to find the highest number of a column and print two columns of that row in R?
Ideas on “Error: Type com.google.firebase.iid.zzav is referenced as an interface from com.google.firebase.messaging.zzd”?
JCIFS SmbFile.exists() and SmbFile.isDirectory() return false when it exists and I can listFiles()
PHP total order
Laravel booking system design
neural net - undefined column selected
How to indicate y axis does not start from 0 in ggplot?
Fragments in backStack
Spinner how to change the data