2013-06-14 11 views
6

Prawidłowe tag wyjścia do pliku odwzorowań jednostki za JPA 2.0 byłJak określić mapowania encji w JPA 2.1?

<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm 
    http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"> 

Jakie są wymagane korekty JPA 2.1?

Próbowałem

<entity-mappings version="2.1" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"> 

Ale to daje błąd:

No grammar constraints (DTD or XML Schema) referenced in the document.

+1

tha t jest początkowym tagiem dla JPA 1.0 nie 2.0 –

Odpowiedz

1

Dla wersji 2.1 następuje pracy:

<?xml version="1.0" encoding="UTF-8" ?> 
<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"> 
3

Według official documentation, sekcji 12.3 Schemat XML:

<entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm 
     http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd" 
    version="2.1"> 
     ... 
</entity-mappings> 
Powiązane problemy