EclipseLink 1.2.0, build 'v20091016-r5565' API Reference

javax.persistence
Annotation Type EmbeddedId


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

Is applied to a persistent field or property of an entity class or mapped superclass to denote a composite primary key that is an embeddable class. The embeddable class must be annotated as Embeddable.

Relationship mappings defined within an embedded id class are not supported.

The AttributeOverride annotation may be used to override the column mappings declared within the embeddable class.

There must be only one EmbeddedId annotation and no Id annotation when the EmbeddedId annotation is used. The MappedById annotation may be used in conjunction with the EmbeddedId annotation to specify a derived primary key.

    Example:

    @EmbeddedId
    protected EmployeePK empPK;
 

See Also:
Embeddable, MappedById
Since:
Java Persistence 1.0


EclipseLink 1.2.0, build 'v20091016-r5565' API Reference