Examples of JPAQuery


Examples of com.spaceprogram.simplejpa.query.JPAQuery

    }

    @Test
    public void testDates(){
        String q = "select o from MyTestObject o where o.birthday > :from and o.birthday < :to and o.id = :id";
        JPAQuery query = new JPAQuery();
        JPAQueryParser parser;
        List<String> split;

        parser = new JPAQueryParser(query, (q));
        parser.parse();
        split = QueryImpl.tokenizeWhere(query.getFilter());
        String delimited = toString(split, " || ");
        System.out.println("delimited: " + delimited);
        Assert.assertEquals("o.birthday > :from and o.birthday < :to and o.id = :id ", toString(split));
        Assert.assertEquals(11, split.size());
    }
View Full Code Here

Examples of com.spaceprogram.simplejpa.query.JPAQuery

            count = backingList.size();
        } else {
            try {
                if (logger.isLoggable(Level.FINER))
                    logger.finer("Getting size.");
                JPAQuery queryClone = (JPAQuery) origQuery.getQ().clone();
                queryClone.setResult("count(*)");
                QueryImpl query2 = new QueryImpl(em, queryClone);
                query2.setParameters(origQuery.getParameters());
                query2.setForeignIds(origQuery.getForeignIds());
                List results = query2.getResultList();
                int resultCount = ((Long) results.get(0)).intValue();
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader) {
        try {
            Map<String, Object> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), getLockMode(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader) {
        try {
            Map<String, Object> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), getLockMode(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

        if (value instanceof ArrayList) {
            // JPA query results in a list of raw values
            // Here we have raw values returned as opposed to DatabaseRecords - this means
            // we need to figure out the tag names based on the call's output parameters.
            // assumes JPAQuery
            JPAQuery jpaQuery = (JPAQuery) queryHandler.getDatabaseQuery();
            // to match field names with results, we need to gather the database fields from each of the Output parameters
            List<DatabaseField> paramFlds = new ArrayList<DatabaseField>();
            DatasourceCall dsCall = (DatasourceCall) jpaQuery.getDatabaseQuery().getDatasourceCall();
            for (Object obj : dsCall.getParameters()) {
                if (obj instanceof OutputParameterForCallableStatement) {
                    paramFlds.add(((OutputParameterForCallableStatement) obj).getOutputField());
                } else if (obj instanceof Object[]) {
                    Object[] objArray = (Object[]) obj;
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader) {
        try {
            Map<String, Object> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), getLockMode(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader, MetadataProject project) {
        try {
            Map<String, Object> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), getLockMode(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader) {
        try {
            HashMap<String, String> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader, MetadataProject project) {
        try {
            Map<String, Object> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), getLockMode(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.jpa.JPAQuery

     * INTERNAL:
     */
    public void process(AbstractSession session, ClassLoader loader) {
        try {
            Map<String, Object> hints = processQueryHints(session);
            session.addJPAQuery(new JPAQuery(getName(), getQuery(), getLockMode(), hints));
        } catch (Exception exception) {
            throw ValidationException.errorProcessingNamedQuery(getClass(), getName(), exception);
        }
    }
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.