use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery 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.IQuery 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.IQuery 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);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ParameterType_16.
@Test
public final void test_ParameterType_16() throws Exception {
// SELECT e FROM Employee e WHERE e.name = ?1 ORDER BY e.name
IQuery namedQuery = namedQuery("Employee", "employee.?1");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getParameterType("?1");
assertNotNull("The type of ?1 should have been found", type);
assertEquals("The wrong type for ?1 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_22.
@Test
public final void test_ResultType_22() throws Exception {
// SELECT CURRENT_DATE FROM Employee e
IQuery namedQuery = namedQuery("Employee", "employee.date1");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of CURRENT_DATE should have been found", type);
assertEquals("The wrong type for CURRENT_DATE was retrieved", getType(namedQuery, java.sql.Date.class), type);
}
Aggregations