1 /*
2  * Copyright 2015-2018 HuntLabs.cn.
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 module hunt.sql.builder.SQLBuilderFactory;
17 
18 import hunt.sql.builder.impl.SQLDeleteBuilderImpl;
19 import hunt.sql.builder.impl.SQLSelectBuilderImpl;
20 import hunt.sql.builder.impl.SQLUpdateBuilderImpl;
21 import hunt.sql.builder.SQLSelectBuilder;
22 import hunt.sql.builder.SQLDeleteBuilder;
23 import hunt.sql.builder.SQLUpdateBuilder;
24 import hunt.sql.builder.SQLBuilder;
25 
26 public class SQLBuilderFactory {
27 
28     public static SQLBuilder createSQLBuilder(T)(string dbType) {
29         return new T(dbType);
30     }
31 
32     public static SQLBuilder createSQLBuilder(T)(string sql, string dbType) {
33         return new T(sql, dbType);
34     }
35 
36     public static SQLBuilder createSelectSQLBuilder(string dbType) {
37         return new SQLSelectBuilderImpl(dbType);
38     }
39     
40     public static SQLBuilder createSelectSQLBuilder(string sql, string dbType) {
41         return new SQLSelectBuilderImpl(sql, dbType);
42     }
43 
44     public static SQLBuilder createDeleteBuilder(string dbType) {
45         return new SQLDeleteBuilderImpl(dbType);
46     }
47     
48     public static SQLBuilder createDeleteBuilder(string sql, string dbType) {
49         return new SQLDeleteBuilderImpl(sql, dbType);
50     }
51 
52     public static SQLBuilder createUpdateBuilder(string dbType) {
53         return new SQLUpdateBuilderImpl(dbType);
54     }
55     
56     public static SQLBuilder createUpdateBuilder(string sql, string dbType) {
57         return new SQLUpdateBuilderImpl(sql, dbType);
58     }
59 }