use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class EclipseLinkJPQLQueryHelperTest2_5 method namedQuery.
@Override
protected IQuery namedQuery(String entityName, String queryName) throws Exception {
IEntity entity = entity(entityName);
IQuery namedQuery = entity.getNamedQuery(queryName);
assertNotNull("The named query " + queryName + " could not be found on " + entityName, namedQuery);
return namedQuery;
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class ORMEntityJPQLQueryHelperTest method namedQuery.
@Override
protected IQuery namedQuery(String entityName, String queryName) throws Exception {
IEntity entity = entity(entityName);
IQuery namedQuery = entity.getNamedQuery(queryName);
assertNotNull("The named query " + queryName + " could not be found on " + entityName, namedQuery);
return namedQuery;
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class DefaultJPQLQueryHelperTest method namedQuery.
@Override
protected IQuery namedQuery(String entityName, String queryName) throws Exception {
IEntity entity = entity(entityName);
IQuery namedQuery = entity.getNamedQuery(queryName);
assertNotNull("The named query " + queryName + " could not be found on " + entityName, namedQuery);
return namedQuery;
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ParameterType_12.
@Test
public final void test_ParameterType_12() throws Exception {
// SELECT e FROM Employee e WHERE e.department = :dept AND e.salary > :base
IQuery namedQuery = namedQuery("Employee", "employee.deptBase");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getParameterType(":base");
assertNotNull("The type of :base should have been found", type);
assertEquals("The wrong type for :base was retrieved", getType(namedQuery, Long.class), type);
}
use of org.eclipse.persistence.jpa.jpql.tools.spi.IQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ResultType_57.
@Test
public final void test_ResultType_57() throws Exception {
// SELECT c from Customer c where c.home.city IN :city
IQuery namedQuery = namedQuery("Customer", "customer.city");
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getResultType();
assertNotNull("The type of c should have been found", type);
assertEquals("The wrong type for c was retrieved", getType(namedQuery, "jpql.query.Customer"), type);
}
Aggregations