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() { ... }
@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
Post a Comment