mirror of https://github.com/apache/openjpa.git
OPENJPA-2082 Documentation changes and upload schema
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1229541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ed33f06f4d
commit
2d1ff88afb
|
@ -66,6 +66,14 @@
|
|||
<directory>../target/site/apidocs</directory>
|
||||
<outputDirectory>docs/javadoc</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../openjpa-persistence/target/classes/org/apache/openjpa/persistence</directory>
|
||||
<outputDirectory>docs/schema</outputDirectory>
|
||||
<includes>
|
||||
<include>extendable-orm.xsd</include>
|
||||
<include>openjpa-orm.xsd</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../openjpa-examples/image-gallery</directory>
|
||||
<outputDirectory>examples/image-gallery</outputDirectory>
|
||||
|
|
|
@ -977,6 +977,66 @@ public class Magazine
|
|||
|
||||
...
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
<section id="ref_guide_meta_xml">
|
||||
<title>
|
||||
XML extensions
|
||||
</title>
|
||||
<para>
|
||||
OpenJPA has extended the JPA 2.0 schema to include elements and attributes corresponding
|
||||
to OpenJPA extended metadata and mapping annotations. The schema are contained in 2
|
||||
files: <ulink url="http://openjpa.apache.org/builds/latest/docs/schema/extendable-orm.xsd">
|
||||
extendable-orm.xsd</ulink> and
|
||||
<ulink url="http://openjpa.apache.org/builds/latest/docs/schema/openjpa-orm.xsd">openjpa-orm.xsd</ulink>.
|
||||
The extendable-orm.xsd file provides copies of some of the JPA 2.0 schema elements with additional schema to make it
|
||||
extendable.
|
||||
The openjpa-orm.xsd file extends the extendable-orm.xsd with OpenJPA specific elements and attributes representing
|
||||
OpenJPA annotations. Currently, only a subset of annotations have actually been implemented, and some of those
|
||||
have been partially tested. The current status can be found by comments in the
|
||||
<ulink url="http://openjpa.apache.org/builds/latest/docs/schema/openjpa-orm.xsd">openjpa-orm.xsd</ulink>
|
||||
schema file.
|
||||
</para>
|
||||
<para>
|
||||
In order to use the OpenJPA extensions in your mapping file you must include the namespaces for these 2 new
|
||||
schemas as well as for the schema for JPA 2.0, as shown in the following example:
|
||||
</para>
|
||||
<example id="ref_guide_schema_ex">
|
||||
<title>
|
||||
OpenJPA Schema Extensions
|
||||
</title>
|
||||
<programlisting>
|
||||
<entity-mappings xmlns="http://www.apache.org/openjpa/ns/orm/extendable"
|
||||
xmlns:openjpa="http://www.apache.org/openjpa/ns/orm"
|
||||
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
version="2.0">
|
||||
|
||||
<entity class="org.apache.openjpa.persistence.jdbc.annotations.MultiColumnVersionPC"
|
||||
metadata-complete="true">
|
||||
<table name="MCV"/>
|
||||
<attributes>
|
||||
<id name="id">
|
||||
<orm:generated-value/>
|
||||
</id>
|
||||
<basic name="id"/>
|
||||
<basic name="name"/>
|
||||
</attributes>
|
||||
<openjpa:entity version-strategy="version-numbers">
|
||||
<openjpa:version-columns>
|
||||
<openjpa:version-column name="v1"/>
|
||||
<openjpa:version-column name="v2"/>
|
||||
<openjpa:version-column name="v3"
|
||||
column-definition="FLOAT"
|
||||
scale="3"
|
||||
precision="10"/>
|
||||
</openjpa:version-columns>
|
||||
</openjpa:entity>
|
||||
</entity>
|
||||
|
||||
</entity-mappings>
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
<patternset>
|
||||
<include name="**/javadoc/**" />
|
||||
<include name="**/docbook/**" />
|
||||
<include name="**/schema/**"/>
|
||||
</patternset>
|
||||
</unzip>
|
||||
|
||||
|
@ -41,6 +42,7 @@
|
|||
<fileset dir="target/site/tempDocs">
|
||||
<include name="**/javadoc/**"/>
|
||||
<include name="**/docbook/**"/>
|
||||
<include name="**/schema/**"/>
|
||||
<exclude name="docs/**"/>
|
||||
</fileset>
|
||||
</zip>
|
||||
|
|
Loading…
Reference in New Issue