Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
//$Id: $
2
package org.hibernate.annotations;
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.METHOD;
8
import static java.lang.annotation.ElementType.FIELD;
9
import javax.persistence.Column;
10
 
11
/**
12
 * Define the map key columns as an explicit column holding the map key
13
 * This is completly different from {@link javax.persistence.MapKey} which use an existing column
14
 * This annotation and {@link javax.persistence.MapKey} are mutually exclusive
15
 *
16
 * @author Emmanuel Bernard
17
 */
18
@Target({METHOD, FIELD})
19
@Retention(RUNTIME)
20
public @interface MapKey {
21
        Column[] columns() default {};
22
        /**
23
         * Represent the key class in a Map
24
         * Only useful if the collection does not use generics
25
         */
26
        Class targetElement() default void.class;
27
 
28
        /**
29
         * The optional map key type. Guessed if default
30
         */
31
        Type type() default @Type(type = "");
32
}