-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
203 additions
and
92 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
core/src/main/java/foundation/stack/datamill/LimitBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package foundation.stack.datamill; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface LimitBuilder<R> { | ||
R all(); | ||
R limit(int count); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
core/src/main/java/foundation/stack/datamill/db/QueryBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
core/src/main/java/foundation/stack/datamill/db/SelectLimitBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.LimitBuilder; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface SelectLimitBuilder<R> extends LimitBuilder<R> { | ||
R limit(int offset, int count); | ||
} |
12 changes: 12 additions & 0 deletions
12
core/src/main/java/foundation/stack/datamill/db/SelectWhereBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.reflection.Outline; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface SelectWhereBuilder<R> extends WhereBuilder<R, SelectLimitBuilder<R>> { | ||
R limit(int offset, int count); | ||
JoinBuilder<R> leftJoin(String table); | ||
JoinBuilder<R> leftJoin(Outline<?> outline); | ||
} |
8 changes: 6 additions & 2 deletions
8
core/src/main/java/foundation/stack/datamill/db/UpdateBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.LimitBuilder; | ||
|
||
import java.util.Map; | ||
import java.util.function.Function; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface UpdateBuilder { | ||
WhereBuilder<UpdateQueryExecution> set(Map<String, ?> values); | ||
WhereBuilder<UpdateQueryExecution> set(Function<RowBuilder, Map<String, ?>> rowConstructor); | ||
WhereBuilder<UpdateQueryExecution, ? extends LimitBuilder<? extends UpdateQueryExecution>> set( | ||
Map<String, ?> values); | ||
WhereBuilder<UpdateQueryExecution, ? extends LimitBuilder<? extends UpdateQueryExecution>> set( | ||
Function<RowBuilder, Map<String, ?>> rowConstructor); | ||
} |
9 changes: 4 additions & 5 deletions
9
core/src/main/java/foundation/stack/datamill/db/WhereBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.reflection.Outline; | ||
import foundation.stack.datamill.LimitBuilder; | ||
import rx.functions.Func1; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface WhereBuilder<R> { | ||
public interface WhereBuilder<R, L extends LimitBuilder<R>> { | ||
R all(); | ||
R where(Func1<ConditionBuilder, TerminalCondition> conditionBuilder); | ||
JoinBuilder<R> leftJoin(String table); | ||
JoinBuilder<R> leftJoin(Outline<?> outline); | ||
R limit(int count); | ||
L where(Func1<ConditionBuilder, TerminalCondition> conditionBuilder); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.