javax.persistence
Annotation Type AssociationOverride


@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface AssociationOverride

The AssociationOverride annotation is used to override a many-to-one or one-to-one mapping of property or field for an entity relationship.
The AssociationOverride annotation may be applied to an entity that extends a mapped superclass to override a many-to-one or one-to-one mapping defined by the mapped superclass. If the AssociationOverride annotation is not specified, the join column is mapped the same as in the original mapping.

Since:
JPA 1.0 version.
Author:
Florent Benoit
See Also:
JPA 2.0 specification

Required Element Summary
 String name
          (Required) The name of the relationship property whose mapping is being overridden if property-based access is being used, or the name of the relationship field if field-based access is used.
 
Optional Element Summary
 JoinColumn[] joinColumns
          (Required) The join column that is being mapped to the persistent attribute.
 JoinTable joinTable
          The join table that maps the relationship.
 

Element Detail

name

public abstract String name
(Required) The name of the relationship property whose mapping is being overridden if property-based access is being used, or the name of the relationship field if field-based access is used.

joinColumns

public abstract JoinColumn[] joinColumns
(Required) The join column that is being mapped to the persistent attribute. The mapping type will remain the same as is defined in the mapped superclass.

Default:
{}

joinTable

public abstract JoinTable joinTable
The join table that maps the relationship. The join- Table element must be specified if a join table is used in the overriding of the mapping of the relationship. The joinTable element must not be specified if a for- eign key mapping is used in the overriding of the map- ping of the relationship.

Default:
@javax.persistence.JoinTable


Copyright © 2007-2012 OW2 Consortium. All Rights Reserved.