You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by de...@apache.org on 2014/05/27 10:39:31 UTC

svn commit: r1597723 - /olingo/site/trunk/content/doc/tutorials/jparedefinemetadata.mdtext

Author: deepa
Date: Tue May 27 08:39:30 2014
New Revision: 1597723

URL: http://svn.apache.org/r1597723
Log:
CMS commit to olingo by deepa

Modified:
    olingo/site/trunk/content/doc/tutorials/jparedefinemetadata.mdtext

Modified: olingo/site/trunk/content/doc/tutorials/jparedefinemetadata.mdtext
URL: http://svn.apache.org/viewvc/olingo/site/trunk/content/doc/tutorials/jparedefinemetadata.mdtext?rev=1597723&r1=1597722&r2=1597723&view=diff
==============================================================================
--- olingo/site/trunk/content/doc/tutorials/jparedefinemetadata.mdtext (original)
+++ olingo/site/trunk/content/doc/tutorials/jparedefinemetadata.mdtext Tue May 27 08:39:30 2014
@@ -39,151 +39,7 @@ The OData JPA Processor Library applies 
 #### Steps to Redefine the Metadata
 
 1. Create a JPA EDM Mapping model XML according to the schema given below. In the XML, maintain the mapping only for those elements that needs to be redefined. For example, if JPA Entity Type A's name has to be redefined, then maintain an EDM name for the same.
-
-Schema
-
-		<?xml version="1.0" encoding="UTF-8"?>
-		<!--
- 		  Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for
-          additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");
-          you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-  
-         Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
-         WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied. See the License for the specific language governing permissions and limitations under the
-         License.
-		-->
-		<xs:schema attributeFormDefault="unqualified"
-	        elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
-			targetNamespace="http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping"
-			xmlns:tns="http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping">
-
-		  	<xs:element name="JPAEDMMappingModel">
-				<xs:annotation>
-					<xs:documentation xml:lang="en">
-					    Java Persistence (JPA) -
-					    Entity Data Model (EDM) Mapping schema. The schema defines a mapping model to describe EDM names for entity types, entity sets,
-                        entity properties, entity navigation properties. By default the names of Java Persistence entity types, entity attributes 
-                        and entity relationships are transformed into their corresponding EDM names. To override the default names the mapping model
-                        is defined.
-
-                  Note:- Define the mapping model for only those default names that needs to be overridden. 
-                                              
-			        </xs:documentation>
-		        </xs:annotation>
-		        <xs:complexType>
-			        <xs:sequence>
-				        <xs:element name="PersistenceUnit" type="tns:JPAPersistenceUnitMapType"
-					        maxOccurs="1" minOccurs="1" />
-			        </xs:sequence>
-		        </xs:complexType>
-	        </xs:element>
-
-	        <xs:complexType name="JPAAttributeMapType">
-		        <xs:annotation>
-			        <xs:documentation xml:lang="en">
-				        The default name for EDM property is derived from JPA attribute name. This can be overridden using JPAAttributeMapType.
-			        </xs:documentation>
-		    	</xs:annotation>
-		        <xs:sequence>
-			        <xs:element name="JPAAttribute" maxOccurs="unbounded" 
-					    minOccurs="0">
-				        <xs:complexType>
-					        <xs:simpleContent>
-						        <xs:extension base="xs:string">
-							        <xs:attribute type="xs:string" name="name" use="required" />
-							        <xs:attribute type="xs:boolean" name="exclude" use="optional"
-								        default="false" />
-						        </xs:extension>
-							</xs:simpleContent>
-				        </xs:complexType>
-		            </xs:element>
-		        </xs:sequence>
-		    </xs:complexType>
-
-		    <xs:complexType name="JPARelationshipMapType">
-		        <xs:annotation>
-			        <xs:documentation xml:lang="en">
-				        The default name for EDM navigation property is derived from JPA relationship name. This can be overridden using JPARelationshipMapType.
-			        </xs:documentation>
-		        </xs:annotation>
-		        <xs:sequence>
-			        <xs:element name="JPARelationship" maxOccurs="unbounded" 
-					    minOccurs="0">
-				        <xs:complexType>
-					        <xs:simpleContent>
-						        <xs:extension base="xs:string">
-							        <xs:attribute type="xs:string" name="name" use="required" />
-						        </xs:extension>
-					        </xs:simpleContent>
-				        </xs:complexType>
-			        </xs:element>
-		        </xs:sequence>
-	        </xs:complexType>
-
-	        <xs:complexType name="JPAEntityTypeMapType">
-		        <xs:annotation>
-			        <xs:documentation xml:lang="en">
-				        The default name for EDM entity type is derived from JPA entity type name. This can be overridden using JPAEntityTypeMapType.
-			        </xs:documentation>
-		        </xs:annotation>
-		        <xs:sequence>
-			        <xs:element type="xs:string" name="EDMEntityType"
-				        maxOccurs="1" minOccurs="0" />
-			        <xs:element type="xs:string" name="EDMEntitySet"
-				        maxOccurs="1" minOccurs="0" />
-			        <xs:element name="JPAAttributes"    type="tns:JPAAttributeMapType" />
-			        <xs:element name="JPARelationships" type="tns:JPARelationshipMapType" />
-		        </xs:sequence>
-		        <xs:attribute type="xs:string" name="name" use="required" />
-		        <xs:attribute type="xs:boolean" name="exclude" use="optional" default="false" />
-	     	</xs:complexType>
-
-	        <xs:complexType name="JPAEntityTypesMapType">
-		        <xs:sequence>
-			        <xs:element name="JPAEntityType" type="tns:JPAEntityTypeMapType" 
-					    maxOccurs="unbounded" minOccurs="0" />
-		        </xs:sequence>
-	        </xs:complexType>
-	        <xs:complexType name="JPAEmbeddableTypeMapType">
-		        <xs:annotation>
-			        <xs:documentation xml:lang="en">
-				        The default name for EDM complex type is derived from JPA Embeddable type name. This can be	overridden using JPAEmbeddableTypeMapType.
-			        </xs:documentation>
-		        </xs:annotation>
-		        <xs:sequence>
-			        <xs:element type="xs:string" name="EDMComplexType" 
-					    maxOccurs="1" minOccurs="0" />
-			        <xs:element name="JPAAttributes" type="tns:JPAAttributeMapType" />
-		        </xs:sequence>
-		        <xs:attribute type="xs:string" name="name" use="required" />
-		        <xs:attribute type="xs:boolean" name="exclude" use="optional" 
-				    default="false" />
-	        </xs:complexType>
-
-	        <xs:complexType name="JPAEmbeddableTypesMapType">
-		        <xs:sequence>
-			        <xs:element name="JPAEmbeddableType" type="tns:JPAEmbeddableTypeMapType" 
-					    maxOccurs="unbounded" minOccurs="0" />
-		        </xs:sequence>
-	        </xs:complexType>
-
-	        <xs:complexType name="JPAPersistenceUnitMapType">
-		        <xs:annotation>
-			        <xs:documentation xml:lang="en">
-				        By default Java	Persistence Unit name is taken as EDM schema name. This can be overridden using JPAPersistenceUnitMapType.
-			        </xs:documentation>
-		        </xs:annotation>
-		        <xs:sequence>
-			        <xs:element type="xs:string" name="EDMSchemaNamespace" 
-					    maxOccurs="1" minOccurs="0" />
-			        <xs:element name="JPAEntityTypes" type="tns:JPAEntityTypesMapType" />
-			        <xs:element name="JPAEmbeddableTypes" type="tns:JPAEmbeddableTypesMapType" />
-		        </xs:sequence>
-		        <xs:attribute type="xs:string" name="name" use="required" />
-	        </xs:complexType>
-
-		</xs:schema
-		
+   Link to [Schema][1].
 2. Deploy the JPA EDM Mapping model XML file in the root directory of your web application archive (store it in the same directory as 'WEB-INF').
 3. Pass the XML name into *ODataJPAContext*. In the method *initializeODataJPAContext*, pass the name of the XML document as shown below:
 
@@ -236,4 +92,7 @@ Schema
 		    </PersistenceUnit>
 		  </JPAEDMMappingModel>
 
-		 
\ No newline at end of file
+		 
+
+
+  [1]: https://cms.apache.org/olingo/wc/browse/deepa-udCb40/trunk/content/resources/RedefiningTheMetadataSchema
\ No newline at end of file