use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_71.
@Test
public final void test_ResultType_71() throws Exception {
// SELECT SUM(o.totalPrice) FROM Order o
IQuery namedQuery = namedQuery("Order", "order.sum2");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of SUM(o.price) should have been found", type);
assertEquals("The wrong type for SUM(o.price) was retrieved", getType(namedQuery, BigInteger.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_39.
@Test
public final void test_ResultType_39() throws Exception {
// SELECT MAX(p.quantity) FROM Product p
IQuery namedQuery = namedQuery("Product", "product.max");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of MAX(p.quantity) should have been found", type);
assertEquals("The wrong type for MAX(p.quantity) was retrieved", getType(namedQuery, Integer.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ParameterType_10.
@Test
public final void test_ParameterType_10() throws Exception {
// select o from Dept o where o.dname in (:dname1, :dname2, :dname3)
IQuery namedQuery = namedQuery("Dept", "dept.dname");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getParameterType(":dname2");
assertNotNull("The type of :dname2 should have been found", type);
assertEquals("The wrong type for :newdate was retrieved", getType(namedQuery, String.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_35.
@Test
public final void test_ResultType_35() throws Exception {
// SELECT FALSE FROM Employee e
IQuery namedQuery = namedQuery("Employee", "employee.false");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of FALSE should have been found", type);
assertEquals("The wrong type for FALSE was retrieved", getType(namedQuery, Boolean.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_36.
@Test
public final void test_ResultType_36() throws Exception {
// SELECT LENGTH(a.street) FROM Address a
IQuery namedQuery = namedQuery("Address", "address.length");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of LENGTH(a.street) should have been found", type);
assertEquals("The wrong type for LENGTH(a.street) was retrieved", getType(namedQuery, Integer.class), type);
}
Aggregations