@Override public <A,Q extends SimpleExpression<A>> Collection<Expression<?>> list(ListPath<A,Q> expr, ListExpression<A,Q> other, A knownElement) { // NOTE : expr.get(0) is only supported in the where clause return Collections.<Expression<?>>singleton(expr.size()); } };
@Test @Ignore public void Size() { // NOT SUPPORTED query().from(cat).list(cat, cat.kittens.size()); }
@Test public void CollectionOperations() { // HQL functions that take collection-valued path expressions: size(), // minelement(), maxelement(), minindex(), maxindex(), along with the // special elements() and indices functions which may be quantified // using some, all, exists, any, in. cat.kittens.size(); // minelement(cat.kittens); // maxelement(cat.kittens); // minindex(cat.kittens); // maxindex(cat.kittens); assertToString("cat.kittens[0]", cat.kittens(0)); assertToString("cat.kittens[0]", cat.kittens.get(0)); // some, all, exists, any, in. } }
@Test @Ignore public void Sum() throws RecognitionException, TokenStreamException { // NOT SUPPORTED query().from(cat).list(cat.kittens.size().sum()); }
@Test public void DocoExamples98_5() throws Exception { query().from(cat).where(cat.kittens.size().gt(0)).parse(); }
@Test @Ignore public void Sum() throws RecognitionException, TokenStreamException { // NOT SUPPORTED query().from(cat).select(cat.kittens.size().sum()).parse(); }
@Test public void Not_3() throws Exception { query().from(cat).where(cat.kittens.size().goe(1).not()).parse(); }
@Test public void Not_2() throws Exception { query().from(cat).where(cat.kittens.size().gt(1).not()).parse(); }
@Test public void Not() throws Exception { query().from(cat).where(cat.kittens.size().lt(1).not()).parse(); }
@Test public void Not_4() throws Exception { query().from(cat).where(cat.kittens.size().loe(1).not()).parse(); }
@Test @Ignore public void Sum_2() throws RecognitionException, TokenStreamException { // NOT SUPPORTED query().from(cat).where(cat.kittens.size().sum().gt(0)).list(cat); }
@Test public void Not_7() throws Exception { query().from(cat).where(cat.kittens.size().loe(1).not().not()).parse(); }
@Test @Ignore public void Sum_2() throws RecognitionException, TokenStreamException { // NOT SUPPORTED query().from(cat).where(cat.kittens.size().sum().gt(0)).select(cat).parse(); }
@Test public void Not_8() throws Exception { query().from(cat).where(cat.kittens.size().loe(1).not().not().not()).parse(); }
@Test @NoEclipseLink @ExcludeIn({DERBY, HSQLDB, H2, MYSQL, ORACLE, POSTGRES}) @Ignore public void DocoExamples98_11() throws Exception { query().from(item, ord).select(item).where( ord.items(ord.items.size().subtract(1)).eq(item)) .parse(); }
@Test @NoEclipseLink @ExcludeIn({ORACLE, TERADATA}) public void JoinEmbeddable() { QBookVersion bookVersion = QBookVersion.bookVersion; QBookMark bookMark = QBookMark.bookMark; query().from(bookVersion) .join(bookVersion.definition.bookMarks, bookMark) .where( bookVersion.definition.bookMarks.size().eq(1), bookMark.page.eq(2357L).or(bookMark.page.eq(2356L))) .list(bookVersion); }