@Test public void test_Query_002() throws Exception { // SELECT a // FROM Asset a, Geography selectedGeography // WHERE selectedGeography.id = :id AND // a.id IN (:id_list) AND // FUNC('ST_Intersects', a.geometry, selectedGeography.geometry) = 'TRUE' StateObjectTester selectStatement = selectStatement( select(variable("a")), from("Asset", "a", "Geography", "selectedGeography"), where( path("selectedGeography.id") .equal(inputParameter(":id")) .and(path("a.id").in(inputParameter(":id_list"))) .and( function( FUNC, "ST_Intersects", path("a.geometry"), path("selectedGeography.geometry")) .equal(string("'TRUE'"))))); testQuery(EclipseLinkJPQLQueries2_4.query_002(), selectStatement); }
@Test public void test_Query_001() throws Exception { // SELECT FUNC('NVL', e.firstName, 'NoFirstName'), // func('NVL', e.lastName, 'NoLastName') // FROM Employee e testQuery(EclipseLinkJPQLQueries2_4.query_001(), stateObject_224()); }
@Test public void test_Query_JPQL_2_1_002() throws Exception { // Select e // From Employee e Join TREAT(e.projects LargeProject) lp StateObjectTester selectStatement = selectStatement( select(variable("e")), from("Employee", "e", join(treat("e.projects", "LargeProject"), "lp"))); testQuery(JPQLQueries2_1.query_002(), selectStatement); }
@Test public void test_Query_JPQL_2_1_001() throws Exception { // Select e // From Employee e Join TREAT(e.projects AS LargeProject) lp // Where lp.budget = :value StateObjectTester selectStatement = selectStatement( select(variable("e")), from("Employee", "e", join(treatAs("e.projects", "LargeProject"), "lp")), where(path("lp.budget").equal(inputParameter(":value")))); testQuery(JPQLQueries2_1.query_001(), selectStatement); }