You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2013/12/28 15:18:29 UTC
[31/31] git commit: [OLINGO-99] Re-factor Package Names. Following
are the changes
[OLINGO-99] Re-factor Package Names. Following are the changes
Module jpa-api
1) Package name is re-factored from
org.apache.olingo.odata2.processor.api.jpa.* to
org.apache.olingo.odata2.jpa.processor.api.*
2) The namespace for the mapping model schema is changed from
http://www.apache.org/olingo/odata2/processor/api/jpa/model/mapping
to
http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping
Module jpa-core
1) Package name is re-factored from
org.apache.olingo.odata2.processor.core.jpa to
org.apache.olingo.odata2.jpa.processor.core
Signed-off-by: Chandan V A <ch...@sap.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/63b621a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/63b621a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/63b621a8
Branch: refs/heads/master
Commit: 63b621a8016283e28e55b4b4d1f2c089bd536795
Parents: 8695302
Author: Chandan V A <ch...@sap.com>
Authored: Sat Dec 28 19:46:19 2013 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Sat Dec 28 19:47:17 2013 +0530
----------------------------------------------------------------------
odata2-jpa-processor/jpa-api/pom.xml | 4 +-
.../jpa/processor/api/ODataJPAContext.java | 206 ++++++
.../jpa/processor/api/ODataJPAProcessor.java | 69 ++
.../processor/api/ODataJPAServiceFactory.java | 190 ++++++
.../jpa/processor/api/access/JPAEdmBuilder.java | 57 ++
.../api/access/JPAEdmMappingModelAccess.java | 191 ++++++
.../jpa/processor/api/access/JPAFunction.java | 85 +++
.../jpa/processor/api/access/JPAJoinClause.java | 148 +++++
.../processor/api/access/JPAMethodContext.java | 130 ++++
.../api/access/JPAMethodContextView.java | 46 ++
.../jpa/processor/api/access/JPAProcessor.java | 260 ++++++++
.../jpa/processor/api/access/package-info.java | 26 +
.../api/exception/ODataJPAErrorCallback.java | 45 ++
.../api/exception/ODataJPAException.java | 68 ++
.../api/exception/ODataJPAMessageService.java | 49 ++
.../api/exception/ODataJPAModelException.java | 92 +++
.../api/exception/ODataJPARuntimeException.java | 97 +++
.../processor/api/exception/package-info.java | 31 +
.../processor/api/factory/JPAAccessFactory.java | 69 ++
.../api/factory/JPQLBuilderFactory.java | 77 +++
.../api/factory/ODataJPAAccessFactory.java | 82 +++
.../processor/api/factory/ODataJPAFactory.java | 105 ++++
.../jpa/processor/api/factory/package-info.java | 33 +
.../jpa/processor/api/jpql/JPQLContext.java | 204 ++++++
.../jpa/processor/api/jpql/JPQLContextType.java | 73 +++
.../jpa/processor/api/jpql/JPQLContextView.java | 53 ++
.../processor/api/jpql/JPQLJoinContextView.java | 44 ++
.../jpql/JPQLJoinSelectSingleContextView.java | 45 ++
.../api/jpql/JPQLSelectContextView.java | 62 ++
.../api/jpql/JPQLSelectSingleContextView.java | 53 ++
.../jpa/processor/api/jpql/JPQLStatement.java | 148 +++++
.../jpa/processor/api/jpql/package-info.java | 27 +
.../api/model/JPAEdmAssociationEndView.java | 91 +++
.../api/model/JPAEdmAssociationSetView.java | 69 ++
.../api/model/JPAEdmAssociationView.java | 128 ++++
.../jpa/processor/api/model/JPAEdmBaseView.java | 101 +++
.../api/model/JPAEdmComplexPropertyView.java | 45 ++
.../api/model/JPAEdmComplexTypeView.java | 137 ++++
.../api/model/JPAEdmEntityContainerView.java | 72 +++
.../api/model/JPAEdmEntitySetView.java | 64 ++
.../api/model/JPAEdmEntityTypeView.java | 76 +++
.../processor/api/model/JPAEdmExtension.java | 50 ++
.../api/model/JPAEdmFunctionImportView.java | 51 ++
.../jpa/processor/api/model/JPAEdmKeyView.java | 51 ++
.../jpa/processor/api/model/JPAEdmMapping.java | 63 ++
.../processor/api/model/JPAEdmModelView.java | 43 ++
.../api/model/JPAEdmNavigationPropertyView.java | 72 +++
.../processor/api/model/JPAEdmPropertyView.java | 104 +++
.../JPAEdmReferentialConstraintRoleView.java | 101 +++
.../model/JPAEdmReferentialConstraintView.java | 69 ++
.../processor/api/model/JPAEdmSchemaView.java | 111 ++++
.../api/model/mapping/JPAAttributeMapType.java | 202 ++++++
.../api/model/mapping/JPAEdmMappingModel.java | 79 +++
.../mapping/JPAEdmMappingModelFactory.java | 85 +++
.../model/mapping/JPAEmbeddableTypeMapType.java | 161 +++++
.../mapping/JPAEmbeddableTypesMapType.java | 89 +++
.../api/model/mapping/JPAEntityTypeMapType.java | 213 +++++++
.../model/mapping/JPAEntityTypesMapType.java | 89 +++
.../mapping/JPAPersistenceUnitMapType.java | 157 +++++
.../model/mapping/JPARelationshipMapType.java | 175 ++++++
.../api/model/mapping/package-info.java | 28 +
.../jpa/processor/api/model/package-info.java | 27 +
.../odata2/jpa/processor/api/package-info.java | 33 +
.../processor/api/jpa/ODataJPAContext.java | 206 ------
.../processor/api/jpa/ODataJPAProcessor.java | 69 --
.../api/jpa/ODataJPAServiceFactory.java | 190 ------
.../processor/api/jpa/access/JPAEdmBuilder.java | 57 --
.../jpa/access/JPAEdmMappingModelAccess.java | 191 ------
.../processor/api/jpa/access/JPAFunction.java | 85 ---
.../processor/api/jpa/access/JPAJoinClause.java | 148 -----
.../api/jpa/access/JPAMethodContext.java | 130 ----
.../api/jpa/access/JPAMethodContextView.java | 46 --
.../processor/api/jpa/access/JPAProcessor.java | 260 --------
.../processor/api/jpa/access/package-info.java | 26 -
.../jpa/exception/ODataJPAErrorCallback.java | 45 --
.../api/jpa/exception/ODataJPAException.java | 68 --
.../jpa/exception/ODataJPAMessageService.java | 49 --
.../jpa/exception/ODataJPAModelException.java | 92 ---
.../jpa/exception/ODataJPARuntimeException.java | 97 ---
.../api/jpa/exception/package-info.java | 31 -
.../api/jpa/factory/JPAAccessFactory.java | 69 --
.../api/jpa/factory/JPQLBuilderFactory.java | 77 ---
.../api/jpa/factory/ODataJPAAccessFactory.java | 82 ---
.../api/jpa/factory/ODataJPAFactory.java | 105 ----
.../processor/api/jpa/factory/package-info.java | 33 -
.../processor/api/jpa/jpql/JPQLContext.java | 204 ------
.../processor/api/jpa/jpql/JPQLContextType.java | 73 ---
.../processor/api/jpa/jpql/JPQLContextView.java | 53 --
.../api/jpa/jpql/JPQLJoinContextView.java | 44 --
.../jpql/JPQLJoinSelectSingleContextView.java | 45 --
.../api/jpa/jpql/JPQLSelectContextView.java | 62 --
.../jpa/jpql/JPQLSelectSingleContextView.java | 53 --
.../processor/api/jpa/jpql/JPQLStatement.java | 148 -----
.../processor/api/jpa/jpql/package-info.java | 27 -
.../api/jpa/model/JPAEdmAssociationEndView.java | 91 ---
.../api/jpa/model/JPAEdmAssociationSetView.java | 69 --
.../api/jpa/model/JPAEdmAssociationView.java | 128 ----
.../processor/api/jpa/model/JPAEdmBaseView.java | 101 ---
.../jpa/model/JPAEdmComplexPropertyView.java | 45 --
.../api/jpa/model/JPAEdmComplexTypeView.java | 137 ----
.../jpa/model/JPAEdmEntityContainerView.java | 72 ---
.../api/jpa/model/JPAEdmEntitySetView.java | 64 --
.../api/jpa/model/JPAEdmEntityTypeView.java | 76 ---
.../api/jpa/model/JPAEdmExtension.java | 50 --
.../api/jpa/model/JPAEdmFunctionImportView.java | 51 --
.../processor/api/jpa/model/JPAEdmKeyView.java | 51 --
.../processor/api/jpa/model/JPAEdmMapping.java | 63 --
.../api/jpa/model/JPAEdmModelView.java | 43 --
.../jpa/model/JPAEdmNavigationPropertyView.java | 72 ---
.../api/jpa/model/JPAEdmPropertyView.java | 104 ---
.../JPAEdmReferentialConstraintRoleView.java | 101 ---
.../model/JPAEdmReferentialConstraintView.java | 69 --
.../api/jpa/model/JPAEdmSchemaView.java | 111 ----
.../jpa/model/mapping/JPAAttributeMapType.java | 202 ------
.../jpa/model/mapping/JPAEdmMappingModel.java | 79 ---
.../mapping/JPAEdmMappingModelFactory.java | 85 ---
.../model/mapping/JPAEmbeddableTypeMapType.java | 161 -----
.../mapping/JPAEmbeddableTypesMapType.java | 89 ---
.../jpa/model/mapping/JPAEntityTypeMapType.java | 213 -------
.../model/mapping/JPAEntityTypesMapType.java | 89 ---
.../mapping/JPAPersistenceUnitMapType.java | 157 -----
.../model/mapping/JPARelationshipMapType.java | 175 ------
.../api/jpa/model/mapping/package-info.java | 28 -
.../processor/api/jpa/model/package-info.java | 27 -
.../odata2/processor/api/jpa/package-info.java | 33 -
.../src/main/resources/JPAEDMMappingModel.xsd | 4 +-
odata2-jpa-processor/jpa-core/pom.xml | 2 +-
.../jpa/processor/core/ODataEntityParser.java | 163 +++++
.../processor/core/ODataExpressionParser.java | 381 +++++++++++
.../jpa/processor/core/ODataJPAContextImpl.java | 146 +++++
.../core/ODataJPAProcessorDefault.java | 194 ++++++
.../processor/core/ODataJPAResponseBuilder.java | 629 +++++++++++++++++++
.../processor/core/access/data/JPAEntity.java | 355 +++++++++++
.../core/access/data/JPAEntityParser.java | 453 +++++++++++++
.../core/access/data/JPAExpandCallBack.java | 180 ++++++
.../core/access/data/JPAFunctionContext.java | 170 +++++
.../jpa/processor/core/access/data/JPALink.java | 225 +++++++
.../core/access/data/JPAProcessorImpl.java | 491 +++++++++++++++
.../core/access/model/EdmTypeConvertor.java | 69 ++
.../access/model/JPAEdmMappingModelService.java | 247 ++++++++
.../core/access/model/JPAEdmNameBuilder.java | 499 +++++++++++++++
.../core/access/model/JPATypeConvertor.java | 119 ++++
.../processor/core/edm/ODataJPAEdmProvider.java | 295 +++++++++
.../ODataJPAMessageServiceDefault.java | 122 ++++
.../core/factory/ODataJPAFactoryImpl.java | 237 +++++++
.../core/jpql/JPQLJoinSelectContext.java | 171 +++++
.../core/jpql/JPQLJoinSelectSingleContext.java | 158 +++++
.../JPQLJoinSelectSingleStatementBuilder.java | 106 ++++
.../core/jpql/JPQLJoinStatementBuilder.java | 145 +++++
.../processor/core/jpql/JPQLSelectContext.java | 159 +++++
.../core/jpql/JPQLSelectSingleContext.java | 109 ++++
.../jpql/JPQLSelectSingleStatementBuilder.java | 66 ++
.../core/jpql/JPQLSelectStatementBuilder.java | 98 +++
.../processor/core/model/JPAEdmAssociation.java | 237 +++++++
.../core/model/JPAEdmAssociationEnd.java | 183 ++++++
.../core/model/JPAEdmAssociationSet.java | 131 ++++
.../core/model/JPAEdmBaseViewImpl.java | 101 +++
.../processor/core/model/JPAEdmComplexType.java | 270 ++++++++
.../core/model/JPAEdmEntityContainer.java | 145 +++++
.../processor/core/model/JPAEdmEntitySet.java | 112 ++++
.../processor/core/model/JPAEdmEntityType.java | 230 +++++++
.../jpa/processor/core/model/JPAEdmFacets.java | 94 +++
.../core/model/JPAEdmFunctionImport.java | 349 ++++++++++
.../jpa/processor/core/model/JPAEdmKey.java | 129 ++++
.../processor/core/model/JPAEdmMappingImpl.java | 51 ++
.../jpa/processor/core/model/JPAEdmModel.java | 65 ++
.../core/model/JPAEdmNavigationProperty.java | 98 +++
.../processor/core/model/JPAEdmProperty.java | 377 +++++++++++
.../core/model/JPAEdmReferentialConstraint.java | 147 +++++
.../model/JPAEdmReferentialConstraintRole.java | 258 ++++++++
.../jpa/processor/core/model/JPAEdmSchema.java | 214 +++++++
.../model/_JPAEdmFunctionImportBuilder.java | 237 +++++++
.../processor/core/jpa/ODataEntityParser.java | 163 -----
.../core/jpa/ODataExpressionParser.java | 381 -----------
.../processor/core/jpa/ODataJPAContextImpl.java | 146 -----
.../core/jpa/ODataJPAProcessorDefault.java | 194 ------
.../core/jpa/ODataJPAResponseBuilder.java | 629 -------------------
.../core/jpa/access/data/JPAEntity.java | 355 -----------
.../core/jpa/access/data/JPAEntityParser.java | 453 -------------
.../core/jpa/access/data/JPAExpandCallBack.java | 180 ------
.../jpa/access/data/JPAFunctionContext.java | 170 -----
.../processor/core/jpa/access/data/JPALink.java | 225 -------
.../core/jpa/access/data/JPAProcessorImpl.java | 491 ---------------
.../core/jpa/access/model/EdmTypeConvertor.java | 69 --
.../access/model/JPAEdmMappingModelService.java | 247 --------
.../jpa/access/model/JPAEdmNameBuilder.java | 499 ---------------
.../core/jpa/access/model/JPATypeConvertor.java | 119 ----
.../core/jpa/edm/ODataJPAEdmProvider.java | 295 ---------
.../ODataJPAMessageServiceDefault.java | 122 ----
.../core/jpa/factory/ODataJPAFactoryImpl.java | 237 -------
.../core/jpa/jpql/JPQLJoinSelectContext.java | 171 -----
.../jpa/jpql/JPQLJoinSelectSingleContext.java | 158 -----
.../JPQLJoinSelectSingleStatementBuilder.java | 106 ----
.../core/jpa/jpql/JPQLJoinStatementBuilder.java | 145 -----
.../core/jpa/jpql/JPQLSelectContext.java | 159 -----
.../core/jpa/jpql/JPQLSelectSingleContext.java | 109 ----
.../jpql/JPQLSelectSingleStatementBuilder.java | 66 --
.../jpa/jpql/JPQLSelectStatementBuilder.java | 98 ---
.../core/jpa/model/JPAEdmAssociation.java | 237 -------
.../core/jpa/model/JPAEdmAssociationEnd.java | 183 ------
.../core/jpa/model/JPAEdmAssociationSet.java | 131 ----
.../core/jpa/model/JPAEdmBaseViewImpl.java | 101 ---
.../core/jpa/model/JPAEdmComplexType.java | 270 --------
.../core/jpa/model/JPAEdmEntityContainer.java | 145 -----
.../core/jpa/model/JPAEdmEntitySet.java | 112 ----
.../core/jpa/model/JPAEdmEntityType.java | 230 -------
.../processor/core/jpa/model/JPAEdmFacets.java | 94 ---
.../core/jpa/model/JPAEdmFunctionImport.java | 349 ----------
.../processor/core/jpa/model/JPAEdmKey.java | 129 ----
.../core/jpa/model/JPAEdmMappingImpl.java | 51 --
.../processor/core/jpa/model/JPAEdmModel.java | 65 --
.../jpa/model/JPAEdmNavigationProperty.java | 98 ---
.../core/jpa/model/JPAEdmProperty.java | 377 -----------
.../jpa/model/JPAEdmReferentialConstraint.java | 147 -----
.../model/JPAEdmReferentialConstraintRole.java | 258 --------
.../processor/core/jpa/model/JPAEdmSchema.java | 214 -------
.../jpa/model/_JPAEdmFunctionImportBuilder.java | 237 -------
.../main/resources/jpaprocessor_msg.properties | 66 +-
.../core/ODataExpressionParserTest.java | 516 +++++++++++++++
.../processor/core/ODataJPAContextImplTest.java | 99 +++
.../core/ODataJPAProcessorDefaultTest.java | 555 ++++++++++++++++
.../core/ODataJPAResponseBuilderTest.java | 567 +++++++++++++++++
.../core/access/data/JPAEntityParserTest.java | 600 ++++++++++++++++++
.../JPAEntityParserTestForStaticMethods.java | 252 ++++++++
.../core/access/data/JPAEntityTest.java | 188 ++++++
.../core/access/data/JPAExpandCallBackTest.java | 161 +++++
.../access/data/JPAFunctionContextTest.java | 144 +++++
.../core/access/data/JPAProcessorImplTest.java | 448 +++++++++++++
.../model/JPAEdmMappingModelServiceTest.java | 214 +++++++
.../access/model/JPAEdmNameBuilderTest.java | 153 +++++
.../core/access/model/JPATypeConvertorTest.java | 95 +++
.../core/common/ODataJPATestConstants.java | 27 +
.../edm/ODataJPAEdmProviderNegativeTest.java | 192 ++++++
.../core/edm/ODataJPAEdmProviderTest.java | 386 ++++++++++++
.../core/jpql/JPQLBuilderFactoryTest.java | 381 +++++++++++
.../core/jpql/JPQLJoinContextTest.java | 199 ++++++
.../jpql/JPQLJoinSelectSingleContextTest.java | 216 +++++++
...PQLJoinSelectSingleStatementBuilderTest.java | 143 +++++
.../core/jpql/JPQLJoinStatementBuilderTest.java | 125 ++++
.../core/jpql/JPQLSelectContextImplTest.java | 386 ++++++++++++
.../jpql/JPQLSelectSingleContextImplTest.java | 199 ++++++
.../JPQLSelectSingleStatementBuilderTest.java | 125 ++++
.../jpql/JPQLSelectStatementBuilderTest.java | 137 ++++
.../core/mock/ODataJPAContextMock.java | 57 ++
.../processor/core/mock/data/EdmMockUtil.java | 337 ++++++++++
.../processor/core/mock/data/EdmMockUtilV2.java | 324 ++++++++++
.../processor/core/mock/data/JPATypeMock.java | 205 ++++++
.../core/mock/data/ODataEntryMockUtil.java | 127 ++++
.../core/mock/data/SalesOrderHeader.java | 63 ++
.../core/mock/data/SalesOrderLineItem.java | 38 ++
.../core/mock/data/SalesOrderLineItemKey.java | 52 ++
.../core/mock/model/EdmSchemaMock.java | 213 +++++++
.../core/mock/model/JPAAttributeMock.java | 63 ++
.../core/mock/model/JPACustomProcessorMock.java | 74 +++
.../core/mock/model/JPAEdmMockData.java | 72 +++
.../core/mock/model/JPAEmbeddableMock.java | 184 ++++++
.../core/mock/model/JPAEmbeddableTypeMock.java | 184 ++++++
.../core/mock/model/JPAEntityTypeMock.java | 246 ++++++++
.../core/mock/model/JPAJavaMemberMock.java | 74 +++
.../core/mock/model/JPAManagedTypeMock.java | 184 ++++++
.../core/mock/model/JPAMetaModelMock.java | 60 ++
.../core/mock/model/JPAPluralAttributeMock.java | 95 +++
.../mock/model/JPASingularAttributeMock.java | 94 +++
.../mock/model/_JPACustomProcessorMock.java | 77 +++
.../model/_JPACustomProcessorNegativeMock.java | 70 +++
.../core/model/JPAEdmAssociationEndTest.java | 178 ++++++
.../core/model/JPAEdmAssociationSetTest.java | 185 ++++++
.../core/model/JPAEdmAssociationTest.java | 426 +++++++++++++
.../core/model/JPAEdmBaseViewImplTest.java | 90 +++
.../core/model/JPAEdmComplexTypeTest.java | 270 ++++++++
.../core/model/JPAEdmEntityContainerTest.java | 235 +++++++
.../core/model/JPAEdmEntitySetTest.java | 225 +++++++
.../core/model/JPAEdmEntityTypeTest.java | 199 ++++++
.../core/model/JPAEdmFunctionImportTest.java | 567 +++++++++++++++++
.../jpa/processor/core/model/JPAEdmKeyTest.java | 177 ++++++
.../processor/core/model/JPAEdmModelTest.java | 146 +++++
.../model/JPAEdmNavigationPropertyTest.java | 219 +++++++
.../core/model/JPAEdmPropertyTest.java | 439 +++++++++++++
.../JPAEdmReferentialConstraintRoleTest.java | 235 +++++++
.../model/JPAEdmReferentialConstraintTest.java | 178 ++++++
.../processor/core/model/JPAEdmSchemaTest.java | 104 +++
.../core/model/JPAEdmTestModelView.java | 400 ++++++++++++
.../core/model/_JPAEdmFunctionImportTest.java | 571 +++++++++++++++++
.../core/jpa/ODataExpressionParserTest.java | 515 ---------------
.../core/jpa/ODataJPAContextImplTest.java | 98 ---
.../core/jpa/ODataJPAProcessorDefaultTest.java | 554 ----------------
.../core/jpa/ODataJPAResponseBuilderTest.java | 566 -----------------
.../jpa/access/data/JPAEntityParserTest.java | 599 ------------------
.../JPAEntityParserTestForStaticMethods.java | 251 --------
.../core/jpa/access/data/JPAEntityTest.java | 187 ------
.../jpa/access/data/JPAExpandCallBackTest.java | 160 -----
.../jpa/access/data/JPAFunctionContextTest.java | 143 -----
.../jpa/access/data/JPAProcessorImplTest.java | 447 -------------
.../model/JPAEdmMappingModelServiceTest.java | 213 -------
.../jpa/access/model/JPAEdmNameBuilderTest.java | 151 -----
.../jpa/access/model/JPATypeConvertorTest.java | 94 ---
.../core/jpa/common/ODataJPATestConstants.java | 27 -
.../edm/ODataJPAEdmProviderNegativeTest.java | 191 ------
.../core/jpa/edm/ODataJPAEdmProviderTest.java | 385 ------------
.../core/jpa/jpql/JPQLBuilderFactoryTest.java | 377 -----------
.../core/jpa/jpql/JPQLJoinContextTest.java | 198 ------
.../jpql/JPQLJoinSelectSingleContextTest.java | 215 -------
...PQLJoinSelectSingleStatementBuilderTest.java | 142 -----
.../jpa/jpql/JPQLJoinStatementBuilderTest.java | 124 ----
.../jpa/jpql/JPQLSelectContextImplTest.java | 385 ------------
.../jpql/JPQLSelectSingleContextImplTest.java | 198 ------
.../JPQLSelectSingleStatementBuilderTest.java | 123 ----
.../jpql/JPQLSelectStatementBuilderTest.java | 135 ----
.../core/jpa/mock/ODataJPAContextMock.java | 57 --
.../core/jpa/mock/data/EdmMockUtil.java | 337 ----------
.../core/jpa/mock/data/EdmMockUtilV2.java | 324 ----------
.../core/jpa/mock/data/JPATypeMock.java | 205 ------
.../core/jpa/mock/data/ODataEntryMockUtil.java | 127 ----
.../core/jpa/mock/data/SalesOrderHeader.java | 63 --
.../core/jpa/mock/data/SalesOrderLineItem.java | 38 --
.../jpa/mock/data/SalesOrderLineItemKey.java | 52 --
.../core/jpa/mock/model/EdmSchemaMock.java | 213 -------
.../core/jpa/mock/model/JPAAttributeMock.java | 63 --
.../jpa/mock/model/JPACustomProcessorMock.java | 74 ---
.../core/jpa/mock/model/JPAEdmMockData.java | 72 ---
.../core/jpa/mock/model/JPAEmbeddableMock.java | 184 ------
.../jpa/mock/model/JPAEmbeddableTypeMock.java | 184 ------
.../core/jpa/mock/model/JPAEntityTypeMock.java | 246 --------
.../core/jpa/mock/model/JPAJavaMemberMock.java | 74 ---
.../core/jpa/mock/model/JPAManagedTypeMock.java | 184 ------
.../core/jpa/mock/model/JPAMetaModelMock.java | 60 --
.../jpa/mock/model/JPAPluralAttributeMock.java | 95 ---
.../mock/model/JPASingularAttributeMock.java | 94 ---
.../jpa/mock/model/_JPACustomProcessorMock.java | 77 ---
.../model/_JPACustomProcessorNegativeMock.java | 70 ---
.../jpa/model/JPAEdmAssociationEndTest.java | 177 ------
.../jpa/model/JPAEdmAssociationSetTest.java | 184 ------
.../core/jpa/model/JPAEdmAssociationTest.java | 423 -------------
.../core/jpa/model/JPAEdmBaseViewImplTest.java | 89 ---
.../core/jpa/model/JPAEdmComplexTypeTest.java | 268 --------
.../jpa/model/JPAEdmEntityContainerTest.java | 234 -------
.../core/jpa/model/JPAEdmEntitySetTest.java | 224 -------
.../core/jpa/model/JPAEdmEntityTypeTest.java | 198 ------
.../jpa/model/JPAEdmFunctionImportTest.java | 566 -----------------
.../processor/core/jpa/model/JPAEdmKeyTest.java | 176 ------
.../core/jpa/model/JPAEdmModelTest.java | 145 -----
.../jpa/model/JPAEdmNavigationPropertyTest.java | 218 -------
.../core/jpa/model/JPAEdmPropertyTest.java | 438 -------------
.../JPAEdmReferentialConstraintRoleTest.java | 233 -------
.../model/JPAEdmReferentialConstraintTest.java | 177 ------
.../core/jpa/model/JPAEdmSchemaTest.java | 103 ---
.../core/jpa/model/JPAEdmTestModelView.java | 400 ------------
.../jpa/model/_JPAEdmFunctionImportTest.java | 570 -----------------
.../SalesOrderProcessingMappingModels.xml | 2 +-
.../SalesOrderProcessingExtension.java | 4 +-
.../ref/web/JPAReferenceServiceFactory.java | 8 +-
.../webapp/SalesOrderProcessingMappingModel.xml | 2 +-
352 files changed, 29407 insertions(+), 29356 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index d0c8e0b..1c69c7a 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -58,11 +58,11 @@
<configuration>
<instructions>
<Import-Package>
- org.apache.olingo.odata2.processor.core.jpa.factory;resolution:=optional,
+ org.apache.olingo.odata2.jpa.processor.core.factory;resolution:=optional,
*
</Import-Package>
<Export-Package>
- org.apache.olingo.odata2.processor.api.*;version=${project.version}
+ org.apache.olingo.odata2.jpa.processor.api.*;version=${project.version}
</Export-Package>
<Bundle-DocURL>${project.url}</Bundle-DocURL>
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java
new file mode 100644
index 0000000..f1e529c
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAContext.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.processor.ODataProcessor;
+import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmExtension;
+
+/**
+ * This class does the compilation of context objects required for OData JPA
+ * Runtime. The context object should be properly initialized with values else
+ * the behavior of processor and EDM provider can result in exception.
+ *
+ * Following are the mandatory parameter to be set into the context object
+ * <ol>
+ * <li>Persistence Unit Name</li>
+ * <li>An instance of Java Persistence Entity Manager Factory</li>
+ * </ol>
+ *
+ * <br>
+ * @org.apache.olingo.odata2.DoNotImplement
+ * @see org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAFactory
+ * @see org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAAccessFactory
+ *
+ */
+public interface ODataJPAContext {
+
+ /**
+ * The method gets the Java Persistence Unit Name set into the context.
+ *
+ * @return Java Persistence Unit Name
+ */
+ public String getPersistenceUnitName();
+
+ /**
+ * The method sets the Java Persistence Unit Name into the context.
+ *
+ * @param pUnitName
+ * is the Java Persistence Unit Name.
+ *
+ */
+ public void setPersistenceUnitName(String pUnitName);
+
+ /**
+ * The method gets the OData Processor for JPA from the context.
+ *
+ * @return OData JPA Processor
+ */
+ public ODataProcessor getODataProcessor();
+
+ /**
+ * The method sets the OData Processor for JPA into the context.
+ *
+ * @param processor
+ * is the specific implementation of {@link org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor} for
+ * processing OData service requests.
+ */
+ public void setODataProcessor(ODataProcessor processor);
+
+ /**
+ * The method gets the EDM provider for JPA from the context.
+ *
+ * @return EDM provider
+ */
+ public EdmProvider getEdmProvider();
+
+ /**
+ * The method sets EDM provider into the context
+ *
+ * @param edmProvider
+ * is the specific implementation of {@link org.apache.olingo.odata2.api.edm.provider.EdmProvider} for
+ * transforming Java persistence models to Entity Data Model
+ *
+ */
+ public void setEdmProvider(EdmProvider edmProvider);
+
+ /**
+ * The method gets the Java Persistence Entity Manager factory from the
+ * context. <br>
+ * <b>CAUTION:-</b> Don't use the Entity Manager Factory to instantiate
+ * Entity Managers. Instead get reference to Entity Manager using
+ * {@link org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext#getEntityManager()}
+ *
+ * @return an instance of Java Persistence Entity Manager Factory
+ */
+ public EntityManagerFactory getEntityManagerFactory();
+
+ /**
+ * The method sets the Java Persistence Entity Manager factory into the
+ * context.
+ *
+ * @param emf
+ * is of type {@link javax.persistence.EntityManagerFactory}
+ *
+ */
+ public void setEntityManagerFactory(EntityManagerFactory emf);
+
+ /**
+ * The method gets OData Context into the context.
+ *
+ * @return OData Context
+ */
+ public ODataContext getODataContext();
+
+ /**
+ * The method sets OData context into the context.
+ *
+ * @param ctx
+ * is an OData context of type {@link org.apache.olingo.odata2.api.processor.ODataContext}
+ */
+ public void setODataContext(ODataContext ctx);
+
+ /**
+ * The method sets the JPA EDM mapping model name into the context. JPA EDM
+ * mapping model is an XML document based on JPAEDMMappingModel.xsd
+ *
+ * @param name
+ * is the name of JPA EDM mapping model
+ */
+ public void setJPAEdmMappingModel(String name);
+
+ /**
+ * The method gets the JPA EDM mapping model name from the context.
+ *
+ * @return name of JPA EDM mapping model
+ */
+ public String getJPAEdmMappingModel();
+
+ /**
+ * The method returns an instance of type entity manager. The entity manager
+ * thus returns a single persistence context for the current OData request.
+ * Hence all entities that are accessed within JPA processor are managed by
+ * single entity manager.
+ *
+ * @return an instance of type {@link javax.persistence.EntityManager}
+ */
+ public EntityManager getEntityManager();
+
+ /**
+ * The method sets the JPA Edm Extension instance into the context. There
+ * can be at most only one extension for a context. Invoking the method
+ * several times overwrites already set extension instance in the context.
+ *
+ * @param jpaEdmExtension
+ * is an instance of type {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmExtension}
+ *
+ */
+ public void setJPAEdmExtension(JPAEdmExtension jpaEdmExtension);
+
+ /**
+ * The method returns the JPA Edm Extension instance set into the context.
+ *
+ * @return an instance of type
+ * {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEmbeddableTypeMapType}
+ */
+ public JPAEdmExtension getJPAEdmExtension();
+
+ /**
+ * The method sets into the context whether the library should consider default naming for
+ * <ul><li>EdmProperty</li>
+ * <li>EdmComplexProperty</li>
+ * <li>EdmNavigationProperty</li></ul>
+ *
+ * @param defaultNaming is a boolean value that indicates if set to
+ * <ul><li>true - default naming is considered in case no mapping is provided.</li>
+ * <li>false - default naming is not considered in case no mapping is provided. The
+ * name provided in JPA Entity Model is considered.</li>
+ * </ul>
+ */
+ public void setDefaultNaming(boolean defaultNaming);
+
+ /**
+ * The method returns whether the library should consider default naming for
+ * <ul><li>EdmProperty</li>
+ * <li>EdmComplexProperty</li>
+ * <li>EdmNavigationProperty</li></ul>
+ *
+ * @return
+ * <ul><li>true - default naming is considered in case no mapping is provided.</li>
+ * <li>false - default naming is not considered in case no mapping is provided. The
+ * name provided in JPA Entity Model is considered.</li>
+ * </ul>
+ */
+ public boolean getDefaultNaming();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java
new file mode 100644
index 0000000..4ce0f19
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api;
+
+import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
+import org.apache.olingo.odata2.jpa.processor.api.access.JPAProcessor;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAException;
+import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAFactory;
+
+/**
+ * Extend this class and implement an OData JPA processor if the default
+ * behavior of OData JPA Processor library has to be overwritten.
+ *
+ *
+ *
+ *
+ */
+public abstract class ODataJPAProcessor extends ODataSingleProcessor {
+
+ /**
+ * An instance of {@link org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext} object
+ */
+ protected ODataJPAContext oDataJPAContext;
+
+ /**
+ * An instance of {@link org.apache.olingo.odata2.jpa.processor.api.access.JPAProcessor}. The
+ * instance is created using {@link org.apache.olingo.odata2.jpa.processor.api.factory.JPAAccessFactory}.
+ */
+ protected JPAProcessor jpaProcessor;
+
+ public ODataJPAContext getOdataJPAContext() {
+ return oDataJPAContext;
+ }
+
+ public void setOdataJPAContext(final ODataJPAContext odataJPAContext) {
+ oDataJPAContext = odataJPAContext;
+ }
+
+ /**
+ * Constructor
+ *
+ * @param oDataJPAContext
+ * non null OData JPA Context object
+ */
+ public ODataJPAProcessor(final ODataJPAContext oDataJPAContext) {
+ if (oDataJPAContext == null) {
+ throw new IllegalArgumentException(ODataJPAException.ODATA_JPACTX_NULL);
+ }
+ this.oDataJPAContext = oDataJPAContext;
+ jpaProcessor = ODataJPAFactory.createFactory().getJPAAccessFactory().getJPAProcessor(this.oDataJPAContext);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
new file mode 100644
index 0000000..66d29f9
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api;
+
+import org.apache.olingo.odata2.api.ODataCallback;
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.ODataServiceFactory;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.processor.ODataErrorCallback;
+import org.apache.olingo.odata2.api.processor.ODataSingleProcessor;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAErrorCallback;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAAccessFactory;
+import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAFactory;
+
+/**
+ * <p>
+ * Extend this factory class and create own instance of {@link org.apache.olingo.odata2.api.ODataService} that
+ * transforms Java Persistence
+ * Models into an OData Service. The factory class instantiates instances of
+ * type {@link org.apache.olingo.odata2.api.edm.provider.EdmProvider} and
+ * {@link org.apache.olingo.odata2.api.processor.ODataSingleProcessor}. The OData
+ * JPA Processor library provides a default implementation for EdmProvider and
+ * OData Single Processor.
+ * </p>
+ * <p>
+ * The factory implementation is passed as servlet init parameter to a JAX-RS
+ * runtime which will instantiate a {@link org.apache.olingo.odata2.api.ODataService} implementation using this factory.
+ * </p>
+ *
+ * <p>
+ * <b>Mandatory:</b> Implement the abstract method initializeODataJPAContext. Fill
+ * {@link org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext} with context
+ * values.
+ * </p>
+ *
+ * <b>Sample Configuration:</b>
+ *
+ * <pre> {@code
+ * <servlet>
+ * <servlet-name>ReferenceScenarioServlet</servlet-name>
+ * <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
+ * <init-param>
+ * <param-name>javax.ws.rs.Application</param-name>
+ * <param-value>org.apache.olingo.odata2.core.rest.ODataApplication</param-value>
+ * </init-param>
+ * <init-param>
+ * <param-name>org.apache.olingo.odata2.processor.factory</param-name>
+ * <param-value>foo.bar.sample.processor.SampleProcessorFactory</param-value>
+ * </init-param>
+ * <init-param>
+ * <param-name>org.apache.olingo.odata2.path.split</param-name>
+ * <param-value>2</param-value>
+ * </init-param>
+ * <load-on-startup>1</load-on-startup>
+ * </servlet>
+ * } </pre>
+ */
+
+public abstract class ODataJPAServiceFactory extends ODataServiceFactory {
+
+ private ODataJPAContext oDataJPAContext;
+ private ODataContext oDataContext;
+ private boolean setDetailErrors = false;
+
+ /**
+ * Creates an OData Service based on the values set in
+ * {@link org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext} and
+ * {@link org.apache.olingo.odata2.api.processor.ODataContext}.
+ */
+ @Override
+ public final ODataService createService(final ODataContext ctx) throws ODataException {
+
+ oDataContext = ctx;
+
+ // Initialize OData JPA Context
+ oDataJPAContext = initializeODataJPAContext();
+
+ validatePreConditions();
+
+ ODataJPAFactory factory = ODataJPAFactory.createFactory();
+ ODataJPAAccessFactory accessFactory = factory.getODataJPAAccessFactory();
+
+ // OData JPA Processor
+ if (oDataJPAContext.getODataContext() == null) {
+ oDataJPAContext.setODataContext(ctx);
+ }
+
+ ODataSingleProcessor odataJPAProcessor = accessFactory.createODataProcessor(oDataJPAContext);
+
+ // OData Entity Data Model Provider based on JPA
+ EdmProvider edmProvider = accessFactory.createJPAEdmProvider(oDataJPAContext);
+
+ return createODataSingleProcessorService(edmProvider, odataJPAProcessor);
+ }
+
+ private void validatePreConditions() throws ODataJPARuntimeException {
+
+ if (oDataJPAContext.getEntityManagerFactory() == null) {
+ throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ENTITY_MANAGER_NOT_INITIALIZED, null);
+ }
+
+ }
+
+ /**
+ * Implement this method and initialize OData JPA Context. It is mandatory
+ * to set an instance of type {@link javax.persistence.EntityManagerFactory} into the context. An exception of type
+ * {@link org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException} is thrown if
+ * EntityManagerFactory is not initialized. <br>
+ * <br>
+ * <b>Sample Code:</b> <code>
+ * <p>public class JPAReferenceServiceFactory extends ODataJPAServiceFactory{</p>
+ *
+ * <blockquote>private static final String PUNIT_NAME = "punit";
+ * <br>
+ * public ODataJPAContext initializeODataJPAContext() {
+ * <blockquote>ODataJPAContext oDataJPAContext = this.getODataJPAContext();
+ * <br>
+ * EntityManagerFactory emf = Persistence.createEntityManagerFactory(PUNIT_NAME);
+ * <br>
+ * oDataJPAContext.setEntityManagerFactory(emf);
+ * oDataJPAContext.setPersistenceUnitName(PUNIT_NAME);
+ * <br> return oDataJPAContext;</blockquote>
+ * }</blockquote>
+ * } </code>
+ * <p>
+ *
+ * @return an instance of type {@link org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext}
+ * @throws ODataJPARuntimeException
+ */
+ public abstract ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException;
+
+ /**
+ * @return an instance of type {@link ODataJPAContext}
+ * @throws ODataJPARuntimeException
+ */
+ public final ODataJPAContext getODataJPAContext() throws ODataJPARuntimeException {
+ if (oDataJPAContext == null) {
+ oDataJPAContext = ODataJPAFactory.createFactory().getODataJPAAccessFactory().createODataJPAContext();
+ }
+ if (oDataContext != null) {
+ oDataJPAContext.setODataContext(oDataContext);
+ }
+ return oDataJPAContext;
+
+ }
+
+ /**
+ * The method sets the context whether a detail error message should be thrown
+ * or a less detail error message should be thrown by the library.
+ * @param setDetailErrors takes
+ * <ul><li>true - to indicate that library should throw a detailed error message</li>
+ * <li>false - to indicate that library should not throw a detailed error message</li>
+ * </ul>
+ *
+ */
+ protected void setDetailErrors(final boolean setDetailErrors) {
+ this.setDetailErrors = setDetailErrors;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T extends ODataCallback> T getCallback(final Class<? extends ODataCallback> callbackInterface) {
+ if (setDetailErrors == true) {
+ if (callbackInterface.isAssignableFrom(ODataErrorCallback.class)) {
+ return (T) new ODataJPAErrorCallback();
+ }
+ }
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmBuilder.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmBuilder.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmBuilder.java
new file mode 100644
index 0000000..01b9d9f
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmBuilder.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+
+/**
+ * JPAEdmBuilder interface provides methods for building elements of an Entity Data Model (EDM) from
+ * a Java Persistence Model.
+ *
+ *
+ *
+ */
+public interface JPAEdmBuilder {
+ /**
+ * The Method builds EDM Elements by transforming JPA MetaModel. The method
+ * processes EDM JPA Containers which could be accessed using the following
+ * views,
+ * <ul>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmAssociationSetView} </li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmAssociationView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmBaseView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmComplexPropertyView} </li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmComplexTypeView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntityContainerView} </li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntitySetView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntityTypeView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmKeyView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmModelView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmNavigationPropertyView} </li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmPropertyView}</li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmReferentialConstraintRoleView} </li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmReferentialConstraintView} </li>
+ * <li> {@link org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmSchemaView}</li>
+ * </ul>
+ *
+ * @throws ODataJPARuntimeException
+ **/
+ public void build() throws ODataJPAModelException, ODataJPARuntimeException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmMappingModelAccess.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmMappingModelAccess.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmMappingModelAccess.java
new file mode 100644
index 0000000..f4420dc
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAEdmMappingModelAccess.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+import org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel;
+
+/**
+ * Interface provides methods to access JPA EDM mapping model.
+ *
+ *
+ * @see JPAEdmMappingModel
+ *
+ */
+public interface JPAEdmMappingModelAccess {
+
+ /**
+ * The method searches and loads the mapping model stored in <file>.xml
+ * file into the java object {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel} . The
+ * name of the file is set into ODataJPAContext method.
+ *
+ * @see org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext#setJPAEdmMappingModel(String)
+ */
+ public void loadMappingModel();
+
+ /**
+ * The method returns if there exists a mapping model.
+ *
+ * @return true - if there exists a mapping model for the OData service else
+ * false
+ */
+ public boolean isMappingModelExists();
+
+ /**
+ * The method returns a JPA EDM mapping model Java object. The mapping model
+ * in XML files is un-marshaled into the Java object.
+ *
+ * @return an instance of type {@link org.apache.olingo.odata2.jpa.processor.api.model.mapping.JPAEdmMappingModel}
+ */
+ public JPAEdmMappingModel getJPAEdmMappingModel();
+
+ /**
+ * The method returns EDM Schema namespace for the persistence unit name
+ *
+ * @param persistenceUnitName
+ * is the Java persistence unit name
+ * @return EDM schema name space mapped to Java persistence unit name or
+ * null if no mapping is available
+ */
+ public String mapJPAPersistenceUnit(String persistenceUnitName);
+
+ /**
+ * The method returns EDM entity type name for the Java persistence entity
+ * type name
+ *
+ * @param jpaEntityTypeName
+ * is the Java persistence entity type name
+ * @return EDM entity type name mapped to Java persistence entity type name
+ * or null if no mapping is available
+ */
+ public String mapJPAEntityType(String jpaEntityTypeName);
+
+ /**
+ * The method returns EDM entity set name for the Java persistence entity
+ * type name
+ *
+ * @param jpaEntityTypeName
+ * is the Java persistence entity type name
+ * @return EDM entity set name mapped to Java persistence entity type name
+ * or null if no mapping is available
+ */
+ public String mapJPAEntitySet(String jpaEntityTypeName);
+
+ /**
+ * The method returns EDM property name for the Java persistence entity
+ * attribute name.
+ *
+ * @param jpaEntityTypeName
+ * is the Java persistence entity type name
+ * @param jpaAttributeName
+ * is the Java persistence attribute name
+ * @return EDM property name mapped to Java persistence attribute name or
+ * null if no mapping is available
+ */
+ public String mapJPAAttribute(String jpaEntityTypeName, String jpaAttributeName);
+
+ /**
+ * The method returns EDM navigation property name for the Java persistence
+ * entity relationship name.
+ *
+ * @param jpaEntityTypeName
+ * is the Java persistence entity type name
+ * @param jpaRelationshipName
+ * is the Java persistence relationship name
+ * @return EDM navigation property name mapped to Java persistence entity
+ * relationship name or null if no mapping is available
+ */
+ public String mapJPARelationship(String jpaEntityTypeName, String jpaRelationshipName);
+
+ /**
+ * The method returns EDM complex type name for the Java embeddable type
+ * name.
+ *
+ * @param jpaEmbeddableTypeName
+ * is the Java persistence embeddable type name
+ * @return EDM complex type name mapped to Java persistence entity
+ * relationship name or null if no mapping is available
+ */
+ public String mapJPAEmbeddableType(String jpaEmbeddableTypeName);
+
+ /**
+ * The method returns EDM property name for the Java persistence embeddable
+ * type's attribute name.
+ *
+ * @param jpaEmbeddableTypeName
+ * is the Java persistence
+ * @param jpaAttributeName
+ * is the Java persistence attribute name
+ * @return EDM property name mapped to Java persistence attribute name or
+ * null if no mapping is available
+ */
+ public String mapJPAEmbeddableTypeAttribute(String jpaEmbeddableTypeName, String jpaAttributeName);
+
+ /**
+ * The method returns whether the JPA Entity should be excluded from EDM
+ * model
+ *
+ * @param jpaEntityTypeName
+ * is the name of JPA Entity Type
+ * @return <b>true</b> - if JPA Entity should be excluded<br>
+ * <b>false</b> - if JPA Entity should be not be excluded
+ *
+ */
+ public boolean checkExclusionOfJPAEntityType(String jpaEntityTypeName);
+
+ /**
+ * The method returns whether the JPA Attribute should be excluded from EDM
+ * Entity Type
+ *
+ * @param jpaEntityTypeName
+ * is the name of JPA Entity Type
+ * @param jpaAttributeName
+ * is the name of JPA attribute
+ * @return <b>true</b> - if JPA attribute should be excluded<br>
+ * <b>false</b> - if JPA attribute should be not be excluded
+ *
+ */
+ public boolean checkExclusionOfJPAAttributeType(String jpaEntityTypeName, String jpaAttributeName);
+
+ /**
+ * The method returns whether the JPA Embeddable Type should be excluded
+ * from EDM model
+ *
+ * @param jpaEmbeddableTypeName
+ * is the name of JPA Embeddable Type
+ * @return <b>true</b> - if JPA Embeddable Type should be excluded<br>
+ * <b>false</b> - if JPA Embeddable Type should be not be excluded
+ *
+ */
+ public boolean checkExclusionOfJPAEmbeddableType(String jpaEmbeddableTypeName);
+
+ /**
+ * The method returns whether the JPA Embeddable Attribute Type should be
+ * excluded from EDM model
+ *
+ * @param jpaEmbeddableTypeName
+ * is the name of JPA Embeddable Attribute Type
+ * @param jpaAttributeName
+ * is the name of JPA Attribute name
+ * @return <b>true</b> - if JPA Embeddable Attribute Type should be excluded<br>
+ * <b>false</b> - if JPA Embeddable Attribute Type should be not be
+ * excluded
+ *
+ */
+ public boolean checkExclusionOfJPAEmbeddableAttributeType(String jpaEmbeddableTypeName, String jpaAttributeName);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAFunction.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAFunction.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAFunction.java
new file mode 100644
index 0000000..a380e33
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAFunction.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+
+/**
+ * A container for JPA Functions. A JPA function can be
+ * <ol>
+ * <li>Property Access method</li>
+ * <li>Custom Operation (Annotated with EDM Annotation FunctionImport)</li>
+ * </ol>
+ *
+ *
+ *
+ */
+public class JPAFunction {
+
+ private Method function;
+ private Class<?>[] parameterTypes;
+ private Type returnType;
+ private Object[] args;
+
+ public JPAFunction(final Method function, final Class<?>[] parameterTypes, final Type returnType,
+ final Object[] args) {
+ this.function = function;
+ this.parameterTypes = parameterTypes;
+ this.returnType = returnType;
+ this.args = args;
+ }
+
+ /**
+ * The method returns the Java method.
+ *
+ * @return an instance of {@link java.lang.reflect.Method}
+ */
+ public Method getFunction() {
+ return function;
+ }
+
+ /**
+ * The method returns the parameter types for the Java method.
+ *
+ * @return an array of type {@link java.lang.Class}
+ */
+ public Class<?>[] getParameterTypes() {
+ return parameterTypes;
+ }
+
+ /**
+ * The method returns the return type for the Java method.
+ *
+ * @return an instance of {@link java.lang.reflect.Type}
+ */
+ public Type getReturnType() {
+ return returnType;
+ }
+
+ /**
+ * The method returns an array of arguments for invoking the Java method.
+ *
+ * @return an array of Objects
+ */
+ public Object[] getArguments() {
+ return args;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAJoinClause.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAJoinClause.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAJoinClause.java
new file mode 100644
index 0000000..007c508
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAJoinClause.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+/**
+ * A container for Java Persistence Join Clause that can be used for building
+ * JPQL statements. The container has two main elements <b>
+ * <ol>
+ * <li>Java Persistence Entity -</li> is the source entity participating in the
+ * join. <br>
+ * <li>Java Persistence Entity Relationship -</li> is the entity relationship of
+ * the source entity participating in the join.
+ * </ol>
+ * </b>
+ *
+ *
+ *
+ */
+public class JPAJoinClause {
+
+ /**
+ * Enumerated list of possible Joins in JPQL
+ * <ol>
+ * <li>LEFT - left outer join</li>
+ * <li>FETCH - enable fetching of an association as a side effect of the
+ * execution of a query</li>
+ * <li>INNER - inner join
+ * </ol>
+ *
+ *
+ *
+ */
+ public enum JOIN {
+ LEFT, FETCH, INNER
+ }
+
+ private String entityName;
+ private String entityAlias;
+ private String entityRelationShip;
+ private String entityRelationShipAlias;
+ private JOIN joinType;
+ private String joinCondition;
+
+ /**
+ * The method returns Java Persistence Entity participating in the join.
+ *
+ * @return an entity name
+ */
+ public String getEntityName() {
+ return entityName;
+ }
+
+ /**
+ * The method returns Java Persistence Entity alias name participating in
+ * the join.
+ *
+ * @return a entity alias name
+ */
+ public String getEntityAlias() {
+ return entityAlias;
+ }
+
+ /**
+ * The method returns Java Persistence Entity Relationship name
+ * participating in the join.
+ *
+ * @return entity alias relationship
+ */
+ public String getEntityRelationShip() {
+ return entityRelationShip;
+ }
+
+ /**
+ * The method returns Java Persistence Entity Relationship Alias name
+ * participating in the join.
+ *
+ * @return entity entity relationship alias
+ */
+ public String getEntityRelationShipAlias() {
+ return entityRelationShipAlias;
+ }
+
+ /**
+ * Constructor for creating elements of JPA Join Clause container.
+ *
+ * @param entityName
+ * is the name of the JPA entity participating in the join
+ * @param entityAlias
+ * is the alias for the JPA entity participating in the join
+ * @param entityRelationShip
+ * is the name of the JPA entity relationship participating in
+ * the join
+ * @param entityRelationShipAlias
+ * is the alias name of the JPA entity relationship participating
+ * in the join
+ * @param joinCondition
+ * is the condition on which the joins should occur
+ * @param joinType
+ * is the type of join {@link org.apache.olingo.odata2.jpa.processor.api.access.JPAJoinClause.JOIN} to execute
+ */
+ public JPAJoinClause(final String entityName, final String entityAlias, final String entityRelationShip,
+ final String entityRelationShipAlias, final String joinCondition, final JOIN joinType) {
+
+ this.entityName = entityName;
+ this.entityAlias = entityAlias;
+ this.entityRelationShip = entityRelationShip;
+ this.entityRelationShipAlias = entityRelationShipAlias;
+ this.joinCondition = joinCondition;
+ this.joinType = joinType;
+ }
+
+ /**
+ * The method returns a join condition that can be used for building JPQL
+ * join statements.
+ *
+ * @return a join condition
+ */
+ public String getJoinCondition() {
+ return joinCondition;
+ }
+
+ /**
+ * The method returns the type of {@link org.apache.olingo.odata2.jpa.processor.api.access.JPAJoinClause.JOIN} that
+ * can be used for building JPQL join statements.
+ *
+ * @return join type
+ */
+ public JOIN getJoinType() {
+ return joinType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContext.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContext.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContext.java
new file mode 100644
index 0000000..9ad7c8c
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContext.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAFactory;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
+
+/**
+ * The abstract class is a compilation of objects required for building specific
+ * instances of JPA Method Context. Extend this class to implement specific
+ * implementations of JPQL context types (Create,Update,Function). A JPA method
+ * Context is constructed from an OData request. Depending on OData
+ * CUD/FunctionImport operation performed on an Entity, a corresponding JPA
+ * method context object is built. The object thus built can be used for
+ * executing operations on JPA Entity/Custom processor objects. <br>
+ * A default implementation is provided by the library.
+ *
+ *
+ * @see org.apache.olingo.odata2.jpa.processor.api.access.JPAMethodContextView
+ * @see org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType
+ *
+ */
+
+public abstract class JPAMethodContext implements JPAMethodContextView {
+
+ protected Object enclosingObject;
+ protected ArrayList<JPAFunction> jpaFunction;
+
+ @Override
+ /**
+ * The method returns list of JPA functions that can be executed on the
+ * enclosing object.
+ *
+ * @return an instance of list of JPA Function
+ */
+ public Object getEnclosingObject() {
+ return enclosingObject;
+ }
+
+ @Override
+ /**
+ * The method returns list of JPA functions that can be executed on the
+ * enclosing object.
+ *
+ * @return an instance of list of JPA Function
+ */
+ public List<JPAFunction> getJPAFunctionList() {
+ return jpaFunction;
+ }
+
+ protected void setEnclosingObject(final Object enclosingObject) {
+ this.enclosingObject = enclosingObject;
+ }
+
+ protected void setJpaFunction(final List<JPAFunction> jpaFunctionList) {
+ jpaFunction = (ArrayList<JPAFunction>) jpaFunctionList;
+ }
+
+ /**
+ * the method instantiates an instance of type JPAMethodContextBuilder.
+ *
+ * @param contextType
+ * indicates the type of JPQLContextBuilder to instantiate.
+ * @param resultsView
+ * is the OData request view
+ * @return {@link org.apache.olingo.odata2.jpa.processor.api.access.JPAMethodContext.JPAMethodContextBuilder}
+ *
+ * @throws ODataJPARuntimeException
+ */
+ public final static JPAMethodContextBuilder
+ createBuilder(final JPQLContextType contextType, final Object resultsView) throws ODataJPARuntimeException {
+ return JPAMethodContextBuilder.create(contextType, resultsView);
+ }
+
+ /**
+ * The abstract class is extended by specific JPA Method Context Builder to
+ * build JPA Method Context types.
+ *
+ *
+ *
+ */
+ public static abstract class JPAMethodContextBuilder {
+
+ /**
+ * Implement this method to build JPAMethodContext
+ *
+ * @return an instance of type JPAMethodContext
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public abstract JPAMethodContext build() throws ODataJPAModelException, ODataJPARuntimeException;
+
+ protected JPAMethodContextBuilder() {}
+
+ private static JPAMethodContextBuilder create(final JPQLContextType contextType, final Object resultsView)
+ throws ODataJPARuntimeException {
+ JPAMethodContextBuilder contextBuilder =
+ ODataJPAFactory.createFactory().getJPQLBuilderFactory().getJPAMethodContextBuilder(contextType);
+
+ if (contextBuilder == null) {
+ throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.ERROR_JPQLCTXBLDR_CREATE, null);
+ }
+ contextBuilder.setResultsView(resultsView);
+ return contextBuilder;
+ }
+
+ protected abstract void setResultsView(Object resultsView);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContextView.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContextView.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContextView.java
new file mode 100644
index 0000000..dc9a86d
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAMethodContextView.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+import java.util.List;
+
+/**
+ * The interface provides view on JPA Method Context. JPA Method context can be
+ * used to access custom operations or JPA Entity property access methods.
+ *
+ *
+ *
+ */
+public interface JPAMethodContextView {
+ /**
+ * The method returns an instance of Object on which the methods/custom
+ * operations can be executed.
+ *
+ * @return instance of enclosing object for the method
+ */
+ public Object getEnclosingObject();
+
+ /**
+ * The method returns list of JPA functions that can be executed on the
+ * enclosing object.
+ *
+ * @return an instance of list of JPA Function
+ */
+ public List<JPAFunction> getJPAFunctionList();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAProcessor.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAProcessor.java
new file mode 100644
index 0000000..4b063cc
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/JPAProcessor.java
@@ -0,0 +1,260 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.uri.info.DeleteUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityCountUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityLinkUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetCountUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetLinksUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetFunctionImportUriInfo;
+import org.apache.olingo.odata2.api.uri.info.PostUriInfo;
+import org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+
+/**
+ * The interface provides methods for processing OData Requests for Create, Read, Update, Delete operations.
+ * Pass the OData request or parsed OData request (Map of properties) as request.
+ * A JPA entity is returned as a response.
+ *
+ */
+public interface JPAProcessor {
+ /**
+ * Processes OData request for querying an Entity Set. The method returns
+ * list of Objects of type representing JPA Entity Types.
+ *
+ * @param <T>
+ * Template parameter representing Java Persistence Entity Type.
+ * <p>
+ * <b>Note:-</b> Default parameter is Object.
+ * </p>
+ *
+ * @param requestView
+ * is an OData request for querying an entity set
+ * <p>
+ * @return list of objects representing JPA entity types
+ **/
+ public <T> List<T> process(GetEntitySetUriInfo requestView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for reading an Entity. The method returns an
+ * Object of type representing JPA Entity Type.
+ *
+ * @param <T>
+ * Template parameter representing Java Persistence Entity Type.
+ * <p>
+ * <b>Note:-</b> Default parameter is Object.
+ * </p>
+ *
+ * @param requestView
+ * OData request for reading an entity
+ *
+ * <p>
+ * @return object representing JPA entity type
+ **/
+ public <T> Object process(GetEntityUriInfo requestView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for fetching Entity count. The method returns JPA Entity count
+ *
+ * @param requestView
+ * OData request for counting an entity set
+ * @return long value representing count of JPA entity set
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+
+ public long process(GetEntitySetCountUriInfo requestView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for fetching Entity count. The method returns count of target entity.
+ * This is specific to situation where cardinality is 1:1
+ *
+ * @param resultsView
+ * OData request for counting target entity.
+ * @return long value representing count of JPA entity
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public long process(GetEntityCountUriInfo resultsView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for executing custom operations. The method
+ * returns a List of Object. The list contains one entry if the the custom
+ * operations return type has multiplicity of ONE.
+ *
+ * @param requestView
+ * OData request for executing function import
+ * @return result of executing function import
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public List<Object> process(GetFunctionImportUriInfo requestView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for executing $links OData command for N:1 relation.
+ * The method returns an Object of type representing OData entity.
+ *
+ * @param uriParserResultView
+ * OData request for Entity Link URI
+ * @return an object representing JPA entity
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public Object process(GetEntityLinkUriInfo uriParserResultView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for executing $links OData command for N:1 relation.
+ * The method returns an Object of type representing OData entity.
+ *
+ * @param uriParserResultView
+ * OData request for Entity Set Link URI
+ * @return a list of object representing JPA entities
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public <T> List<T> process(GetEntitySetLinksUriInfo uriParserResultView)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for creating Entity. The method returns an Object
+ * which is created. A Null reference implies object was not created.
+ *
+ * @param createView
+ * @param content
+ * @param requestContentType
+ * @return Created Object
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+
+ public <T> List<T> process(PostUriInfo createView, InputStream content,
+ String requestContentType) throws ODataJPAModelException,
+ ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for creating Entity. The method expects a parsed OData request which is a Map of
+ * properties.
+ * The method returns an Object that is created. A Null reference implies object was not created.
+ *
+ * @param createView
+ * @param content
+ * @return Created Object
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+
+ public <T> List<T> process(PostUriInfo createView, Map<String, Object> content) throws ODataJPAModelException,
+ ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for updating Entity. The method returns an Object
+ * which is updated. A Null reference implies object was not created.
+ *
+ * @param updateView
+ * @param content
+ * @param requestContentType
+ * @return Deleted Object
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public <T> Object process(PutMergePatchUriInfo updateView,
+ InputStream content, String requestContentType)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for updating Entity. The method returns an Object
+ * which is updated. A Null reference implies object was not created.
+ *
+ * @param updateView
+ * @param content
+ * @return Deleted Object
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public <T> Object process(PutMergePatchUriInfo updateView, Map<String, Object> content)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Processes OData request for deleting Entity. The method returns an Object
+ * which is deleted. A Null reference implies object was not created.
+ *
+ * @param deleteuriInfo
+ * @param contentType
+ * @return Deleted Object
+ *
+ * @throws ODataJPAModelException
+ * @throws ODataJPARuntimeException
+ */
+ public Object process(DeleteUriInfo deleteuriInfo, String contentType)
+ throws ODataJPAModelException, ODataJPARuntimeException;
+
+ /**
+ * Process OData request for creating Links. The OData request should contain
+ * $links OData command.
+ *
+ * @param uriParserResultView
+ * OData request for creating Links
+ * @param content
+ * @param requestContentType
+ * @param contentType
+ *
+ * @throws ODataJPARuntimeException
+ * @throws ODataJPAModelException
+ */
+ public void process(PostUriInfo uriParserResultView,
+ InputStream content, String requestContentType, String contentType)
+ throws ODataJPARuntimeException, ODataJPAModelException;
+
+ /**
+ * Process OData request for updating Links. The OData request should contain
+ * $links OData command.
+ *
+ * @param uriParserResultView
+ * OData request for updating Links
+ * @param content
+ * @param requestContentType
+ * @param contentType
+ *
+ * @throws ODataJPARuntimeException
+ * @throws ODataJPAModelException
+ */
+ public void process(PutMergePatchUriInfo uriParserResultView,
+ InputStream content, String requestContentType, String contentType)
+ throws ODataJPARuntimeException, ODataJPAModelException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/package-info.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/package-info.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/package-info.java
new file mode 100644
index 0000000..d24f7a8
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/access/package-info.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+/**
+ * <h3>OData JPA Processor API Library - Java Persistence Access</h3>
+ * The library provides a set of APIs to access Java Persistence Models and Data.
+ *
+ *
+ */
+package org.apache.olingo.odata2.jpa.processor.api.access;
+
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/63b621a8/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPAErrorCallback.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPAErrorCallback.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPAErrorCallback.java
new file mode 100644
index 0000000..6d7e737
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPAErrorCallback.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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 ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.api.exception;
+
+import org.apache.olingo.odata2.api.ep.EntityProvider;
+import org.apache.olingo.odata2.api.exception.ODataApplicationException;
+import org.apache.olingo.odata2.api.processor.ODataErrorCallback;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+
+public class ODataJPAErrorCallback implements ODataErrorCallback {
+
+ @Override
+ public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
+
+ final String SEPARATOR = " : ";
+
+ Throwable t = context.getException();
+ if (t instanceof ODataJPAException) {
+ StringBuilder errorBuilder = new StringBuilder();
+ errorBuilder.append(t.getCause().getClass().toString());
+ errorBuilder.append(SEPARATOR);
+ errorBuilder.append(t.getCause().getMessage());
+ context.setInnerError(errorBuilder.toString());
+ }
+ return EntityProvider.writeErrorDocument(context);
+ }
+
+}