What is the AttributeOverride annotation used for Hibernate

@Entity
class User {
@EmbeddedId
@AttributeOverride(name="firstName", column=@Column(name="fld_firstname")
UserId id;
Integer age;
}
@Embeddable
class UserId implements Serializable {
String firstName;
String lastName;
}

I want to know what the use of AttributeOverride is. This is the code from hibernate interactive docs

+3
source share
1 answer

It is intended to indicate a different column name in the table other than that specified in your built-in class.

eg. AttributeOverride

+7
source

All Articles