1   /*
2    * Copyright 2003 - 2013 The eFaps Team
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   * Revision:        $Rev$
17   * Last Changed:    $Date$
18   * Last Changed By: $Author$
19   */
20  
21  package org.efaps.db.wrapper;
22  
23  
24  /**
25   * Enum is used to write the different standard sql part of a sql statement.
26   * This serves to elamintaed problems in future implementation of different
27   * databases.
28   *
29   * @author The eFaps Team
30   * @version $Id$
31   */
32  public enum SQLPart {
33      /** all. */
34      ALL("all"),
35      /** and. */
36      AND("and"),
37      /** asc. */
38      ASC("asc"),
39      /** ,. */
40      COMMA(","),
41      /** distinct. */
42      DISTINCT("distinct"),
43      /** desc. */
44      DESC("desc"),
45      /** Renders as default: "delete". */
46      DELETE("delete"),
47      /** from. */
48      FROM("from"),
49      /** =. */
50      EQUAL("="),
51      /** >. */
52      GREATER(">"),
53      /** FALSE. */
54      FALSE("FALSE"),
55      /** in. */
56      IN("in"),
57      /** Renders as default: "inner". */
58      INNER("inner"),
59      /** Renders as default: "insert". */
60      INSERT("insert"),
61      /** Renders as default: "into". */
62      INTO("into"),
63      /** is. */
64      IS("is"),
65      /** left. */
66      JOIN("join"),
67      /** left. */
68      LEFT("left"),
69      /** <. */
70      LESS("<"),
71      /** like. */
72      LIKE("like"),
73      /** limit. */
74      LIMIT("limit"),
75      /** null. */
76      NULL("null"),
77      /** not. */
78      NOT("not"),
79      /** on. */
80      ON("on"),
81      /** or. */
82      OR("or"),
83      /** order by. */
84      ORDERBY("order by"),
85      /** ). */
86      PARENTHESIS_CLOSE(")"),
87      /** (. */
88      PARENTHESIS_OPEN("("),
89      /** select. */
90      SELECT("select"),
91      /**  Renders as default: "set". */
92      SET("set"),
93      /** .*/
94      SPACE(" "),
95      /** TRUE. */
96      TRUE("TRUE"),
97      /** union. */
98      UNION("union"),
99      /** !=. */
100     UNEQUAL("!="),
101     /** Renders as default: "update". */
102     UPDATE("update"),
103     /** upper. */
104     UPPER("upper"),
105     /** Renders as default: "values". */
106     VALUES("values"),
107     /** where. */
108     WHERE("where");
109 
110     /**
111      * Default Value.
112      */
113     private final String defaultValue;
114 
115     /**
116      * @param _default default value
117      */
118     private SQLPart(final String _default)
119     {
120         this.defaultValue = _default;
121     }
122 
123     /**
124      * Getter method for the instance variable {@link #defaultValue}.
125      *
126      * @return value of instance variable {@link #defaultValue}
127      */
128     public String getDefaultValue()
129     {
130         return this.defaultValue;
131     }
132 }
133