Hibernate JPA @AttributeOverrides Example

The @AttributeOverrides is used to group several @AttributeOverride annotations.

@AttributeOverrides used to override mappings of multiple properties or fields.


Example:

    @Embedded
    @AttributeOverrides({
            @AttributeOverride(name="startDate", 
                               column=@Column("EMP_START")),
            @AttributeOverride(name="endDate", 
                               column=@Column("EMP_END"))
    })
    public EmploymentPeriod getEmploymentPeriod() { ... }

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations