Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable tests after fixes from #29650 #29676

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2502,13 +2502,6 @@ private void initQueryLanguage(String ql, Map<String, CompletableFuture<EntityIn

// TODO remove this workaround for #28931 once fixed
boolean insertEntityVar = !entityInfo.relationAttributeNames.isEmpty();
if (!insertEntityVar)
for (int i = startAt; !insertEntityVar && i < length; i++)
switch (ql.charAt(i)) {
case '(': // TODO remove this workaround for #28908 once fixed
insertEntityVar = ql.regionMatches(true, i - 2, "ID", 0, 2);
break;
}
if (insertEntityVar) {
entityVar = "o";
entityVar_ = "o.";
Expand Down Expand Up @@ -2772,12 +2765,6 @@ else if (order0 >= 0 && orderLen == 0)
if (selectLen > 0) {
q = new StringBuilder(ql.length() + (selectLen >= 0 ? 0 : 50) + (fromLen >= 0 ? 0 : 50) + 2);
String selection = ql.substring(select0, select0 + selectLen);
// TODO remove this workaround for #28913 once fixed
if (!insertEntityVar && entityVar_.length() == 0 && selection.indexOf('.') < 0
&& entityInfo.attributeNames.containsKey(selection.trim().toLowerCase())) {
insertEntityVar = true;
entityVar_ = entityVar + ".";
}
if (insertEntityVar) {
q.append("SELECT");
appendWithIdentifierName(ql, select0, select0 + selectLen, entityVar_, q);
Expand Down Expand Up @@ -2830,25 +2817,9 @@ else if (order0 >= 0 && orderLen == 0)
// TODO remove this workaround for #28874 once fixed
else if (jpql.equals(" FROM NaturalNumber WHERE isOdd = false AND numType = ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType.PRIME"))
jpql = "SELECT o FROM NaturalNumber o WHERE o.isOdd = false AND o.numType = ee.jakarta.tck.data.framework.read.only.NaturalNumber.NumberType.PRIME";
// TODO remove this workaround for #28913 once fixed
else if (jpql.equals("SELECT amount FROM RebateEntity WHERE customerId=?1")) // misses prior workaround because selection is implicit
jpql = "SELECT this.amount FROM RebateEntity WHERE this.customerId=?1";
else if (jpql.equals("SELECT DISTINCT name FROM Item WHERE name LIKE :namePattern")) // misses prior workaround due to DISTINCT
jpql = "SELECT DISTINCT this.name FROM Item WHERE this.name LIKE :namePattern";
// TODO remove this workaround for #28925 once fixed
else if (jpql.equals("SELECT ID(THIS) FROM Prime o WHERE (o.name = :numberName OR :numeral=o.romanNumeral OR o.hex =:hex OR ID(THIS)=:num)"))
jpql = "SELECT o.numberId FROM Prime o WHERE (o.name = :numberName OR :numeral=o.romanNumeral OR o.hex =:hex OR o.numberId=:num)";
// TODO remove this workaround for #28928 once fixed
else if (jpql.equals("SELECT MAX(price) FROM Item"))
jpql = "SELECT MAX(this.price) FROM Item";
else if (jpql.equals("SELECT MIN(price) FROM Item"))
jpql = "SELECT MIN(this.price) FROM Item";
else if (jpql.equals("SELECT AVG(price) FROM Item"))
jpql = "SELECT AVG(this.price) FROM Item";
else if (jpql.equals("SELECT SUM(DISTINCT price) FROM Item"))
jpql = "SELECT SUM(DISTINCT this.price) FROM Item";
else if (jpql.equals("SELECT NEW test.jakarta.data.experimental.web.ItemCount(COUNT(name), COUNT(description), COUNT(price)) FROM Item"))
jpql = "SELECT NEW test.jakarta.data.experimental.web.ItemCount(COUNT(this.name), COUNT(this.description), COUNT(this.price)) FROM Item";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5340,24 +5340,21 @@ public void testTotalCountsForQueriesWithSomeClausesOmitted() {
PageRequest page1req = PageRequest.ofSize(3).withTotal();

// query with no clauses
// TODO blocked by 28913
//page1 = receipts.all(page1req, Order.by(Sort.asc(ID)));
//assertEquals(5, page1.totalElements());
page1 = receipts.all(page1req, Order.by(Sort.asc(ID)));
assertEquals(5, page1.totalElements());

receipts.insert(new Receipt(5006, "TCFQWSCO-5", 56.56f));

// query with FROM clause only
// TODO blocked by 28913
//page1 = receipts.all(page1req, Sort.desc(ID));
//assertEquals(6, page1.totalElements());
page1 = receipts.all(page1req, Sort.desc(ID));
assertEquals(6, page1.totalElements());

receipts.insert(new Receipt(5007, "TCFQWSCO-7", 57.17f));

// query with FROM clause only
// TODO blocked by 28913
//page1 = receipts.sortedByTotalIncreasing(page1req);
//assertEquals(7, page1.totalElements());
//assertEquals(5003, page1.iterator().next().purchaseId());
page1 = receipts.sortedByTotalIncreasing(page1req);
assertEquals(7, page1.totalElements());
assertEquals(5003, page1.iterator().next().purchaseId());

receipts.insert(new Receipt(5008, "TCFQWSCO-8", 58.88f));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,9 @@ public interface Demographics {

// End of type conversion methods

@Query("SELECT this.publicDebt / this.numFullTimeWorkers" +
@Query("SELECT publicDebt / numFullTimeWorkers" +
" FROM DemographicInfo" +
" WHERE EXTRACT (YEAR FROM this.collectedOn) = ?1")
// TODO once #29457 is fixed:
//@Query("SELECT publicDebt / numFullTimeWorkers" +
// " FROM DemographicInfo" +
// " WHERE EXTRACT (YEAR FROM collectedOn) = ?1")
" WHERE EXTRACT (YEAR FROM collectedOn) = ?1")
Optional<BigDecimal> publicDebtPerFullTimeWorker(int year);

@Find
Expand Down