Examples of JoinExpression


Examples of com.mysema.query.JoinExpression

        mixin.leftJoin(cat.mate, mate);
        mixin.orderBy(cat.mate.mate.name.asc());

        QueryMetadata md = mixin.getMetadata();
        assertEquals(Arrays.asList(
                new JoinExpression(JoinType.DEFAULT, cat),
                new JoinExpression(JoinType.LEFTJOIN, cat.mate.as(mate)),
                new JoinExpression(JoinType.LEFTJOIN, mate.mate.as(mate_mate))),
                md.getJoins());
        assertEquals(Arrays.asList(mate_mate.name.asc()),
                md.getOrderBy());
    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

        mixin.from(cat);
        mixin.orderBy(cat.kittens.any().name.asc());

        QueryMetadata md = mixin.getMetadata();
        assertEquals(Arrays.asList(
                new JoinExpression(JoinType.DEFAULT, cat),
                new JoinExpression(JoinType.LEFTJOIN, cat.kittens.as(cat_kittens))),
                md.getJoins());
        assertEquals(Arrays.asList(cat_kittens.name.asc()),
                md.getOrderBy());
    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

        QBookVersion bookVersion = QBookVersion.bookVersion;
        mixin.from(bookVersion);
        mixin.orderBy(bookVersion.definition.name.asc());

        QueryMetadata md = mixin.getMetadata();
        assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, bookVersion)),
                md.getJoins());
        assertEquals(Arrays.asList(bookVersion.definition.name.asc()),
                md.getOrderBy());
    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

        mixin.from(article);
        mixin.orderBy(article.content.article.name.asc());

        QueryMetadata md = mixin.getMetadata();
        assertEquals(Arrays.asList(
                new JoinExpression(JoinType.DEFAULT, article),
                new JoinExpression(JoinType.LEFTJOIN, article.content.article.as(article_content_article))),
                md.getJoins());
        assertEquals(Arrays.asList(article_content_article.name.asc()),
                md.getOrderBy());
    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

        QBookMark bookMark = new QBookMark("bookVersion_definition_bookMarks");
        mixin.from(bookVersion);
        mixin.orderBy(bookVersion.definition.bookMarks.any().comment.asc());

        QueryMetadata md = mixin.getMetadata();
        assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, bookVersion)),
                md.getJoins());
        assertEquals(Arrays.asList(new StringPath(bookVersion.definition.bookMarks, "comment").asc()),
                md.getOrderBy());

    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

    public void GetJoins_with_condition() {
        mixin.innerJoin(entity);
        mixin.on(entity.version.isNull(), entity.version.isNotNull());

        assertEquals(1, mixin.getMetadata().getJoins().size());
        JoinExpression je = mixin.getMetadata().getJoins().get(0);
        assertEquals(entity, je.getTarget());
        assertEquals(BooleanExpression.allOf(entity.version.isNull(), entity.version.isNotNull()), je.getCondition());
    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

    @Test
    public void GetJoins_no_condition() {
        mixin.innerJoin(entity);

        assertEquals(1, mixin.getMetadata().getJoins().size());
        JoinExpression je = mixin.getMetadata().getJoins().get(0);
        assertEquals(entity, je.getTarget());
        assertNull(je.getCondition());
    }
View Full Code Here

Examples of com.mysema.query.JoinExpression

    }

    @Test
    public void AddJoin() {
        List<JoinExpression> joins = new ArrayList<JoinExpression>();
        joins.add(new JoinExpression(JoinType.DEFAULT, x));
        joins.add(new JoinExpression(JoinType.DEFAULT, y));
        joins.add(new JoinExpression(JoinType.INNERJOIN, y));
        joins.add(new JoinExpression(JoinType.INNERJOIN, x_a));
        joins.add(new JoinExpression(JoinType.INNERJOIN, x_a_a));
        joins.add(new JoinExpression(JoinType.INNERJOIN, x_a_b));
        joins.add(new JoinExpression(JoinType.INNERJOIN, x_b));
        joins.add(new JoinExpression(JoinType.INNERJOIN, y_a));
        joins.add(new JoinExpression(JoinType.INNERJOIN, y_b));

        for (JoinExpression join1 : joins) {
            for (JoinExpression join2 : joins) {
                QueryMetadata md = new OrderedQueryMetadata();
                addJoin(md, join1);
View Full Code Here

Examples of com.mysema.query.JoinExpression

        }
    }

    private void serializeSources(boolean forCountRow, List<JoinExpression> joins) {
        for (int i = 0; i < joins.size(); i++) {
            final JoinExpression je = joins.get(i);
            if (i > 0) {
                append(joinTypes.get(je.getType()));
            }
            if (je.hasFlag(JPAQueryMixin.FETCH) && !forCountRow) {
                handle(JPAQueryMixin.FETCH);
            }
            handleJoinTarget(je);
            // XXX Hibernate specific flag
            if (je.hasFlag(JPAQueryMixin.FETCH_ALL_PROPERTIES) && !forCountRow) {
                handle(JPAQueryMixin.FETCH_ALL_PROPERTIES);
            }

            if (je.getCondition() != null) {
                append(templates.isWithForOn() ? WITH : ON);
                handle(je.getCondition());
            }
        }
    }
View Full Code Here

Examples of com.netflix.lipstick.model.operators.elements.JoinExpression

        public Join(String strategy, String type, Map<String, List<String>> expression) {
            this.strategy = strategy;
            this.type = type;
            this.expression = Maps.newHashMap();
            for (Entry<String, List<String>> e : expression.entrySet()) {
                this.expression.put(e.getKey(), new JoinExpression(e.getValue()));
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.