-
Sub-task
-
Resolution: Done
-
Major
-
None
-
None
-
None
This tests has several assertions verifying the compilation of EJB-QL to SQL using org.jboss.ejb.plugins.cmp.jdbc.compileEJBQL() t. With JavaSE6 there are two EJB-QL queries that use the conditional AND expression in the WHERE clause. The expected result does not match the generated SQL causing the assertion failures. The generated SQL, after review, has been determined to generate the same query result. Therefore, the tests were adjusted to pass on either condition. This issue has been seen before as one of the cases has already been conditionlized but tests for javaVersion "1.4".
1)
JDK 5:
assertEquals("SELECT t0_l.id FROM CUSTOMEREJB t1_c, ORDER_DATA t3_o, LINEITEMEJB t0_l " +
"WHERE ((t1_c.id = 1)) AND t1_c.id=t3_o.customer AND t3_o.ORDER_NUMBER=t0_l.ORDER_NUMBER",
compileEJBQL("SELECT OBJECT(l) FROM Customer c, IN(c.orders) o, IN(o.lineItems) l WHERE c.id=1"));
else {
assertEquals("SELECT t0_l.id FROM CUSTOMEREJB t1_c, ORDER_DATA t3_o, LINEITEMEJB t0_l " +
"WHERE ((t1_c.id = 1)) AND t3_o.ORDER_NUMBER=t0_l.ORDER_NUMBER AND t1_c.id=t3_o.customer",
compileEJBQL("SELECT OBJECT(l) FROM Customer c, IN(c.orders) o, IN(o.lineItems) l WHERE c.id=1"));
}
2)
- String expected = "1.4".equals(javaVersion) ?
+ String expected = "1.5".equals(javaVersion) ?
"SELECT t0_o.ORDER_NUMBER " +
"FROM ORDER_DATA t0_o, LINEITEMEJB t4_l, PRODUCTCATEGORYEJB t1_pc, PRODUCT_PRODUCT_CATEGORY t5_l_product_productCategories_R, PRODUCT t6_l_product " +
"WHERE (((t0_o.ORDER_NUMBER = ? AND t1_pc.name = ?))) " +
"AND t6_l_product.id=t5_l_product_productCategories_R.PRODUCT_ID " +
"AND t1_pc.id=t5_l_product_productCategories_R.PRODUCT_CATEGORY_ID " +
"AND t1_pc.subId=t5_l_product_productCategories_R.PRODUCT_CATEGORY_SUBID " +
"AND t4_l.product=t6_l_product.id AND t0_o.ORDER_NUMBER=t4_l.ORDER_NUMBER" :
"SELECT t0_o.ORDER_NUMBER " +
"FROM ORDER_DATA t0_o, LINEITEMEJB t4_l, PRODUCTCATEGORYEJB t1_pc, PRODUCT_PRODUCT_CATEGORY t5_l_product_productCategories_R, PRODUCT t6_l_product " +
"WHERE (((t0_o.ORDER_NUMBER = ? AND t1_pc.name = ?))) " +
"AND t0_o.ORDER_NUMBER=t4_l.ORDER_NUMBER " +
"AND t6_l_product.id=t5_l_product_productCategories_R.PRODUCT_ID " +
"AND t1_pc.id=t5_l_product_productCategories_R.PRODUCT_CATEGORY_ID " +
"AND t1_pc.subId=t5_l_product_productCategories_R.PRODUCT_CATEGORY_SUBID " +
"AND t4_l.product=t6_l_product.id";
- is related to
-
JBPAPP-9341 EJBQL compiler creates different results with different JDKs
- Closed
- relates to
-
JBPAPP-814 Resolve JBoss AS Test Suite Issues when running with JavaSE 6
- Resolved