MCPcopy Create free account
hub / github.com/mybatis/mybatis-3 / AbstractSQL

Class AbstractSQL

src/main/java/org/apache/ibatis/jdbc/AbstractSQL.java:32–834  ·  view source on GitHub ↗

@author Clinton Begin @author Jeff Butler @author Adam Gent @author Kazuki Shimizu

Source from the content-addressed store, hash-verified

30 * @author Kazuki Shimizu
31 */
32public abstract class AbstractSQL<T> {
33
34 private static final String AND = ") \nAND (";
35 private static final String OR = ") \nOR (";
36
37 private final SQLStatement sql = new SQLStatement();
38
39 public abstract T getSelf();
40
41 public T UPDATE(String table) {
42 sql().statementType = SQLStatement.StatementType.UPDATE;
43 sql().tables.add(table);
44 return getSelf();
45 }
46
47 public T SET(String sets) {
48 sql().sets.add(sets);
49 return getSelf();
50 }
51
52 /**
53 * Sets the.
54 *
55 * @param sets
56 * the sets
57 *
58 * @return the t
59 *
60 * @since 3.4.2
61 */
62 public T SET(String... sets) {
63 sql().sets.addAll(Arrays.asList(sets));
64 return getSelf();
65 }
66
67 public T INSERT_INTO(String tableName) {
68 sql().statementType = SQLStatement.StatementType.INSERT;
69 sql().tables.add(tableName);
70 return getSelf();
71 }
72
73 public T VALUES(String columns, String values) {
74 INTO_COLUMNS(columns);
75 INTO_VALUES(values);
76 return getSelf();
77 }
78
79 /**
80 * Into columns.
81 *
82 * @param columns
83 * the columns
84 *
85 * @return the t
86 *
87 * @since 3.4.2
88 */
89 public T INTO_COLUMNS(String... columns) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected