Question: I need to override a getter of an entity object, on which the db column is defined, in it's superclass, so I can add additional annotations.

Example:

```
@MappedSuperclass
public class Person {

    String name;

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

@Entity
@Table(name="employee")
@XmlType(name="employee")
public class Employee extends Person {

    @Override
    @XmlAttribute(name = "name")
    public String getName() {
        return super.getName();
    }

}

```

Class `Person` contains common attributes for several entities. Class `Employee` extends person and defines a database table (table per class strategy). I also want to serialize class `Employee` to XML, so I need to add additional annotations to its getters, and therefore I'm overriding them.

The problem is that when I try to run this code, I get a Hibernate `MappingException` saying: Duplicate property mapping of name found in Employee.

Is there a way to tell Hibernate that the name getter in Employee is not duplicate but just overriden (perhaps with some annotation). Or is there another way to do what I need?

Answer: 
Try adding `@Transient` to the overriding property:

```
@Entity
@Table(name="employee")
@XmlType(name="employee")
public class Employee extends Person {

    @Override
    @XmlAttribute(name = "name")
    @Transient
    public String getName() {
        return super.getName();
    }

}

```
this is untested code but i hope it will work, use @AttributeOverride annotation like this 

```
@Entity
@Table(name="employee")
@XmlType(name="employee")
@AttributeOverride(name = "name", column = @Column(name = "name"))
public class Employee extends Person {

  @Override
  @XmlAttribute(name = "name")
  public String getName() {
    return super.getName();
  }

}

```