0

I need bulk update some entities using JPA 2.1.

Here: http://wiki.eclipse.org/EclipseLink/Release/2.5/JPA21#Update_Example I found example how to do it.

If I wrtite:

CriteriaUpdate<OrderRecordEntity> orderRecordEntity

It's ok. But when I write:

criteriaBuilder.createCriteriaUpdate(OrderRecordEntity.class);

Then I see, that criteriaBuilder don't have method createCriteriaUpdate.

Does anyone know how to resolve this problem?

2 Answers2

3

You might have both JPA 2.0 and JPA 2.1 persistence jars on the classpath. If the 2.0 jar is picked up first on the classpath, you will still see the new JPA 2.1 CriteriaUpdate classes, but only have access to the 2.0 methods on classes that exist in the 2.0 persistence.jar.

Chris
  • 20,138
  • 2
  • 29
  • 43
2

Although this answers is 3 years old, I had the same problem and found out that was happening becasue I had javaee-web-api in my pom.xml, which was conflicting the persistence.

Simply removing it solved the problem for me

Marcelo Abiarraj
  • 199
  • 3
  • 18