persistence@glassfish.java.net

Why does user have to use schemaLocation?

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Tue, 31 Jan 2006 17:44:32 +0530

Hi Mike,

I don't quite understand why the spec *requires* user to use
schemaLocation in persistence.xml? It should be optional. Are the
namespace and version not enough? Section #6.3 of PFD says the following:

<xsd:documentation><![CDATA[
This is the XML Schema for the persistence configuration file.
The file must be named "META-INF/persistence.xml" in the
persistence archive.
Persistence configuration files *must* indicate
the persistence schema by using the persistence namespace:
http://java.sun.com/xml/ns/persistence
and indicate the version of the schema by
using the version element as shown below:
<persistence 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_1_0.xsd"
version="1.0">
...
</persistence>
]]></xsd:documentation>

Secondly when do we expect this schema to be made available as
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd? May be Linda
has to do this. The rest of the Java EE 5 schemas are available online.

Thanks,
Sahoo