Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: NamedNativeQuery.java 11282 2007-03-14 22:05:59Z epbernard $ |
2 | //EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc. |
||
3 | package javax.persistence; |
||
4 | |||
5 | import static java.lang.annotation.ElementType.*; |
||
6 | import java.lang.annotation.Retention; |
||
7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; |
||
8 | import java.lang.annotation.Target; |
||
9 | |||
10 | /** |
||
11 | * Is used to specify a native SQL named query. Query names are scoped to the persistence unit. |
||
12 | * |
||
13 | * @author Emmanuel Bernard |
||
14 | */ |
||
15 | @Target({TYPE}) |
||
16 | @Retention(RUNTIME) |
||
17 | public @interface NamedNativeQuery { |
||
18 | /** |
||
19 | * Is used to refer to the query when using the EntityManager methods that create query objects |
||
20 | */ |
||
21 | String name(); |
||
22 | /** |
||
23 | * The SQL query string |
||
24 | */ |
||
25 | String query(); |
||
26 | |||
27 | /** |
||
28 | * Vendor-specific query hints |
||
29 | */ |
||
30 | QueryHint[] hints() default {}; |
||
31 | /** |
||
32 | * The class of the result |
||
33 | */ |
||
34 | Class resultClass() default void.class; |
||
35 | /** |
||
36 | * The name of a SqlResultSetMapping, as defined in metadata |
||
37 | */ |
||
38 | String resultSetMapping() default ""; // name of SQLResultSetMapping |
||
39 | } |