如何在persistence.xml中指定JPA 2.1?

在网上快速search可以发现3个或4个变种,人们如何在persistence.xml指定xmlnsxsi:schemaLocation

指定JPA版本2.1的“正确”方式是什么?

我在用着:

 <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> 

根据官方文件,它必须是(像你的):

 <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1"> ... </persistence>