use of org.eclipse.persistence.jpa.jpql.tools.spi.IType in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_13.
@Test
public final void test_ResultType_13() throws Exception {
// SELECT COALESCE(o.price, o.price) FROM Order o
IQuery namedQuery = namedQuery("Order", "order.coalesce1");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of COALESCE(o.price, o.price) should have been found", type);
assertEquals("The wrong type for COALESCE(o.price, o.price) was retrieved", getType(namedQuery, BigInteger.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IType in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ParameterType_22.
@Test
public final void test_ParameterType_22() throws Exception {
// SELECT DISTINCT p From Product p where p.shelfLife.soldDate NOT BETWEEN :date1 AND :newdate
IQuery namedQuery = namedQuery("Product", "product.date");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getParameterType(":date1");
assertNotNull("The type of :date1 should have been found", type);
assertEquals("The wrong type for :date1 was retrieved", getType(namedQuery, Date.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IType in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_75.
@Test
public final void test_ResultType_75() throws Exception {
// SELECT UPPER(e.name) FROM Employee e
IQuery namedQuery = namedQuery("Employee", "employee.upper");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of UPPER(e.name) should have been found", type);
assertEquals("The wrong type for UPPER(e.name) was retrieved", getType(namedQuery, String.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IType in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_34.
@Test
public final void test_ResultType_34() throws Exception {
// SELECT TRUE FROM Employee e
IQuery namedQuery = namedQuery("Employee", "employee.true");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of TRUE should have been found", type);
assertEquals("The wrong type for TRUE was retrieved", getType(namedQuery, Boolean.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IType in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_51.
@Test
public final void test_ResultType_51() throws Exception {
// SELECT Distinct Object(c) From Customer c, IN(c.home.phones) p where p.area LIKE :area
IQuery namedQuery = namedQuery("Customer", "customer.area");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of Object(c) should have been found", type);
assertEquals("The wrong type for Object(c) was retrieved", getType(namedQuery, "jpql.query.Customer"), type);
}
Aggregations