use of org.eclipse.persistence.jpa.tests.jpql.tools.spi.java.JavaQuery in project eclipselink by eclipse-ee4j.
the class DeclarationTest method setUpClass.
@Override
protected void setUpClass() throws Exception {
super.setUpClass();
virtualQuery = new JavaQuery(getPersistenceUnit(), null);
}
use of org.eclipse.persistence.jpa.tests.jpql.tools.spi.java.JavaQuery in project eclipselink by eclipse-ee4j.
the class AbstractJPQLQueryHelperTest method test_ParameterType_20.
@Test
public final void test_ParameterType_20() throws Exception {
String jpqlQuery = "SELECT c From Customer c where c.home.city IN(:city)";
IQuery namedQuery = new JavaQuery(getPersistenceUnit(), jpqlQuery);
AbstractJPQLQueryHelper helper = buildQueryHelper(namedQuery);
IType type = helper.getParameterType(":city");
assertNotNull("The type of :city should have been found", type);
assertEquals("The wrong type for :city was retrieved", getType(namedQuery, String.class), type);
}
use of org.eclipse.persistence.jpa.tests.jpql.tools.spi.java.JavaQuery in project eclipselink by eclipse-ee4j.
the class JavaORMConfiguration method addQuery.
protected void addQuery(Map<String, IQuery> queries, Node node) {
NamedNodeMap attributes = node.getAttributes();
Attr nameNode = (Attr) attributes.getNamedItem("name");
NodeList children = node.getChildNodes();
for (int childIndex = children.getLength(); --childIndex >= 0; ) {
Node child = children.item(childIndex);
if (child.getNodeName().equals("query")) {
queries.put(nameNode.getValue(), new JavaQuery(this, child.getTextContent()));
}
}
}
use of org.eclipse.persistence.jpa.tests.jpql.tools.spi.java.JavaQuery in project eclipselink by eclipse-ee4j.
the class ContentAssistTest method setUpClass.
@Override
protected void setUpClass() throws Exception {
super.setUpClass();
virtualQuery = new JavaQuery(getPersistenceUnit(), null);
bnfAccessor = new JPQLQueryBNFAccessor(getGrammar().getExpressionRegistry());
}
Aggregations