Dear,
I just try to custom my persistence.xml with a namespace : xmlns:persistence="http://java.sun.com/xml/ns/persistence". It looks like hibernate do not like it because if I don't use it it works perfectly.
For example :
It's work :
Code:
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ">
<persistence-unit name="demojpa-pu">
<properties>
<property name="hibernate.archive.autodetection" value="class" />
<property name="hibernate.format_sql" value="true" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/demojpa" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="formation" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
</persistence>
It does not work :
Code:
<persistence:persistence version="2.0"
xmlns:persistence="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ">
<persistence:persistence-unit name="demojpa-pu">
<persistence:properties>
<persistence:property name="hibernate.archive.autodetection" value="class" />
<persistence:property name="hibernate.format_sql" value="true" />
<persistence:property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<persistence:property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/demojpa" />
<persistence:property name="javax.persistence.jdbc.user" value="root" />
<persistence:property name="javax.persistence.jdbc.password" value="formation" />
<persistence:property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<persistence:property name="hibernate.hbm2ddl.auto" value="create" />
</persistence:properties>
</persistence:persistence-unit>
</persistence:persistence>
I tried with EclipseLink, EclipseLink supports namespace.
What do you think ? It's a bug ?
Thanks for your advice.