Avoid using the deprecated Jakarta Persistence 3.2 classes

Jakarta Persistence 3.2 updated the package for several classes. See the affected classes and their replacement in the bulleted list: