From 2d1ff88afb2c21c052044d8ac0b6058efb3d19d2 Mon Sep 17 00:00:00 2001 From: "Dianne E. Richards" Date: Tue, 10 Jan 2012 13:53:53 +0000 Subject: [PATCH] OPENJPA-2082 Documentation changes and upload schema git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1229541 13f79535-47bb-0310-9956-ffa450edef68 --- openjpa-project/assembly.xml | 8 +++ .../src/doc/manual/ref_guide_meta.xml | 60 +++++++++++++++++++ openjpa-project/upload.xml | 2 + 3 files changed, 70 insertions(+) diff --git a/openjpa-project/assembly.xml b/openjpa-project/assembly.xml index 7537aa2cb..ffda9b9f9 100644 --- a/openjpa-project/assembly.xml +++ b/openjpa-project/assembly.xml @@ -66,6 +66,14 @@ ../target/site/apidocs docs/javadoc + + ../openjpa-persistence/target/classes/org/apache/openjpa/persistence + docs/schema + + extendable-orm.xsd + openjpa-orm.xsd + + ../openjpa-examples/image-gallery examples/image-gallery diff --git a/openjpa-project/src/doc/manual/ref_guide_meta.xml b/openjpa-project/src/doc/manual/ref_guide_meta.xml index aa4b11ff5..3bcee601b 100644 --- a/openjpa-project/src/doc/manual/ref_guide_meta.xml +++ b/openjpa-project/src/doc/manual/ref_guide_meta.xml @@ -979,6 +979,66 @@ public class Magazine } + +
+ + XML extensions + + +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: +extendable-orm.xsd and +openjpa-orm.xsd. +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 +openjpa-orm.xsd +schema file. + + +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: + + + + OpenJPA Schema Extensions + + +<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> + + +
diff --git a/openjpa-project/upload.xml b/openjpa-project/upload.xml index 2f03ca948..944b9a93c 100644 --- a/openjpa-project/upload.xml +++ b/openjpa-project/upload.xml @@ -34,6 +34,7 @@ + @@ -41,6 +42,7 @@ +