Skip to content

Commit 94ad52c

Browse files
committed
adopted the web demo to work with hibernate 5.0
1 parent de30a66 commit 94ad52c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

web-demo/src/main/java/com/blazebit/presentation/demo/rest/CatSubResource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ public <T> List<T> getCatHierarchy(Integer catId, EntityViewSetting<T, CriteriaB
8989
.endOr()
9090
.end()
9191
.from(Cat.class, "cat")
92-
.innerJoinOn(CatHierarchyCTE.class, "cte").on("cte.id").eqExpression("cat.id").end()
92+
.from(CatHierarchyCTE.class, "cte")
93+
.where("cte.id").eqExpression("cat.id")
9394
.groupBy("cat.id")
9495
.orderByAsc("cte.generation");
9596

96-
return evm.applySetting(setting, cb).getResultList();
97+
return evm.applySetting(setting, cb, "cat").getResultList();
9798
}
9899
}

web-demo/src/main/java/com/blazebit/presentation/demo/view/CatFamilyTreeView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @since 1.2
2929
*/
3030
@EntityView(Cat.class)
31-
public interface CatFamilyTreeView extends CatView{
31+
public interface CatFamilyTreeView extends CatView {
3232

3333
CatView getMother();
3434

@@ -44,8 +44,8 @@ public <T> T createSubquery(SubqueryInitiator<T> subqueryInitiator) {
4444
return subqueryInitiator.from(Cat.class)
4545
.select("COUNT(*)")
4646
.whereOr()
47-
.where("father.id").eqExpression("OUTER(id)")
48-
.where("mother.id").eqExpression("OUTER(id)")
47+
.where("father.id").eqExpression("VIEW_ROOT(id)")
48+
.where("mother.id").eqExpression("VIEW_ROOT(id)")
4949
.endOr()
5050
.end();
5151
}

0 commit comments

Comments
 (0)