Skip to content

Commit

Permalink
2.0.1.RELEASE
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Mar 11, 2019
1 parent 093fcde commit a9b3db6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ public ViewEntity test(@RequestBody CatRO ro) {
List<Object> inList = new ArrayList<>();
inList.add("gggg");
inList.add("xxxxx");
ro.setOrderBy("catTest.catFriendName,catTest.id");

CriteriaBuilder.ResultMappedBuilder builder = CriteriaBuilder.buildResultMapped(CatTest.class,ro);
//builder.distinct("catTest.id").reduce(Reduce.ReduceType.COUNT,"catTest.id").groupBy("catTest.id");
builder.and().in("catTest.catFriendName", inList);
builder.paged().orderIn("catTest.catFriendName",inList);//按IN查询条件排序,有值,就过滤掉orderBy
// builder.paged().orderIn("catTest.catFriendName",inList);//按IN查询条件排序,有值,就过滤掉orderBy
String sourceScript = "catTest LEFT JOIN dogTest on catTest.dogId = dogTest.id";
Criteria.ResultMappedCriteria resultMapped = builder.get();
resultMapped.setSourceScript(sourceScript);
Expand Down
5 changes: 4 additions & 1 deletion demo/src/main/java/io/xream/x7/demo/remote/TestFallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ public class TestFallback {

public void test(CatRO ro){

System.out.println("FALL BACK tested");

throw new RuntimeException("");
}


}
2 changes: 1 addition & 1 deletion demo/src/test/java/io/xream/x7/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void testAll(){
// xxxTest.domain();
// xxxTest.domain();

xxxTest.testReyClient();
xxxTest.test();

}

Expand Down
2 changes: 1 addition & 1 deletion demo/src/test/java/io/xream/x7/XxxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void test() {

CatRO cat = new CatRO();

ViewEntity ve = this.controller.create();
ViewEntity ve = this.controller.test(cat);

System.out.println("\n______Result: " + ve);

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
</execution>
</executions>
</plugin>
<!--

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -232,7 +232,7 @@
</execution>
</executions>
</plugin>
-->

</plugins>
<resources>
<resource>
Expand Down
4 changes: 2 additions & 2 deletions x7-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
</execution>
</executions>
</plugin>
<!--

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -165,7 +165,7 @@
</execution>
</executions>
</plugin>
-->

</plugins>
<resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,19 @@ private void sort(StringBuilder sb, Criteria criteria) {
for (String ob : orderByList) {
String mapper = mapping(ob, criteria);
sb.append(mapper).append(SqlScript.SPACE);
Direction direction = criteria.getDirection();
if (direction == null) {
sb.append(Direction.DESC);
}else{
sb.append(direction);
}
sb.append(SqlScript.SPACE);
i++;
if (i < size) {
sb.append(SqlScript.COMMA).append(SqlScript.SPACE);
}
}
Direction direction = criteria.getDirection();
if (direction == null) {
sb.append(Direction.DESC);
}else{
sb.append(direction);
}

}

}
Expand Down

0 comments on commit a9b3db6

Please sign in to comment.