Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support adding order by to SQL queries
- Loading branch information
Showing
8 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
core/src/main/java/foundation/stack/datamill/db/ConjoinedOrderBuilder.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,14 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.reflection.Member; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface ConjoinedOrderBuilder<R> { | ||
R all(); | ||
R limit(int count); | ||
R limit(int offset, int count); | ||
OrderBuilder<R> andOrderBy(String fragment); | ||
OrderBuilder<R> andOrderBy(Member member); | ||
} |
9 changes: 9 additions & 0 deletions
9
core/src/main/java/foundation/stack/datamill/db/OrderBuilder.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.db; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface OrderBuilder<R> { | ||
ConjoinedOrderBuilder<R> desc(); | ||
ConjoinedOrderBuilder<R> asc(); | ||
} |
3 changes: 3 additions & 0 deletions
3
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.LimitBuilder; | ||
import foundation.stack.datamill.reflection.Member; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface SelectLimitBuilder<R> extends LimitBuilder<R> { | ||
R limit(int offset, int count); | ||
OrderBuilder<R> orderBy(String fragment); | ||
OrderBuilder<R> orderBy(Member member); | ||
} |
4 changes: 3 additions & 1 deletion
4
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.reflection.Outline; | ||
import foundation.stack.datamill.reflection.Member; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface SelectWhereBuilder<R> extends WhereBuilder<R, SelectLimitBuilder<R>> { | ||
R limit(int offset, int count); | ||
OrderBuilder<R> orderBy(String fragment); | ||
OrderBuilder<R> orderBy(Member member); | ||
} |
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
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