Package com.mysema.query

Examples of com.mysema.query.DefaultQueryMetadata


    @Test
    public void Treat() {
        QCat cat = QCat.cat;
        JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT);
        QueryMetadata md = new DefaultQueryMetadata();
        md.addJoin(JoinType.DEFAULT, cat);
        md.addJoin(JoinType.JOIN, cat.mate.as((Path) QDomesticCat.domesticCat));
        md.addProjection(QDomesticCat.domesticCat);
        serializer.serialize(md, false, null);
        assertEquals("select domesticCat\n" +
                "from Cat cat\n" +
                "  inner join treat(cat.mate as DomesticCat) as domesticCat", serializer.toString());
    }
View Full Code Here


    @Test
    public void OpenJPA_Variables() {
        QCat cat = QCat.cat;
        JPQLSerializer serializer = new JPQLSerializer(OpenJPATemplates.DEFAULT);
        QueryMetadata md = new DefaultQueryMetadata();
        md.addJoin(JoinType.DEFAULT, cat);
        md.addJoin(JoinType.INNERJOIN, cat.mate);
        md.addJoinCondition(cat.mate.alive);
        serializer.serialize(md, false, null);
        assertEquals("select cat_\nfrom Cat cat_\n  inner join cat_.mate on cat_.mate.alive",
                serializer.toString());
    }
View Full Code Here

class QueryHelper extends JPAQueryBase<QueryHelper> {

    private static final Logger logger = LoggerFactory.getLogger(QueryHelper.class);

    public QueryHelper(JPQLTemplates templates) {
        this(new DefaultQueryMetadata(), templates);
    }
View Full Code Here

    @Test
    public void In() {
        Configuration conf = new Configuration(new MySQLTemplates());
        NativeSQLSerializer serializer = new NativeSQLSerializer(conf, true);
        DefaultQueryMetadata md = new DefaultQueryMetadata();
        SAnimal cat = SAnimal.animal_;
        md.addJoin(JoinType.DEFAULT, cat);
        md.addWhere(cat.name.in("X", "Y"));
        md.addProjection(cat.id);
        serializer.serialize(md, false);
        assertEquals("select animal_.id\n" +
          "from animal_ animal_\n" +
          "where animal_.name in (?1, ?2)", serializer.toString());
    }
View Full Code Here

    private Sort querySort;

    @SuppressWarnings("unchecked")
    public AbstractLuceneQuery(LuceneSerializer serializer, IndexSearcher searcher,
            Function<Document, T> transformer) {
        queryMixin = new QueryMixin<Q>((Q) this, new DefaultQueryMetadata().noValidate());
        this.serializer = serializer;
        this.searcher = searcher;
        this.transformer = transformer;
    }
View Full Code Here

*
*/
public class SQLServerQuery extends AbstractSQLQuery<SQLServerQuery> {

    public SQLServerQuery(Connection conn) {
        this(conn, new SQLServerTemplates(), new DefaultQueryMetadata());
    }
View Full Code Here

    public SQLServerQuery(Connection conn) {
        this(conn, new SQLServerTemplates(), new DefaultQueryMetadata());
    }

    public SQLServerQuery(Connection conn, SQLTemplates templates) {
        this(conn, templates, new DefaultQueryMetadata());
    }
View Full Code Here

    private static final String SQL_BIG_RESULT = "sql_big_result ";

    private static final Joiner JOINER = Joiner.on(", ");

    public MySQLQuery(Connection conn) {
        this(conn, new Configuration(new MySQLTemplates()), new DefaultQueryMetadata());
    }
View Full Code Here

    public MySQLQuery(Connection conn) {
        this(conn, new Configuration(new MySQLTemplates()), new DefaultQueryMetadata());
    }

    public MySQLQuery(Connection conn, SQLTemplates templates) {
        this(conn, new Configuration(templates), new DefaultQueryMetadata());
    }
View Full Code Here

    public MySQLQuery(Connection conn, SQLTemplates templates) {
        this(conn, new Configuration(templates), new DefaultQueryMetadata());
    }

    public MySQLQuery(Connection conn, Configuration configuration) {
        this(conn, configuration, new DefaultQueryMetadata());
    }
View Full Code Here

TOP

Related Classes of com.mysema.query.DefaultQueryMetadata

Copyright © 2018 www.massapicom. 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.