Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 33 | PointedEar | 1 | //$Id: DiscriminatorValue.java 11282 2007-03-14 22:05:59Z epbernard $ |
| 2 | package javax.persistence; |
||
| 3 | |||
| 4 | import java.lang.annotation.Target; |
||
| 5 | import java.lang.annotation.Retention; |
||
| 6 | import static java.lang.annotation.RetentionPolicy.RUNTIME; |
||
| 7 | import static java.lang.annotation.ElementType.TYPE; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Is used to specify the value of the discriminator column for entities of the given type. |
||
| 11 | * The DiscriminatorValue annotation can only be specified on a concrete entity class. |
||
| 12 | * If the DiscriminatorValue annotation is not specified and a discriminator column is used, |
||
| 13 | * a provider-specific function will be used to generate a value representing the entity type. |
||
| 14 | * If the DiscriminatorType is STRING, the discriminator value default is the entity name. |
||
| 15 | * |
||
| 16 | * The inheritance strategy and the discriminator column are only specified in the root |
||
| 17 | * of an entity class hierarchy or subhierarchy in which a different inheritance strategy |
||
| 18 | * is applied. The discriminator value, if not defaulted, should be specified for each entity |
||
| 19 | * class in the hierarchy. |
||
| 20 | * |
||
| 21 | * @author Emmanuel Bernard |
||
| 22 | */ |
||
| 23 | @Target({TYPE}) @Retention(RUNTIME) |
||
| 24 | public @interface DiscriminatorValue { |
||
| 25 | /** |
||
| 26 | * The value that indicates that the row is an entity of the annotated entity type. |
||
| 27 | * |
||
| 28 | * If the DiscriminatorValue annotation is not specified and a discriminator column is used, |
||
| 29 | * a provider-specific function will be used to generate a value representing the entity type. |
||
| 30 | * If the DiscriminatorType is STRING, the discriminator value default is the entity name. |
||
| 31 | */ |
||
| 32 | String value(); |
||
| 33 | } |