what is AttributeOverride annotation used for in Hibernate

12,403

It is for specifying another name for the column in the table other than the one specified in your embedded class.

E.g. AttributeOverride

Share:
12,403
Admin
Author by

Admin

Updated on June 05, 2022

Comments

  • Admin
    Admin almost 2 years
    @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 is the use of AttributeOverride. This is the code from hibernate online docs