Attribute Override in Hibernate
Model Class /** * */ package com.learnjavabyanand; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; /** * @author ananddw * */ @Entity @Table(name="student_details") public class Student { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int studentrollnumber; @Column(name="student_name") private String studentName; @AttributeOverrides({ @AttributeOverride(name="company_location",column=@Column(name="company1_location")), @AttributeOverride(name="company_name",column=@Column(name="company1_name"))}) private CompanyDetails comany_detalils; public CompanyDetails getComany_detali