CriteriaBuilder cb = cbf.create(entityManager, Tuple.class)
// first step: create CTEEntity
.with(TestBCTEEntity.class)
.from(BEntity.class)
.bind("id").select("id")
.bind("code").select("code")
.bind("name").select("name")
.end()
// second step: xxxJoin CTEEntity demo
// -------------demo1: inner join CTEEntity expected right.
//.from(AEntity.class, "a")
//.innerJoinOn(TestBCTEEntity.class, "b").on("a.bcode").eqExpression("b.code").end()
// -------------demo2: left join CTEEntity when using CTEEntity where expressions expected right.
//.from(AEntity.class, "a")
//.leftJoinOn(TestBCTEEntity.class, "b").on("a.bcode").eqExpression("b.code").end()
//.where("b.name").eq("testname")
// -------------demo3: left join CTEEntity without CTEEntity where expressions expected error.
.from(AEntity.class, "a")
.leftJoinOn(TestBCTEEntity.class, "b").on("a.bcode").eqExpression("b.code").end()
;
Object o = cb.getResultList();
Above is demo code for using leftJoin/innerJoin CTEEntiy. in case demo3, there was an error would be happend, and other cases were correct. It indecated that it didn't identify CTEEntity when left join CTEEntity and without CTEEntity where expressions.
The error is: ...... left join (select * from TestBCTEEntity) zfec2_0 on (null is null and 999=999 and ......
CriteriaBuilder cb = cbf.create(entityManager, Tuple.class)
Above is demo code for using leftJoin/innerJoin CTEEntiy. in case demo3, there was an error would be happend, and other cases were correct. It indecated that it didn't identify CTEEntity when left join CTEEntity and without CTEEntity where expressions.
The error is: ...... left join (select * from TestBCTEEntity) zfec2_0 on (null is null and 999=999 and ......