Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different between @AttributeOverride and @AssociationOverride in JPA

What is the difference between @AttributeOverride and @AssociationOverride. Please explain me with the simple example.

like image 822
Ashwin Patil Avatar asked Mar 22 '23 10:03

Ashwin Patil


1 Answers

From official documentation:

@AssociationOverride

Used to override a mapping for an entity relationship

@AttributeOverride

Used to override the mapping of a Basic (whether explicit or default) property or field or Id property or field.

Read official javadoc: is well explained with some example.

like image 113
Luca Basso Ricci Avatar answered Apr 05 '23 22:04

Luca Basso Ricci