KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > requests > ParsingGranularities


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: sequoia@continuent.org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * Initial developer(s): Emmanuel Cecchet.
20  * Contributor(s): Sara Bouchenak.
21  */

22
23 package org.continuent.sequoia.controller.requests;
24
25 /**
26  * Defines SQL queries parsing granularities.
27  *
28  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet</a>
29  * @author <a HREF="mailto:Sara.Bouchenak@epfl.ch">Sara Bouchenak</a>
30  * @version 1.0
31  */

32 public class ParsingGranularities
33 {
34   /** The request is not parsed. */
35   public static final int NO_PARSING = 0;
36
37   /**
38    * Table granularity. Only table dependencies are computed.
39    */

40   public static final int TABLE = 1;
41
42   /**
43    * Column granularity. Column dependencies are computed (both select and where
44    * clauses).
45    */

46   public static final int COLUMN = 2;
47
48   /**
49    * Column granularity with <code>UNIQUE</code> queries.
50    * <p>
51    * Same as <code>COLUMN</code> except that <code>UNIQUE</code> queries
52    * that select a single row based on a key are flagged <code>UNIQUE</code>
53    * (and should not be invalidated on <code>INSERTs</code>).
54    */

55   public static final int COLUMN_UNIQUE = 3;
56
57   /**
58    * Returns the granularity value in a <code>String</code> form.
59    *
60    * @param granularity a granularity value
61    * @return the <code>String</code> form of the granularity
62    */

63   public static String JavaDoc getInformation(int granularity)
64   {
65     switch (granularity)
66     {
67       case NO_PARSING :
68         return "NO_PARSING";
69       case TABLE :
70         return "TABLE";
71       case COLUMN :
72         return "COLUMN";
73       case COLUMN_UNIQUE :
74         return "COLUMN_UNIQUE";
75       default :
76         return "Illegal parsing granularity";
77     }
78   }
79 }
80
Popular Tags