Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: NamedQuery.java 14392 2008-03-05 21:57:56Z epbernard $ |
2 | package org.hibernate.annotations; |
||
3 | |||
4 | import static java.lang.annotation.ElementType.PACKAGE; |
||
5 | import static java.lang.annotation.ElementType.TYPE; |
||
6 | import java.lang.annotation.Retention; |
||
7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; |
||
8 | import java.lang.annotation.Target; |
||
9 | |||
10 | /** |
||
11 | * Extends {@link javax.persistence.NamedQuery} with Hibernate features |
||
12 | * |
||
13 | * @author Carlos González-Cadenas |
||
14 | */ |
||
15 | @Target({TYPE, PACKAGE}) |
||
16 | @Retention(RUNTIME) |
||
17 | public @interface NamedQuery { |
||
18 | |||
19 | /** the name of the NamedQuery */ |
||
20 | String name(); |
||
21 | /** the Query String for the NamedQuery */ |
||
22 | String query(); |
||
23 | /** the flush mode for the query */ |
||
24 | FlushModeType flushMode() default FlushModeType.PERSISTENCE_CONTEXT; |
||
25 | /** mark the query as cacheable or not */ |
||
26 | boolean cacheable() default false; |
||
27 | /** the cache region to use */ |
||
28 | String cacheRegion() default ""; |
||
29 | /** the number of rows fetched by the JDBC Driver per roundtrip */ |
||
30 | int fetchSize() default -1; |
||
31 | /**the query timeout in seconds*/ |
||
32 | int timeout() default -1; |
||
33 | /**comment added to the SQL query, useful for the DBA */ |
||
34 | String comment() default ""; |
||
35 | /**the cache mode used for this query*/ |
||
36 | CacheModeType cacheMode() default CacheModeType.NORMAL; |
||
37 | /**marks whether the results are fetched in read-only mode or not*/ |
||
38 | boolean readOnly() default false; |
||
39 | |||
40 | } |