I came here looking for an answer to this problem: "Static Metamodel cannot be resolved to a type". in eclipse ide I'll leave here how to solve it... These links explain how to add path factory:
https://javabeat.net/jpa-2-metamodel-eclipse/
If for some reason the links are broken, right click on the project -> Properties -> Java Compiler here you must add the jars that appear below:
If the problem persists, it worked for me to select jakarta.persistence-api-3.1.0.jar -> Advanced then activate the check