Skip to content

Commit 71edc1f

Browse files
committed
idk just api improvement
1 parent 642f96f commit 71edc1f

2 files changed

Lines changed: 33 additions & 46 deletions

File tree

core/src/main/java/me/zort/sqllib/SQLDatabaseConnection.java

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ public SQLDatabaseConnection(SQLConnectionFactory connectionFactory) {
102102
* @return Collection of row objects.
103103
*/
104104
public abstract <T> QueryRowsResult<T> query(Query query, Class<T> typeClass);
105-
106-
/**
107-
* @see SQLDatabaseConnection#query(Query, Class)
108-
*/
109105
public abstract QueryRowsResult<Row> query(Query query);
110106

111107
/**
@@ -122,14 +118,39 @@ public SQLDatabaseConnection(SQLConnectionFactory connectionFactory) {
122118
public abstract boolean isLogSqlErrors();
123119
public abstract boolean isDebug();
124120

125-
public abstract SelectQuery select(String... cols);
126-
public abstract UpdateQuery update();
127-
public abstract UpdateQuery update(@Nullable String table);
128-
public abstract InsertQuery insert();
129-
public abstract InsertQuery insert(@Nullable String table);
130-
public abstract UpsertQuery upsert();
131-
public abstract UpsertQuery upsert(@Nullable String table);
132-
public abstract DeleteQuery delete();
121+
// --***-- Query builders --***--
122+
123+
public SelectQuery select(String... cols) {
124+
return new SelectQuery(this, cols);
125+
}
126+
127+
public UpdateQuery update() {
128+
return update(null);
129+
}
130+
131+
public UpdateQuery update(@Nullable String table) {
132+
return new UpdateQuery(this, table);
133+
}
134+
135+
public InsertQuery insert() {
136+
return insert(null);
137+
}
138+
139+
public InsertQuery insert(@Nullable String table) {
140+
return new InsertQuery(this, table);
141+
}
142+
143+
public UpsertQuery upsert() {
144+
return upsert(null);
145+
}
146+
147+
public UpsertQuery upsert(@Nullable String table) {
148+
return new UpsertQuery(this, table);
149+
}
150+
151+
public DeleteQuery delete() {
152+
return new DeleteQuery(this);
153+
}
133154

134155
@Override
135156
public boolean connect() {

core/src/main/java/me/zort/sqllib/SQLDatabaseConnectionImpl.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -413,40 +413,6 @@ private boolean reconnect() {
413413
return true;
414414
}
415415

416-
// --***-- Query builders --***--
417-
418-
public SelectQuery select(String... cols) {
419-
return new SelectQuery(this, cols);
420-
}
421-
422-
public UpdateQuery update() {
423-
return update(null);
424-
}
425-
426-
public UpdateQuery update(@Nullable String table) {
427-
return new UpdateQuery(this, table);
428-
}
429-
430-
public InsertQuery insert() {
431-
return insert(null);
432-
}
433-
434-
public InsertQuery insert(@Nullable String table) {
435-
return new InsertQuery(this, table);
436-
}
437-
438-
public UpsertQuery upsert() {
439-
return upsert(null);
440-
}
441-
442-
public UpsertQuery upsert(@Nullable String table) {
443-
return new UpsertQuery(this, table);
444-
}
445-
446-
public DeleteQuery delete() {
447-
return new DeleteQuery(this);
448-
}
449-
450416
public UpsertQuery save(Object obj) {
451417
Pair<String[], UnknownValueWrapper[]> data = buildDefsVals(obj);
452418

0 commit comments

Comments
 (0)