Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
package org.hibernate.annotations;
2
 
3
import static java.lang.annotation.ElementType.PACKAGE;
4
import static java.lang.annotation.ElementType.TYPE;
5
import java.lang.annotation.Retention;
6
import static java.lang.annotation.RetentionPolicy.RUNTIME;
7
import java.lang.annotation.Target;
8
 
9
/**
10
 * Extends {@link javax.persistence.NamedNativeQuery} with Hibernate features
11
 *
12
 * @author Emmanuel Bernard
13
 */
14
@Target({TYPE, PACKAGE})
15
@Retention(RUNTIME)
16
public @interface NamedNativeQuery {
17
        String name();
18
 
19
        String query();
20
 
21
        Class resultClass() default void.class;
22
 
23
        String resultSetMapping() default ""; // name of SQLResultSetMapping
24
        /** the flush mode for the query */
25
        FlushModeType flushMode() default FlushModeType.PERSISTENCE_CONTEXT;
26
        /** mark the query as cacheable or not */
27
        boolean cacheable() default false;
28
        /** the cache region to use */
29
        String cacheRegion() default "";
30
        /** the number of rows fetched by the JDBC Driver per roundtrip */
31
        int fetchSize() default -1;
32
        /**the query timeout in seconds*/
33
        int timeout() default -1;
34
 
35
        boolean callable() default false;
36
        /**comment added to the SQL query, useful for the DBA */
37
        String comment() default "";
38
        /**the cache mode used for this query*/
39
        CacheModeType cacheMode() default CacheModeType.NORMAL;
40
        /**marks whether the results are fetched in read-only mode or not*/
41
        boolean readOnly() default false;
42
}