Examples of toEjbQl()


Examples of org.apache.cayenne.exp.Expression.toEJBQL()

    public void testRelationshipWhereClause2() throws Exception {
        ObjectContext context = createDataContext();

        Expression exp = ExpressionFactory.matchExp(Painting.TO_GALLERY_PROPERTY, null);
        EJBQLQuery query = new EJBQLQuery("select p.toArtist from Painting p where " + exp.toEJBQL("p"));

        context.performQuery(query);
    }

    public void testOrBrackets() throws Exception {
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.toEJBQL()

    //test for CAY-1313
    public void testRelationshipWhereClauseAndToEJBQL() throws Exception {
        ObjectContext context = createDataContext();
       
        Expression exp = ExpressionFactory.matchExp(Painting.TO_GALLERY_PROPERTY, null);
        EJBQLQuery query = new EJBQLQuery("select p.toArtist from Painting p where " + exp.toEJBQL("p"));
   
        context.performQuery(query);
    }
   
    public void testOrBrackets() throws Exception {
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.toEJBQL()

    }

    public void testRelationshipWhereClause2() throws Exception {
        Expression exp = ExpressionFactory.matchExp(Painting.TO_GALLERY_PROPERTY, null);
        EJBQLQuery query = new EJBQLQuery("select p.toArtist from Painting p where "
                + exp.toEJBQL("p"));

        context.performQuery(query);
    }

    public void testOrBrackets() throws Exception {
View Full Code Here

Examples of org.apache.cayenne.exp.Expression.toEJBQL()

import org.apache.cayenne.exp.ExpressionFactory;

public class ASTLikeIgnoreCaseTest extends TestCase {
    public void testToEJBQL() {
        Expression like = ExpressionFactory.likeIgnoreCaseExp("a", "%b%");
        assertEquals(like.toEJBQL("p"), "upper(p.a) like '%B%'");
    }
}
View Full Code Here

Examples of uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.QueryBuilder.toEjbQl()

        Query query;
        String queryString = "";
        boolean filterExists = filter != null && filter.isEnabled();
        if (filterExists) {
            QueryBuilder queryBuilder = SqlUtils.getQueryBuilder(filter);
            String ejbFragment = queryBuilder.toEjbQl();
            boolean formatCriteriaExist = ejbFragment.contains("format.");
            String sqlFilter = SqlUtils.transformEJBtoSQLFields(ejbFragment, "profile", "form");
            queryString = formatCriteriaExist ? "select distinct profile.* " : "select profile.* ";
            queryString += "from profile_resource_node as profile ";
            if (formatCriteriaExist) {
View Full Code Here

Examples of uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.QueryBuilder.toEjbQl()

     */
    public Query parse(Filter filter, Session hibernateSession, String baseQuery) {
       
        QueryBuilder queryBuilder = SqlUtils.getQueryBuilder(filter);
       
        String ejbFilter = queryBuilder.toEjbQl();
        String startQuery = baseQuery;
        if (ejbFilter.contains("format.")) {
            startQuery = baseQuery + " INNER JOIN profileResourceNode.formatIdentifications as format ";
        }
       
View Full Code Here

Examples of uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.QueryBuilder.toEjbQl()

    @SuppressWarnings("unchecked")
    //@Transactional(propagation = Propagation.REQUIRED)
    public List<ProfileResourceNode> findProfileResourceNodes(Long parentId,
            Filter filter) {
        QueryBuilder queryBuilder = SqlUtils.getQueryBuilder(filter);
        String ejbFilter = queryBuilder.toEjbQl();
        String query = getSQLQueryString(ejbFilter, parentId);
        Query q = entityManager.createNativeQuery(query, "ResourceNodeWithFilterStatus");
       
        // Set the parameters:
        int i = 1;
View Full Code Here

Examples of uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.QueryBuilder.toEjbQl()

   
    private FilterInfo getFilterInfo(Criterion filter) {
        final FilterInfo filterInfo = new FilterInfo();
        final QueryBuilder queryBuilder = QueryBuilder.forAlias("profileResourceNode").createAlias("format");
        queryBuilder.add(filter);
        final String ejbQl = queryBuilder.toEjbQl();
       
        // If we have a filter, get its SQL query string and parameter values:
        if (ejbQl.length() > 0) {
            filterInfo.setFilterSubQuery(buildFilterSubQuery(ejbQl));
            filterInfo.setFilterValues(queryBuilder.getValues());
View Full Code Here

Examples of uk.gov.nationalarchives.droid.core.interfaces.filter.expressions.QueryBuilder.toEjbQl()

                    orJunction.add(RestrictionFactory.forFilterCriterion(criterion));
                }
                queryBuilder.add(orJunction);
            }
           
            filterQueryString = " AND " + queryBuilder.toEjbQl();
            filterParams = queryBuilder.getValues();
           
//            FilterQueryStringGenerator filterQueryGenerator = new FilterQueryStringGenerator();
//            FilterQueryStringGenerator.FilterQueryStringAndNamedParameter queryAndParameter = filterQueryGenerator
//                    .getFilterQueryString(filter);
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.