Skip to content

Commit

Permalink
Jakarta Persistence 3.2 - CriteriaQuery test fix
Browse files Browse the repository at this point in the history
Fixes Issue
There was issue in new CriteriaBuilder tests in `org.eclipse.persistence.jpa.testapps.persistence32` module. There wasn't from() and select() mentioned in some tests.

Describe the change
Add missing method calls.

Signed-off-by: Radek Felcman <[email protected]>
  • Loading branch information
rfelcman committed Apr 29, 2024
1 parent 1f0cf75 commit 71c0c7d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -124,6 +124,8 @@ public void testAndPredicateAsListOf0() {
et.begin();
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<SyntaxEntity> cQuery = cb.createQuery(SyntaxEntity.class);
Root<SyntaxEntity> root = cQuery.from(SyntaxEntity.class);
cQuery.select(root);
cQuery.where(cb.and(Collections.emptyList()));
TypedQuery<SyntaxEntity> query = em.createQuery(cQuery);
List<SyntaxEntity> result = query.getResultList();
Expand All @@ -145,6 +147,8 @@ public void testOrPredicateAsListOf0() {
et.begin();
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<SyntaxEntity> cQuery = cb.createQuery(SyntaxEntity.class);
Root<SyntaxEntity> root = cQuery.from(SyntaxEntity.class);
cQuery.select(root);
cQuery.where(cb.or(Collections.emptyList()));
TypedQuery<SyntaxEntity> query = em.createQuery(cQuery);
List<SyntaxEntity> result = query.getResultList();
Expand Down

0 comments on commit 71c0c7d

Please sign in to comment.