kma*_*oor 58 java jpa persistence.xml jpa-2.1
在网上快速搜索显示3或4个变体人们如何指定xmlns和xsi:schemaLocation进入persistence.xml.
指定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">
Run Code Online (Sandbox Code Playgroud)
And*_*i I 103
根据官方文件,它必须(和你的一样):
<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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
43178 次 |
| 最近记录: |