View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package javax.jdo.metadata;
18  
19  /**
20   * Represents a named query.
21   * @since 3.0
22   */
23  public interface QueryMetadata extends Metadata {
24      /**
25       * Accessor for the name of the query (set on construction).
26       * 
27       * @return The name
28       */
29      String getName();
30  
31      /**
32       * Method to set the language of the query.
33       * 
34       * @param lang Query language
35       */
36      QueryMetadata setLanguage(String lang);
37  
38      /**
39       * Accessor for the query language.
40       * 
41       * @return The language
42       */
43      String getLanguage();
44  
45      /**
46       * Method to set the single-string query.
47       * 
48       * @param query The query
49       */
50      QueryMetadata setQuery(String query);
51  
52      /**
53       * Accessor for the single-string query.
54       * 
55       * @return The query
56       */
57      String getQuery();
58  
59      /**
60       * Method to set the result class name for the query
61       * 
62       * @param clsName Result class name
63       */
64      QueryMetadata setResultClass(String clsName);
65  
66      /**
67       * Accessor for the result class name for the query.
68       * 
69       * @return The result class name
70       */
71      String getResultClass();
72  
73      /**
74       * Method to set if the query results are unique
75       * 
76       * @param unique Whether they are unique
77       */
78      QueryMetadata setUnique(boolean unique);
79  
80      /**
81       * Accessor for whether results from the query are unique
82       * 
83       * @return Results are unique?
84       */
85      Boolean getUnique();
86  
87      /**
88       * Method to set the query as not being modifiable from now.
89       */
90      QueryMetadata setUnmodifiable();
91  
92      /**
93       * Accessor for whether the query is unmodifiable.
94       * 
95       * @return Can't be changed?
96       */
97      boolean getUnmodifiable();
98  
99      /**
100      * Method to set the FetchPlan to use for this named query.
101      * 
102      * @param fetchPlanName name of the FetchPlan
103      */
104     QueryMetadata setFetchPlan(String fetchPlanName);
105 
106     /**
107      * Accessor for the name of a fetch plan to use (if any).
108      * 
109      * @return The fetch plan name
110      */
111     String getFetchPlan();
112 }