You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by fm...@apache.org on 2014/07/16 11:27:06 UTC

[43/58] [abbrv] git commit: Providing some refactoring in order to avoid multi-request retrieving entity info

Providing some refactoring in order to avoid multi-request retrieving entity info


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/6587302a
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/6587302a
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/6587302a

Branch: refs/heads/master
Commit: 6587302a9ff85dc19368613e9d1f823afbd58ba5
Parents: 136f334
Author: fmartelli <fa...@gmail.com>
Authored: Sat Jul 12 16:09:13 2014 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Sat Jul 12 16:09:13 2014 +0200

----------------------------------------------------------------------
 .../olingo/ext/proxy/api/AbstractOpenType.java  |    3 +-
 .../olingo/ext/proxy/api/CollectionQuery.java   |   30 +
 .../olingo/ext/proxy/api/SingleQuery.java       |   28 +
 .../olingo/ext/proxy/api/StructuredType.java    |   25 +
 .../commons/AbstractInvocationHandler.java      |   10 +-
 .../AbstractStructuredInvocationHandler.java    |   14 +-
 .../proxy/commons/ComplexInvocationHandler.java |    5 +-
 .../proxy/commons/EntityInvocationHandler.java  |  109 +-
 .../commons/EntitySetInvocationHandler.java     |  105 +-
 .../commons/OperationInvocationHandler.java     |   65 +-
 .../olingo/ext/proxy/utils/ClassUtils.java      |   35 +-
 .../olingo/ext/proxy/utils/CoreUtils.java       |   19 +-
 .../src/main/resources/entitySet.vm             |    4 +-
 .../src/main/resources/entityType.vm            |   12 +-
 .../src/main/resources/v30/complexType.vm       |    7 +-
 .../src/main/resources/v40/complexType.vm       |    7 +-
 .../src/main/resources/v40/singleton.vm         |    2 +-
 .../apache/olingo/fit/V3ActionOverloading.java  |    4 +-
 .../java/org/apache/olingo/fit/V4Services.java  |  589 ++++-----
 .../apache/olingo/fit/utils/XMLUtilities.java   |    2 +-
 .../101/links/MyPaymentInstruments(101901).xml  |    1 +
 .../101/links/MyPaymentInstruments(101902).xml  |    1 +
 .../olingo/fit/proxy/v3/AbstractTestITCase.java |    2 +-
 .../olingo/fit/proxy/v3/AsyncTestITCase.java    |    2 +-
 .../olingo/fit/proxy/v3/ContextTestITCase.java  |   96 +-
 .../fit/proxy/v3/EntityCreateTestITCase.java    |   68 +-
 .../fit/proxy/v3/EntityRetrieveTestITCase.java  |   17 +-
 .../fit/proxy/v3/EntityUpdateTestITCase.java    |   15 +-
 .../olingo/fit/proxy/v3/InvokeTestITCase.java   |   21 +-
 .../fit/proxy/v3/MediaEntityTestITCase.java     |   18 +-
 .../olingo/fit/proxy/v3/OpenTypeTestITCase.java |   27 +-
 .../fit/proxy/v3/PrimitiveKeysTestITCase.java   |   34 +-
 .../AllGeoCollectionTypesSet.java               |   55 +-
 .../astoriadefaultservice/AllGeoTypesSet.java   |   51 +-
 .../services/astoriadefaultservice/Car.java     |   51 +-
 .../astoriadefaultservice/Computer.java         |   51 +-
 .../astoriadefaultservice/ComputerDetail.java   |   51 +-
 .../astoriadefaultservice/Customer.java         |   51 +-
 .../astoriadefaultservice/CustomerInfo.java     |   51 +-
 .../astoriadefaultservice/DefaultContainer.java |  211 ++--
 .../services/astoriadefaultservice/Driver.java  |   51 +-
 .../astoriadefaultservice/LastLogin.java        |   51 +-
 .../services/astoriadefaultservice/License.java |   51 +-
 .../services/astoriadefaultservice/Login.java   |   51 +-
 .../astoriadefaultservice/MappedEntityType.java |   51 +-
 .../services/astoriadefaultservice/Message.java |   52 +-
 .../MessageAttachment.java                      |   51 +-
 .../services/astoriadefaultservice/Order.java   |   51 +-
 .../astoriadefaultservice/OrderLine.java        |   68 +-
 .../astoriadefaultservice/PageView.java         |   55 +-
 .../services/astoriadefaultservice/Person.java  |   75 +-
 .../astoriadefaultservice/PersonMetadata.java   |   51 +-
 .../services/astoriadefaultservice/Product.java |   55 +-
 .../astoriadefaultservice/ProductDetail.java    |   51 +-
 .../astoriadefaultservice/ProductPhoto.java     |   52 +-
 .../astoriadefaultservice/ProductReview.java    |   52 +-
 .../astoriadefaultservice/RSAToken.java         |   51 +-
 .../astoriadefaultservice/package-info.java     |   16 +-
 .../astoriadefaultservice/types/Aliases.java    |   59 +-
 .../types/AllSpatialCollectionTypes.java        |  139 ++-
 .../AllSpatialCollectionTypesCollection.java    |   44 +-
 .../types/AllSpatialCollectionTypes_Simple.java |  442 ++++---
 ...SpatialCollectionTypes_SimpleCollection.java |   44 +-
 .../types/AllSpatialTypes.java                  |  985 ++++++++-------
 .../types/AllSpatialTypesCollection.java        |   44 +-
 .../astoriadefaultservice/types/AuditInfo.java  |   86 +-
 .../types/BackOrderLine.java                    |  459 ++++---
 .../types/BackOrderLine2.java                   |  459 ++++---
 .../types/BackOrderLine2Collection.java         |   44 +-
 .../types/BackOrderLineCollection.java          |   44 +-
 .../astoriadefaultservice/types/Car.java        |  305 +++--
 .../types/CarCollection.java                    |   44 +-
 .../types/ComplexToCategory.java                |   74 +-
 .../astoriadefaultservice/types/Computer.java   |  222 ++--
 .../types/ComputerCollection.java               |   44 +-
 .../types/ComputerDetail.java                   |  500 ++++----
 .../types/ComputerDetailCollection.java         |   44 +-
 .../types/ConcurrencyInfo.java                  |   67 +-
 .../types/ContactDetails.java                   |  144 ++-
 .../astoriadefaultservice/types/Contractor.java |  477 +++----
 .../types/ContractorCollection.java             |   44 +-
 .../astoriadefaultservice/types/Customer.java   |  648 +++++-----
 .../types/CustomerCollection.java               |   44 +-
 .../types/CustomerInfo.java                     |  199 +--
 .../types/CustomerInfoCollection.java           |   44 +-
 .../astoriadefaultservice/types/Dimensions.java |   74 +-
 .../types/DiscontinuedProduct.java              |  885 +++++++------
 .../types/DiscontinuedProductCollection.java    |   44 +-
 .../astoriadefaultservice/types/Driver.java     |  222 ++--
 .../types/DriverCollection.java                 |   44 +-
 .../astoriadefaultservice/types/Employee.java   |  468 +++----
 .../types/EmployeeCollection.java               |   58 +-
 .../astoriadefaultservice/types/LastLogin.java  |  328 ++---
 .../types/LastLoginCollection.java              |   44 +-
 .../astoriadefaultservice/types/License.java    |  381 +++---
 .../types/LicenseCollection.java                |   44 +-
 .../astoriadefaultservice/types/Login.java      |  346 +++---
 .../types/LoginCollection.java                  |   44 +-
 .../types/MappedEntityType.java                 | 1173 +++++++++---------
 .../types/MappedEntityTypeCollection.java       |   44 +-
 .../astoriadefaultservice/types/Message.java    |  548 ++++----
 .../types/MessageAttachment.java                |  192 +--
 .../types/MessageAttachmentCollection.java      |   44 +-
 .../types/MessageCollection.java                |   44 +-
 .../astoriadefaultservice/types/MessageKey.java |   76 +-
 .../astoriadefaultservice/types/Order.java      |  319 ++---
 .../types/OrderCollection.java                  |   44 +-
 .../astoriadefaultservice/types/OrderLine.java  |  435 ++++---
 .../types/OrderLineCollection.java              |   44 +-
 .../types/OrderLineKey.java                     |   76 +-
 .../astoriadefaultservice/types/PageView.java   |  381 +++---
 .../types/PageViewCollection.java               |   44 +-
 .../astoriadefaultservice/types/Person.java     |  244 ++--
 .../types/PersonCollection.java                 |   44 +-
 .../types/PersonMetadata.java                   |  328 ++---
 .../types/PersonMetadataCollection.java         |   44 +-
 .../astoriadefaultservice/types/Phone.java      |   66 +-
 .../astoriadefaultservice/types/Product.java    |  641 +++++-----
 .../types/ProductCollection.java                |   44 +-
 .../types/ProductDetail.java                    |  222 ++--
 .../types/ProductDetailCollection.java          |   44 +-
 .../types/ProductPageView.java                  |  512 ++++----
 .../types/ProductPageViewCollection.java        |   44 +-
 .../types/ProductPhoto.java                     |  244 ++--
 .../types/ProductPhotoCollection.java           |   44 +-
 .../types/ProductPhotoKey.java                  |   76 +-
 .../types/ProductReview.java                    |  328 ++---
 .../types/ProductReviewCollection.java          |   44 +-
 .../types/ProductReviewKey.java                 |   92 +-
 .../astoriadefaultservice/types/RSAToken.java   |  222 ++--
 .../types/RSATokenCollection.java               |   44 +-
 .../types/SpecialEmployee.java                  |  669 +++++-----
 .../types/SpecialEmployeeCollection.java        |   58 +-
 .../types/package-info.java                     |   16 +-
 .../opentypesservicev3/DefaultContainer.java    |   66 +-
 .../odata/services/opentypesservicev3/Row.java  |   54 +-
 .../services/opentypesservicev3/RowIndex.java   |   50 +-
 .../opentypesservicev3/package-info.java        |   16 +-
 .../types/ContactDetails.java                   |  148 ++-
 .../opentypesservicev3/types/IndexedRow.java    |  133 +-
 .../types/IndexedRowCollection.java             |   44 +-
 .../services/opentypesservicev3/types/Row.java  |  140 ++-
 .../opentypesservicev3/types/RowCollection.java |   44 +-
 .../opentypesservicev3/types/RowIndex.java      |  170 +--
 .../types/RowIndexCollection.java               |   44 +-
 .../opentypesservicev3/types/package-info.java  |   16 +-
 .../primitivekeysservice/EdmBinarySet.java      |   51 +-
 .../primitivekeysservice/EdmBooleanSet.java     |   51 +-
 .../primitivekeysservice/EdmByteSet.java        |   51 +-
 .../EdmDateTimeOffsetSet.java                   |   51 +-
 .../primitivekeysservice/EdmDateTimeSet.java    |   51 +-
 .../primitivekeysservice/EdmDecimalSet.java     |   51 +-
 .../primitivekeysservice/EdmDoubleSet.java      |   51 +-
 .../primitivekeysservice/EdmGuidSet.java        |   51 +-
 .../primitivekeysservice/EdmInt16Set.java       |   51 +-
 .../primitivekeysservice/EdmInt32Set.java       |   51 +-
 .../primitivekeysservice/EdmInt64Set.java       |   51 +-
 .../primitivekeysservice/EdmSingleSet.java      |   51 +-
 .../primitivekeysservice/EdmStringSet.java      |   51 +-
 .../primitivekeysservice/EdmTimeSet.java        |   51 +-
 .../services/primitivekeysservice/Folders.java  |   51 +-
 .../primitivekeysservice/TestContext.java       |   88 +-
 .../primitivekeysservice/package-info.java      |   16 +-
 .../primitivekeysservice/types/EdmBinary.java   |  139 ++-
 .../types/EdmBinaryCollection.java              |   44 +-
 .../primitivekeysservice/types/EdmBoolean.java  |  139 ++-
 .../types/EdmBooleanCollection.java             |   44 +-
 .../primitivekeysservice/types/EdmByte.java     |  139 ++-
 .../types/EdmByteCollection.java                |   44 +-
 .../primitivekeysservice/types/EdmDateTime.java |  139 ++-
 .../types/EdmDateTimeCollection.java            |   44 +-
 .../types/EdmDateTimeOffset.java                |  139 ++-
 .../types/EdmDateTimeOffsetCollection.java      |   44 +-
 .../primitivekeysservice/types/EdmDecimal.java  |  139 ++-
 .../types/EdmDecimalCollection.java             |   44 +-
 .../primitivekeysservice/types/EdmDouble.java   |  139 ++-
 .../types/EdmDoubleCollection.java              |   44 +-
 .../primitivekeysservice/types/EdmGuid.java     |  139 ++-
 .../types/EdmGuidCollection.java                |   44 +-
 .../primitivekeysservice/types/EdmInt16.java    |  139 ++-
 .../types/EdmInt16Collection.java               |   44 +-
 .../primitivekeysservice/types/EdmInt32.java    |  139 ++-
 .../types/EdmInt32Collection.java               |   44 +-
 .../primitivekeysservice/types/EdmInt64.java    |  139 ++-
 .../types/EdmInt64Collection.java               |   44 +-
 .../primitivekeysservice/types/EdmSingle.java   |  139 ++-
 .../types/EdmSingleCollection.java              |   44 +-
 .../primitivekeysservice/types/EdmString.java   |  139 ++-
 .../types/EdmStringCollection.java              |   44 +-
 .../primitivekeysservice/types/EdmTime.java     |  139 ++-
 .../types/EdmTimeCollection.java                |   44 +-
 .../primitivekeysservice/types/Folder.java      |  222 ++--
 .../types/FolderCollection.java                 |   44 +-
 .../types/package-info.java                     |   16 +-
 .../AllGeoCollectionTypesSet.java               |   55 +-
 .../astoriadefaultservice/AllGeoTypesSet.java   |   51 +-
 .../services/astoriadefaultservice/Car.java     |   50 +-
 .../astoriadefaultservice/Computer.java         |   51 +-
 .../astoriadefaultservice/ComputerDetail.java   |   51 +-
 .../astoriadefaultservice/Customer.java         |   51 +-
 .../astoriadefaultservice/CustomerInfo.java     |   51 +-
 .../astoriadefaultservice/DefaultContainer.java |  299 +++--
 .../services/astoriadefaultservice/Driver.java  |   51 +-
 .../astoriadefaultservice/LastLogin.java        |   51 +-
 .../services/astoriadefaultservice/License.java |   51 +-
 .../services/astoriadefaultservice/Login.java   |   51 +-
 .../astoriadefaultservice/MappedEntityType.java |   51 +-
 .../services/astoriadefaultservice/Message.java |   52 +-
 .../MessageAttachment.java                      |   51 +-
 .../services/astoriadefaultservice/Order.java   |   51 +-
 .../astoriadefaultservice/OrderLine.java        |   68 +-
 .../astoriadefaultservice/PageView.java         |   55 +-
 .../services/astoriadefaultservice/Person.java  |   75 +-
 .../astoriadefaultservice/PersonMetadata.java   |   51 +-
 .../services/astoriadefaultservice/Product.java |   55 +-
 .../astoriadefaultservice/ProductDetail.java    |   51 +-
 .../astoriadefaultservice/ProductPhoto.java     |   52 +-
 .../astoriadefaultservice/ProductReview.java    |   52 +-
 .../astoriadefaultservice/RSAToken.java         |   51 +-
 .../astoriadefaultservice/package-info.java     |   16 +-
 .../astoriadefaultservice/types/Aliases.java    |   59 +-
 .../types/AllSpatialCollectionTypes.java        |  139 ++-
 .../AllSpatialCollectionTypesCollection.java    |   44 +-
 .../types/AllSpatialCollectionTypes_Simple.java |  442 ++++---
 ...SpatialCollectionTypes_SimpleCollection.java |   44 +-
 .../types/AllSpatialTypes.java                  |  985 ++++++++-------
 .../types/AllSpatialTypesCollection.java        |   44 +-
 .../astoriadefaultservice/types/AuditInfo.java  |   86 +-
 .../types/BackOrderLine.java                    |  443 +++----
 .../types/BackOrderLine2.java                   |  444 +++----
 .../types/BackOrderLine2Collection.java         |   44 +-
 .../types/BackOrderLineCollection.java          |   44 +-
 .../astoriadefaultservice/types/Car.java        |  305 +++--
 .../types/CarCollection.java                    |   44 +-
 .../types/ComplexToCategory.java                |   74 +-
 .../types/ComplexWithAllPrimitiveTypes.java     |  164 ++-
 .../astoriadefaultservice/types/Computer.java   |  247 ++--
 .../types/ComputerCollection.java               |   44 +-
 .../types/ComputerDetail.java                   |  526 ++++----
 .../types/ComputerDetailCollection.java         |   44 +-
 .../types/ConcurrencyInfo.java                  |   67 +-
 .../types/ContactDetails.java                   |  144 ++-
 .../astoriadefaultservice/types/Contractor.java |  434 ++++---
 .../types/ContractorCollection.java             |   44 +-
 .../astoriadefaultservice/types/Customer.java   |  648 +++++-----
 .../types/CustomerCollection.java               |   44 +-
 .../types/CustomerInfo.java                     |  199 +--
 .../types/CustomerInfoCollection.java           |   44 +-
 .../astoriadefaultservice/types/Dimensions.java |   74 +-
 .../types/DiscontinuedProduct.java              |  885 +++++++------
 .../types/DiscontinuedProductCollection.java    |   44 +-
 .../astoriadefaultservice/types/Driver.java     |  222 ++--
 .../types/DriverCollection.java                 |   44 +-
 .../astoriadefaultservice/types/Employee.java   |  450 +++----
 .../types/EmployeeCollection.java               |   58 +-
 .../astoriadefaultservice/types/LastLogin.java  |  328 ++---
 .../types/LastLoginCollection.java              |   44 +-
 .../astoriadefaultservice/types/License.java    |  381 +++---
 .../types/LicenseCollection.java                |   44 +-
 .../astoriadefaultservice/types/Login.java      |  346 +++---
 .../types/LoginCollection.java                  |   44 +-
 .../types/MappedEntityType.java                 | 1173 +++++++++---------
 .../types/MappedEntityTypeCollection.java       |   44 +-
 .../astoriadefaultservice/types/Message.java    |  548 ++++----
 .../types/MessageAttachment.java                |  192 +--
 .../types/MessageAttachmentCollection.java      |   44 +-
 .../types/MessageCollection.java                |   44 +-
 .../astoriadefaultservice/types/MessageKey.java |   76 +-
 .../astoriadefaultservice/types/Order.java      |  319 ++---
 .../types/OrderCollection.java                  |   44 +-
 .../astoriadefaultservice/types/OrderLine.java  |  411 +++---
 .../types/OrderLineCollection.java              |   44 +-
 .../types/OrderLineKey.java                     |   76 +-
 .../astoriadefaultservice/types/PageView.java   |  381 +++---
 .../types/PageViewCollection.java               |   44 +-
 .../astoriadefaultservice/types/Person.java     |  222 ++--
 .../types/PersonCollection.java                 |   44 +-
 .../types/PersonMetadata.java                   |  328 ++---
 .../types/PersonMetadataCollection.java         |   44 +-
 .../astoriadefaultservice/types/Phone.java      |   66 +-
 .../astoriadefaultservice/types/Product.java    |  642 +++++-----
 .../types/ProductCollection.java                |   44 +-
 .../types/ProductDetail.java                    |  222 ++--
 .../types/ProductDetailCollection.java          |   44 +-
 .../types/ProductPageView.java                  |  512 ++++----
 .../types/ProductPageViewCollection.java        |   44 +-
 .../types/ProductPhoto.java                     |  244 ++--
 .../types/ProductPhotoCollection.java           |   44 +-
 .../types/ProductPhotoKey.java                  |   76 +-
 .../types/ProductReview.java                    |  328 ++---
 .../types/ProductReviewCollection.java          |   44 +-
 .../types/ProductReviewKey.java                 |   92 +-
 .../astoriadefaultservice/types/RSAToken.java   |  222 ++--
 .../types/RSATokenCollection.java               |   44 +-
 .../types/SpecialEmployee.java                  |  643 +++++-----
 .../types/SpecialEmployeeCollection.java        |   44 +-
 .../types/package-info.java                     |   16 +-
 .../olingo/fit/proxy/v4/AbstractTestITCase.java |   17 +-
 .../v4/BoundOperationInvokeTestITCase.java      |    4 +-
 .../fit/proxy/v4/DerivedTypeTestITCase.java     |    5 +-
 .../fit/proxy/v4/EntityCreateTestITCase.java    |   76 +-
 .../fit/proxy/v4/EntityRetrieveTestITCase.java  |   19 +-
 .../fit/proxy/v4/EntityUpdateTestITCase.java    |   21 +-
 .../fit/proxy/v4/MediaEntityTestITCase.java     |   20 +-
 .../olingo/fit/proxy/v4/OpenTypeTestITCase.java |   27 +-
 .../proxy/v4/demo/odatademo/Advertisements.java |   49 +-
 .../fit/proxy/v4/demo/odatademo/Categories.java |   49 +-
 .../proxy/v4/demo/odatademo/DemoService.java    |   97 +-
 .../proxy/v4/demo/odatademo/PersonDetails.java  |   49 +-
 .../fit/proxy/v4/demo/odatademo/Persons.java    |   61 +-
 .../proxy/v4/demo/odatademo/ProductDetails.java |   49 +-
 .../fit/proxy/v4/demo/odatademo/Products.java   |   51 +-
 .../fit/proxy/v4/demo/odatademo/Suppliers.java  |   49 +-
 .../proxy/v4/demo/odatademo/package-info.java   |   16 +-
 .../proxy/v4/demo/odatademo/types/Address.java  |  271 ++--
 .../v4/demo/odatademo/types/Advertisement.java  |  279 +++--
 .../types/AdvertisementCollection.java          |   43 +-
 .../proxy/v4/demo/odatademo/types/Category.java |  220 ++--
 .../odatademo/types/CategoryCollection.java     |   43 +-
 .../proxy/v4/demo/odatademo/types/Customer.java |  283 +++--
 .../odatademo/types/CustomerCollection.java     |   43 +-
 .../proxy/v4/demo/odatademo/types/Employee.java |  389 +++---
 .../odatademo/types/EmployeeCollection.java     |   43 +-
 .../demo/odatademo/types/FeaturedProduct.java   |  613 ++++-----
 .../types/FeaturedProductCollection.java        |   43 +-
 .../proxy/v4/demo/odatademo/types/Person.java   |  219 ++--
 .../demo/odatademo/types/PersonCollection.java  |   43 +-
 .../v4/demo/odatademo/types/PersonDetail.java   |  440 ++++---
 .../odatademo/types/PersonDetailCollection.java |   43 +-
 .../proxy/v4/demo/odatademo/types/Product.java  |  566 +++++----
 .../demo/odatademo/types/ProductCollection.java |   43 +-
 .../v4/demo/odatademo/types/ProductDetail.java  |  219 ++--
 .../types/ProductDetailCollection.java          |   43 +-
 .../proxy/v4/demo/odatademo/types/Supplier.java |  387 +++---
 .../odatademo/types/SupplierCollection.java     |   43 +-
 .../v4/demo/odatademo/types/package-info.java   |   16 +-
 .../opentypesservicev4/DefaultContainer.java    |   72 +-
 .../odata/services/opentypesservicev4/Row.java  |   54 +-
 .../services/opentypesservicev4/RowIndex.java   |   50 +-
 .../opentypesservicev4/package-info.java        |   16 +-
 .../opentypesservicev4/types/AccountInfo.java   |  150 ++-
 .../opentypesservicev4/types/Color.java         |   45 +-
 .../types/ContactDetails.java                   |  551 ++++----
 .../opentypesservicev4/types/IndexedRow.java    |  133 +-
 .../types/IndexedRowCollection.java             |   44 +-
 .../services/opentypesservicev4/types/Row.java  |  140 ++-
 .../opentypesservicev4/types/RowCollection.java |   44 +-
 .../opentypesservicev4/types/RowIndex.java      |  168 ++-
 .../types/RowIndexCollection.java               |   44 +-
 .../opentypesservicev4/types/package-info.java  |   16 +-
 .../services/odatawcfservice/Accounts.java      |   50 +-
 .../odata/services/odatawcfservice/Boss.java    |   44 +-
 .../odata/services/odatawcfservice/Company.java |   44 +-
 .../services/odatawcfservice/Customers.java     |   51 +-
 .../odatawcfservice/DefaultStoredPI.java        |   44 +-
 .../services/odatawcfservice/Departments.java   |   51 +-
 .../services/odatawcfservice/Employees.java     |   51 +-
 .../odatawcfservice/InMemoryEntities.java       |  294 +++--
 .../services/odatawcfservice/LabourUnion.java   |   44 +-
 .../services/odatawcfservice/OrderDetails.java  |   52 +-
 .../odata/services/odatawcfservice/Orders.java  |   50 +-
 .../odata/services/odatawcfservice/People.java  |   66 +-
 .../odatawcfservice/ProductDetails.java         |   52 +-
 .../odatawcfservice/ProductReviews.java         |   52 +-
 .../services/odatawcfservice/Products.java      |   50 +-
 .../services/odatawcfservice/PublicCompany.java |   44 +-
 .../services/odatawcfservice/StoredPIs.java     |   51 +-
 .../odatawcfservice/SubscriptionTemplates.java  |   51 +-
 .../services/odatawcfservice/VipCustomer.java   |   44 +-
 .../services/odatawcfservice/package-info.java  |   16 +-
 .../odatawcfservice/types/AccessLevel.java      |   49 +-
 .../services/odatawcfservice/types/Account.java |  488 ++++----
 .../types/AccountCollection.java                |   44 +-
 .../odatawcfservice/types/AccountInfo.java      |  150 ++-
 .../services/odatawcfservice/types/Address.java |  191 +--
 .../services/odatawcfservice/types/Asset.java   |  245 ++--
 .../odatawcfservice/types/AssetCollection.java  |   44 +-
 .../services/odatawcfservice/types/Club.java    |  192 +--
 .../odatawcfservice/types/ClubCollection.java   |   44 +-
 .../services/odatawcfservice/types/Color.java   |   45 +-
 .../services/odatawcfservice/types/Company.java |  528 ++++----
 .../odatawcfservice/types/CompanyAddress.java   |  249 ++--
 .../odatawcfservice/types/CompanyCategory.java  |   47 +-
 .../types/CompanyCollection.java                |   44 +-
 .../odatawcfservice/types/CreditCardPI.java     |  652 +++++-----
 .../types/CreditCardPICollection.java           |   44 +-
 .../odatawcfservice/types/CreditRecord.java     |  298 +++--
 .../types/CreditRecordCollection.java           |   44 +-
 .../odatawcfservice/types/Customer.java         |  815 ++++++------
 .../types/CustomerCollection.java               |   44 +-
 .../odatawcfservice/types/Department.java       |  274 ++--
 .../types/DepartmentCollection.java             |   44 +-
 .../odatawcfservice/types/Employee.java         |  737 ++++++-----
 .../types/EmployeeCollection.java               |   44 +-
 .../odatawcfservice/types/GiftCard.java         |  377 +++---
 .../types/GiftCardCollection.java               |   44 +-
 .../odatawcfservice/types/HomeAddress.java      |  249 ++--
 .../services/odatawcfservice/types/IsBoss.java  |   25 +-
 .../odatawcfservice/types/LabourUnion.java      |  192 +--
 .../types/LabourUnionCollection.java            |   44 +-
 .../services/odatawcfservice/types/Order.java   |  390 +++---
 .../odatawcfservice/types/OrderCollection.java  |   44 +-
 .../odatawcfservice/types/OrderDetail.java      |  411 +++---
 .../types/OrderDetailCollection.java            |   44 +-
 .../odatawcfservice/types/OrderDetailKey.java   |   76 +-
 .../types/PaymentInstrument.java                |  359 +++---
 .../types/PaymentInstrumentCollection.java      |   44 +-
 .../services/odatawcfservice/types/Person.java  |  594 ++++-----
 .../odatawcfservice/types/PersonCollection.java |   44 +-
 .../services/odatawcfservice/types/Product.java |  644 +++++-----
 .../types/ProductCollection.java                |   61 +-
 .../odatawcfservice/types/ProductDetail.java    |  384 +++---
 .../types/ProductDetailCollection.java          |   44 +-
 .../odatawcfservice/types/ProductDetailKey.java |   76 +-
 .../odatawcfservice/types/ProductReview.java    |  405 +++---
 .../types/ProductReviewCollection.java          |   44 +-
 .../odatawcfservice/types/ProductReviewKey.java |  108 +-
 .../odatawcfservice/types/PublicCompany.java    |  698 +++++------
 .../types/PublicCompanyCollection.java          |   44 +-
 .../odatawcfservice/types/Statement.java        |  298 +++--
 .../types/StatementCollection.java              |   44 +-
 .../odatawcfservice/types/StoredPI.java         |  298 +++--
 .../types/StoredPICollection.java               |   44 +-
 .../odatawcfservice/types/Subscription.java     |  351 +++---
 .../types/SubscriptionCollection.java           |   44 +-
 .../odatawcfservice/types/package-info.java     |   16 +-
 426 files changed, 34725 insertions(+), 26574 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java
index 769bd2a..a4d9bf2 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java
@@ -18,10 +18,9 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-import java.io.Serializable;
 import java.util.Collection;
 
-public interface AbstractOpenType extends Serializable {
+public interface AbstractOpenType {
 
   void addAdditionalProperty(String name, Object value);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CollectionQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CollectionQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CollectionQuery.java
new file mode 100644
index 0000000..2acd0f1
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CollectionQuery.java
@@ -0,0 +1,30 @@
+/*
+ * 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.ext.proxy.api;
+
+import java.io.Serializable;
+
+public interface CollectionQuery<T extends Serializable, EC extends AbstractEntityCollection<T>> {
+
+  /**
+   *
+   * @return structured type.
+   */
+  EC execute();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/SingleQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/SingleQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/SingleQuery.java
new file mode 100644
index 0000000..66c7b74
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/SingleQuery.java
@@ -0,0 +1,28 @@
+/*
+ * 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.ext.proxy.api;
+
+public interface SingleQuery<T extends StructuredType> {
+
+  /**
+   * 
+   * @return structured type.
+   */
+  T load();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java
new file mode 100644
index 0000000..da149dd
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java
@@ -0,0 +1,25 @@
+/*
+ * 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.ext.proxy.api;
+
+/**
+ * Marker interface for Entity and complex type.
+ */
+public interface StructuredType extends java.io.Serializable {
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java
index 1728a7a..a35712a 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java
@@ -110,8 +110,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
     final List<Object> items = new ArrayList<Object>();
 
     for (CommonODataEntity entityFromSet : entitySet.getEntities()) {
-      items.add(getEntityProxy(
-              entityFromSet.getEditLink(), entityFromSet, entityContainerName, null, typeRef, null, checkInTheContext));
+      items.add(getEntityProxy(entityFromSet, entityContainerName, null, typeRef, null, checkInTheContext));
     }
 
     return Proxy.newProxyInstance(
@@ -131,7 +130,6 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
   }
 
   protected Object getEntityProxy(
-          final URI entityURI,
           final CommonODataEntity entity,
           final String entityContainerName,
           final URI entitySetURI,
@@ -139,8 +137,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
           final String eTag,
           final boolean checkInTheContext) {
 
-    EntityInvocationHandler handler =
-            EntityInvocationHandler.getInstance(entityURI, entity, entitySetURI, type, containerHandler);
+    EntityInvocationHandler handler = EntityInvocationHandler.getInstance(entity, entitySetURI, type, containerHandler);
 
     if (StringUtils.isNotBlank(eTag)) {
       // override ETag into the wrapped object.
@@ -242,7 +239,6 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
                 false);
       } else {
         return getEntityProxy(
-                ((CommonODataEntity) result).getEditLink(),
                 (CommonODataEntity) result,
                 null,
                 null,
@@ -255,7 +251,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
       return property == null || property.hasNullValue()
               ? null
               : CoreUtils.getObjectFromODataValue(
-                      getClient(), property.getValue(), method.getGenericReturnType(), null);
+              getClient(), property.getValue(), method.getGenericReturnType(), null);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java
index 8b290f2..0d12d73 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java
@@ -117,6 +117,9 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
   public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
     if (isSelfMethod(method, args)) {
       return invokeSelfMethod(method, args);
+    } else if ("load".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
+      load();
+      return proxy;
     } else if ("operations".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
       final Class<?> returnType = method.getReturnType();
 
@@ -216,9 +219,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
     final Class<?> type = getter.getReturnType();
     final Class<?> collItemType;
     if (AbstractEntityCollection.class.isAssignableFrom(type)) {
-      final Type[] entityCollectionParams =
-              ((ParameterizedType) type.getGenericInterfaces()[0]).getActualTypeArguments();
-      collItemType = (Class<?>) entityCollectionParams[0];
+      final Type[] eCollParams = ((ParameterizedType) type.getGenericInterfaces()[0]).getActualTypeArguments();
+      collItemType = (Class<?>) eCollParams[0];
     } else {
       collItemType = type;
     }
@@ -229,7 +231,6 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
     if (link instanceof ODataInlineEntity) {
       // return entity
       navPropValue = getEntityProxy(
-              null,
               ((ODataInlineEntity) link).getEntity(),
               property.targetContainer(),
               getClient().newURIBuilder().appendEntitySetSegment(property.targetEntitySet()).build(),
@@ -247,7 +248,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
               false);
     } else {
       // navigate
-      final URI uri = URIUtils.getURI(getClient().getServiceRoot(), link.getLink().toASCIIString());
+      final URI uri = URIUtils.getURI(getEntityHandler().getEntityURI(), property.name());
 
       if (AbstractEntityCollection.class.isAssignableFrom(type)) {
         navPropValue = getEntityCollectionProxy(
@@ -268,7 +269,6 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
         final ODataRetrieveResponse<CommonODataEntity> res = req.execute();
 
         navPropValue = getEntityProxy(
-                null,
                 res.getBody(),
                 property.targetContainer(),
                 getClient().newURIBuilder().appendEntitySetSegment(property.targetEntitySet()).build(),
@@ -332,6 +332,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
     navPropAnnotatableHandlers.put(navPropName, handler);
   }
 
+  protected abstract void load();
+
   protected abstract void setPropertyValue(final Property property, final Object value);
 
   protected abstract void addLinkChanges(final NavigationProperty navProp, final Object value);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java
index 2a71f2e..4d1e61f 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java
@@ -96,7 +96,6 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
 
     return new ComplexInvocationHandler(client, complex, typeRef, handler);
   }
-
   private final CommonEdmEnabledODataClient<?> client;
 
   private ComplexInvocationHandler(
@@ -221,4 +220,8 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
   public boolean isChanged() {
     return getEntityHandler() == null ? false : getEntityHandler().isChanged();
   }
+
+  @Override
+  protected void load() {
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java
index 56c34a8..a5b68c0 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java
@@ -30,26 +30,35 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataMediaRequest;
+import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
+import org.apache.olingo.client.api.uri.CommonURIBuilder;
 import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
 import org.apache.olingo.commons.api.domain.v4.ODataEntity;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.ext.proxy.api.AbstractTerm;
 import org.apache.olingo.ext.proxy.api.Annotatable;
+import org.apache.olingo.ext.proxy.api.annotations.CompoundKey;
+import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement;
 import org.apache.olingo.ext.proxy.api.annotations.EntityType;
 import org.apache.olingo.ext.proxy.api.annotations.Namespace;
 import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
 import org.apache.olingo.ext.proxy.api.annotations.Property;
 import org.apache.olingo.ext.proxy.api.annotations.Term;
+import static org.apache.olingo.ext.proxy.commons.AbstractStructuredInvocationHandler.LOG;
 import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
 import org.apache.olingo.ext.proxy.context.EntityUUID;
 import org.apache.olingo.ext.proxy.utils.CoreUtils;
@@ -78,13 +87,12 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
   private EntityUUID uuid;
 
   static EntityInvocationHandler getInstance(
-          final URI entityURI,
           final CommonODataEntity entity,
           final EntitySetInvocationHandler<?, ?, ?> entitySet,
           final Class<?> typeRef) {
 
-    return getInstance(
-            entityURI,
+    return new EntityInvocationHandler(
+            null,
             entity,
             entitySet.getEntitySetURI(),
             typeRef,
@@ -92,17 +100,26 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
   }
 
   static EntityInvocationHandler getInstance(
-          final URI entityURI,
+          final Object key,
           final CommonODataEntity entity,
           final URI entitySetURI,
           final Class<?> typeRef,
           final EntityContainerInvocationHandler containerHandler) {
 
-    return new EntityInvocationHandler(entityURI, entity, entitySetURI, typeRef, containerHandler);
+    return new EntityInvocationHandler(key, entity, entitySetURI, typeRef, containerHandler);
+  }
+
+  static EntityInvocationHandler getInstance(
+          final CommonODataEntity entity,
+          final URI entitySetURI,
+          final Class<?> typeRef,
+          final EntityContainerInvocationHandler containerHandler) {
+
+    return new EntityInvocationHandler(null, entity, entitySetURI, typeRef, containerHandler);
   }
 
   private EntityInvocationHandler(
-          final URI entityURI,
+          final Object entityKey,
           final CommonODataEntity entity,
           final URI entitySetURI,
           final Class<?> typeRef,
@@ -110,7 +127,24 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
 
     super(typeRef, entity, containerHandler);
 
-    this.entityURI = entityURI;
+    final Object key = entityKey == null ? CoreUtils.getKey(getClient(), this, typeRef, entity) : entityKey;
+    if (key!=null && entity.getEditLink() == null) {
+      final CommonURIBuilder<?> uriBuilder = containerHandler.getClient().newURIBuilder(entitySetURI.toASCIIString());
+
+      if (key.getClass().getAnnotation(CompoundKey.class) == null) {
+        LOG.debug("Append key segment '{}'", key);
+        uriBuilder.appendKeySegment(key);
+      } else {
+        LOG.debug("Append compound key segment '{}'", key);
+        uriBuilder.appendKeySegment(getCompoundKey(key));
+      }
+
+      this.entityURI = uriBuilder.build();
+      entity.setEditLink(entityURI);
+    } else {
+      this.entityURI = entity.getEditLink();
+    }
+
     this.internal = entity;
     getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
 
@@ -118,7 +152,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
             containerHandler.getEntityContainerName(),
             entitySetURI,
             typeRef,
-            CoreUtils.getKey(getClient(), this, typeRef, entity));
+            key);
   }
 
   public void setEntity(final CommonODataEntity entity) {
@@ -474,6 +508,65 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
   }
 
   @Override
+  protected void load() {
+    // Search against the service
+    final Object key = uuid.getKey();
+
+    try {
+      final ODataEntityRequest<CommonODataEntity> req =
+              getClient().getRetrieveRequestFactory().getEntityRequest(entityURI);
+      if (getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) > 0) {
+        req.setPrefer(getClient().newPreferences().includeAnnotations("*"));
+      }
+
+      final ODataRetrieveResponse<CommonODataEntity> res = req.execute();
+
+      final String etag = res.getETag();
+      final CommonODataEntity entity = res.getBody();
+      if (entity == null) {
+        throw new IllegalArgumentException("Invalid " + typeRef.getSimpleName() + "(" + key + ")");
+      }
+
+      setEntity(entity);
+      setETag(etag);
+
+      if (!key.equals(CoreUtils.getKey(getClient(), this, typeRef, entity))) {
+        throw new IllegalArgumentException("Invalid " + typeRef.getSimpleName() + "(" + key + ")");
+      }
+    } catch (IllegalArgumentException e) {
+      LOG.warn("Entity '" + uuid + "' not found", e);
+      throw e;
+    } catch (Exception e) {
+      LOG.warn("Error retrieving entity '" + uuid + "'", e);
+      throw new IllegalArgumentException("Error retrieving " + typeRef.getSimpleName() + "(" + key + ")", e);
+    }
+  }
+
+  private Map<String, Object> getCompoundKey(final Object key) {
+    final Set<CompoundKeyElementWrapper> elements = new TreeSet<CompoundKeyElementWrapper>();
+
+    for (Method method : key.getClass().getMethods()) {
+      final Annotation annotation = method.getAnnotation(CompoundKeyElement.class);
+      if (annotation instanceof CompoundKeyElement) {
+        elements.add(new CompoundKeyElementWrapper(
+                ((CompoundKeyElement) annotation).name(), method, ((CompoundKeyElement) annotation).position()));
+      }
+    }
+
+    final LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
+
+    for (CompoundKeyElementWrapper element : elements) {
+      try {
+        map.put(element.getName(), element.getMethod().invoke(key));
+      } catch (Exception e) {
+        LOG.warn("Error retrieving compound key element '{}' value", element.getName(), e);
+      }
+    }
+
+    return map;
+  }
+
+  @Override
   public String toString() {
     return uuid.toString();
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
index ec00a75..28b22ca 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
@@ -19,23 +19,16 @@
 package org.apache.olingo.ext.proxy.commons;
 
 import java.io.Serializable;
-import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
 
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.tuple.ImmutableTriple;
 import org.apache.commons.lang3.tuple.Triple;
-import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
@@ -55,14 +48,12 @@ import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
 import org.apache.olingo.ext.proxy.api.AbstractSingleton;
 import org.apache.olingo.ext.proxy.api.Filter;
 import org.apache.olingo.ext.proxy.api.Search;
-import org.apache.olingo.ext.proxy.api.annotations.CompoundKey;
-import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement;
+import org.apache.olingo.ext.proxy.api.SingleQuery;
 import org.apache.olingo.ext.proxy.api.annotations.EntitySet;
 import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
 import org.apache.olingo.ext.proxy.context.EntityContext;
 import org.apache.olingo.ext.proxy.context.EntityUUID;
 import org.apache.olingo.ext.proxy.utils.ClassUtils;
-import org.apache.olingo.ext.proxy.utils.CoreUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -80,9 +71,9 @@ class EntitySetInvocationHandler<
 
   private final boolean isSingleton;
 
-  private final Class<T> typeRef;
+  private Class<T> typeRef = null;
 
-  private final Class<EC> collTypeRef;
+  private Class<EC> collTypeRef = null;
 
   private final URI uri;
 
@@ -121,8 +112,7 @@ class EntitySetInvocationHandler<
 
     this.isSingleton = AbstractSingleton.class.isAssignableFrom(ref);
 
-    final Type[] entitySetParams = ((ParameterizedType) ref.getGenericInterfaces()[0]).getActualTypeArguments();
-
+    final Type[] entitySetParams = ClassUtils.extractGenericType(ref, AbstractEntitySet.class, AbstractSingleton.class);
     this.typeRef = (Class<T>) entitySetParams[0];
     this.collTypeRef = (Class<EC>) entitySetParams[2];
 
@@ -162,7 +152,7 @@ class EntitySetInvocationHandler<
             new FullQualifiedName(containerHandler.getSchemaName(), ClassUtils.getEntityTypeName(reference)));
 
     final EntityInvocationHandler handler =
-            EntityInvocationHandler.getInstance(null, entity, uri, reference, containerHandler);
+            EntityInvocationHandler.getInstance(entity, uri, reference, containerHandler);
     getContext().entityContext().attachNew(handler);
 
     return (NE) Proxy.newProxyInstance(
@@ -189,39 +179,13 @@ class EntitySetInvocationHandler<
 
   @Override
   public Boolean exists(final KEY key) throws IllegalArgumentException {
-    boolean result = false;
-
     try {
-      result = get(key) != null;
+      SingleQuery.class.cast(get(key)).load();
+      return true;
     } catch (Exception e) {
       LOG.error("Could not check existence of {}({})", this.uri, key, e);
+      return false;
     }
-
-    return result;
-  }
-
-  private Map<String, Object> getCompoundKey(final Object key) {
-    final Set<CompoundKeyElementWrapper> elements = new TreeSet<CompoundKeyElementWrapper>();
-
-    for (Method method : key.getClass().getMethods()) {
-      final Annotation annotation = method.getAnnotation(CompoundKeyElement.class);
-      if (annotation instanceof CompoundKeyElement) {
-        elements.add(new CompoundKeyElementWrapper(
-                ((CompoundKeyElement) annotation).name(), method, ((CompoundKeyElement) annotation).position()));
-      }
-    }
-
-    final LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
-
-    for (CompoundKeyElementWrapper element : elements) {
-      try {
-        map.put(element.getName(), element.getMethod().invoke(key));
-      } catch (Exception e) {
-        LOG.warn("Error retrieving compound key element '{}' value", element.getName(), e);
-      }
-    }
-
-    return map;
   }
 
   @Override
@@ -242,44 +206,11 @@ class EntitySetInvocationHandler<
     EntityInvocationHandler handler = getContext().entityContext().getEntity(uuid);
 
     if (handler == null) {
-      // not yet attached: search against the service
-      try {
-        LOG.debug("Search for '{}({})' into the service", typeRef.getSimpleName(), key);
-        final CommonURIBuilder<?> uriBuilder = getClient().newURIBuilder(this.uri.toASCIIString());
-
-        if (key.getClass().getAnnotation(CompoundKey.class) == null) {
-          LOG.debug("Append key segment '{}'", key);
-          uriBuilder.appendKeySegment(key);
-        } else {
-          LOG.debug("Append compound key segment '{}'", key);
-          uriBuilder.appendKeySegment(getCompoundKey(key));
-        }
-
-        LOG.debug("GET {}", uriBuilder.toString());
-
-        final ODataEntityRequest<CommonODataEntity> req =
-                getClient().getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-        if (getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) > 0) {
-          req.setPrefer(getClient().newPreferences().includeAnnotations("*"));
-        }
-
-        final ODataRetrieveResponse<CommonODataEntity> res = req.execute();
-
-        final String etag = res.getETag();
-        final CommonODataEntity entity = res.getBody();
-        if (entity == null) {
-          throw new IllegalArgumentException("Invalid " + typeRef.getSimpleName() + "(" + key + ")");
-        }
-
-        handler = EntityInvocationHandler.getInstance(uriBuilder.build(), entity, this, typeRef);
-        handler.setETag(etag);
-
-        if (!key.equals(CoreUtils.getKey(getClient(), handler, typeRef, entity))) {
-          throw new IllegalArgumentException("Invalid " + typeRef.getSimpleName() + "(" + key + ")");
-        }
-      } catch (Exception e) {
-        LOG.info("Entity '" + uuid + "' not found", e);
-      }
+      final CommonODataEntity entity = getClient().getObjectFactory().newEntity(
+              new FullQualifiedName(containerHandler.getSchemaName(), ClassUtils.getEntityTypeName(typeRef)));
+
+      handler = EntityInvocationHandler.getInstance(key, entity, uri, typeRef, containerHandler);
+
     } else if (isDeleted(handler)) {
       // object deleted
       LOG.debug("Object '{}({})' has been deleted", typeRef.getSimpleName(), uuid);
@@ -293,8 +224,8 @@ class EntitySetInvocationHandler<
   }
 
   @SuppressWarnings("unchecked")
-  public <S extends T> Triple<List<S>, URI, List<ODataAnnotation>>
-          fetchPartialEntitySet(final URI uri, final Class<S> typeRef) {
+  public <S extends T> Triple<List<S>, URI, List<ODataAnnotation>> fetchPartialEntitySet(
+          final URI uri, final Class<S> typeRef) {
 
     final List<CommonODataEntity> entities = new ArrayList<CommonODataEntity>();
     final URI next;
@@ -326,8 +257,7 @@ class EntitySetInvocationHandler<
     final List<S> items = new ArrayList<S>(entities.size());
 
     for (CommonODataEntity entity : entities) {
-      final EntityInvocationHandler handler =
-              EntityInvocationHandler.getInstance(entity.getEditLink(), entity, this, typeRef);
+      final EntityInvocationHandler handler = EntityInvocationHandler.getInstance(entity, this, typeRef);
 
       final EntityInvocationHandler handlerInTheContext = getContext().entityContext().getEntity(handler.getUUID());
 
@@ -373,7 +303,8 @@ class EntitySetInvocationHandler<
   @SuppressWarnings("unchecked")
   @Override
   public <S extends T, SEC extends AbstractEntityCollection<S>> SEC getAll(final Class<SEC> collTypeRef) {
-    final Class<S> ref = (Class<S>) ClassUtils.extractTypeArg(collTypeRef);
+    final Class<S> ref = (Class<S>) ClassUtils.extractTypeArg(collTypeRef,
+            AbstractEntitySet.class, AbstractSingleton.class, AbstractEntityCollection.class);
     final Class<S> oref = (Class<S>) ClassUtils.extractTypeArg(this.collTypeRef);
 
     final CommonURIBuilder<?> uriBuilder = getClient().newURIBuilder(this.uri.toASCIIString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
index d68efb1..3f19ad0 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
@@ -161,30 +161,43 @@ final class OperationInvocationHandler extends AbstractInvocationHandler impleme
     if (boundOp == null) {
       boundOp = entity.getOperation(new FullQualifiedName(targetFQN.getNamespace(), operation.name()).toString());
     }
+
     boolean useOperationFQN = this.getClient().getConfiguration().isUseUrlOperationFQN();
-    if (boundOp == null) {
-    	// json minimal/none metadata doesn't return operations for entity, so here try creating it from Edm: 
-    	EdmAction action = this.getClient().getEdm(null).getBoundAction(
-          new FullQualifiedName(targetFQN.getNamespace(), operation.name()), targetFQN, false);
-    	if(action!=null){
-    		boundOp = new ODataOperation();
-    		boundOp.setMetadataAnchor(action.getFullQualifiedName().toString());
-    		boundOp.setTitle(boundOp.getMetadataAnchor());
-    		boundOp.setTarget(URI.create(entity.getEditLink().toString() + "/" 
-                  + (useOperationFQN ? action.getFullQualifiedName().toString() : operation.name())));
-    	}
+
+    EdmEntityType entityType = getClient().getCachedEdm().getEntityType(entity.getTypeName());
+    EdmEntityType baseType = entityType;
+    while (boundOp == null && baseType != null) {
+      // json minimal/none metadata doesn't return operations for entity, so here try creating it from Edm: 
+      EdmAction action = this.getClient().getCachedEdm().getBoundAction(
+              new FullQualifiedName(targetFQN.getNamespace(), operation.name()), baseType.getFullQualifiedName(), false);
+
+      if (action != null) {
+        boundOp = new ODataOperation();
+        boundOp.setMetadataAnchor(action.getFullQualifiedName().toString());
+        boundOp.setTitle(boundOp.getMetadataAnchor());
+        boundOp.setTarget(URI.create(entity.getEditLink().toString() + "/"
+                + (useOperationFQN ? action.getFullQualifiedName().toString() : operation.name())));
+      } else {
+        baseType = baseType.getBaseType();
+      }
     }
-    if (boundOp == null) {
-    	// json minimal/none metadata doesn't return operations for entity, so here try creating it from Edm: 
-    	EdmFunction func = this.getClient().getEdm(null).getBoundFunction(
-          new FullQualifiedName(targetFQN.getNamespace(), operation.name()), targetFQN, false, parameterNames);
-    	if(func!=null){
-    		boundOp = new ODataOperation();
-    		boundOp.setMetadataAnchor(func.getFullQualifiedName().toString());
-    		boundOp.setTitle(boundOp.getMetadataAnchor());
-    		boundOp.setTarget(URI.create(entity.getEditLink().toString() + "/" 
-                  + (useOperationFQN ? func.getFullQualifiedName().toString() : operation.name())));
-    	}
+
+    baseType = entityType;
+    while (boundOp == null && baseType != null) {
+      // json minimal/none metadata doesn't return operations for entity, so here try creating it from Edm: 
+      EdmFunction func = this.getClient().getCachedEdm().getBoundFunction(
+              new FullQualifiedName(targetFQN.getNamespace(), operation.name()), baseType.getFullQualifiedName(),
+              false, parameterNames);
+
+      if (func != null) {
+        boundOp = new ODataOperation();
+        boundOp.setMetadataAnchor(func.getFullQualifiedName().toString());
+        boundOp.setTitle(boundOp.getMetadataAnchor());
+        boundOp.setTarget(URI.create(entity.getEditLink().toString() + "/"
+                + (useOperationFQN ? func.getFullQualifiedName().toString() : operation.name())));
+      } else {
+        baseType = baseType.getBaseType();
+      }
     }
     if (boundOp == null) {
       throw new IllegalArgumentException(String.format("Could not find any matching operation '%s' bound to %s",
@@ -195,18 +208,18 @@ final class OperationInvocationHandler extends AbstractInvocationHandler impleme
             ? new FullQualifiedName(targetFQN.getNamespace(), boundOp.getTitle())
             : new FullQualifiedName(boundOp.getTitle());
 
-    EdmEntityType entityType = getClient().getCachedEdm().getEntityType(entity.getTypeName());
     EdmOperation edmOperation = null;
     while (edmOperation == null && entityType != null) {
       edmOperation = operation.type() == OperationType.FUNCTION
               ? getClient().getCachedEdm().getBoundFunction(
-                      operationFQN, entityType.getFullQualifiedName(), false, parameterNames)
+              operationFQN, entityType.getFullQualifiedName(), false, parameterNames)
               : getClient().getCachedEdm().getBoundAction(
-                      operationFQN, entityType.getFullQualifiedName(), false);
+              operationFQN, entityType.getFullQualifiedName(), false);
       if (entityType.getBaseType() != null) {
         entityType = entityType.getBaseType();
       }
     }
+    
     if (edmOperation == null) {
       throw new IllegalArgumentException(String.format("Could not find any matching operation '%s' bound to %s",
               operation.name(), entity.getTypeName()));
@@ -230,6 +243,6 @@ final class OperationInvocationHandler extends AbstractInvocationHandler impleme
 
     return new AbstractMap.SimpleEntry<URI, EdmOperation>(
             URI.create(((EntityCollectionInvocationHandler<?>) target).getURI().toASCIIString()
-                    + "/" + edmOperation.getName()), edmOperation);
+            + "/" + edmOperation.getName()), edmOperation);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java
index d3f9119..f01fedc 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/ClassUtils.java
@@ -46,10 +46,27 @@ public final class ClassUtils {
     // Empty private constructor for static utility classes
   }
 
-  @SuppressWarnings("unchecked")
-  public static Class<?> extractTypeArg(final Class<?> paramType) {
-    final Type[] params = ((ParameterizedType) paramType.getGenericInterfaces()[0]).getActualTypeArguments();
-    return (Class<?>) params[0];
+  public static Type[] extractGenericType(final Class<?> paramType, final Class<?>... references) {
+    if (paramType.getGenericInterfaces().length > 0) {
+      if (references == null || references.length == 0) {
+        return ((ParameterizedType) paramType.getGenericInterfaces()[0]).getActualTypeArguments();
+      } else {
+        for (Type type : paramType.getGenericInterfaces()) {
+          final Class<?> typeClass = getTypeClass(type);
+          for (Class<?> reference : references) {
+            if (reference.isAssignableFrom(typeClass)) {
+              return ((ParameterizedType) type).getActualTypeArguments();
+            }
+          }
+        }
+      }
+    }
+
+    throw new IllegalArgumentException("Invalid type argument " + paramType);
+  }
+
+  public static Class<?> extractTypeArg(final Class<?> paramType, final Class<?>... references) {
+    return Class.class.cast(extractGenericType(paramType, references)[0]);
   }
 
   public static Method findGetterByAnnotatedName(
@@ -138,4 +155,14 @@ public final class ClassUtils {
     voidConstructor.setAccessible(true);
     return voidConstructor.newInstance();
   }
+
+  public static Class<?> getTypeClass(final Type type) {
+    if (type instanceof ParameterizedType) {
+      return getTypeClass(ParameterizedType.class.cast(type).getRawType());
+    } else if (type instanceof Class) {
+      return Class.class.cast(type);
+    } else {
+      return null;
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
index d1f680f..7ce154f 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java
@@ -28,7 +28,6 @@ import java.lang.reflect.Type;
 import java.net.URI;
 import java.sql.Timestamp;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
@@ -282,7 +281,7 @@ public final class CoreUtils {
         } else if (target.isAssignableFrom(clazz)) {
           bckCandidate = kind;
         } else if (target == Timestamp.class
-            && (kind == EdmPrimitiveTypeKind.DateTime || kind == EdmPrimitiveTypeKind.DateTimeOffset)) {
+                && (kind == EdmPrimitiveTypeKind.DateTime || kind == EdmPrimitiveTypeKind.DateTimeOffset)) {
           bckCandidate = kind;
         }
       }
@@ -341,9 +340,7 @@ public final class CoreUtils {
     Object obj;
 
     try {
-      obj = value.toValue() instanceof Timestamp
-              ? value.toCastValue(Calendar.class)
-              : reference == null
+      obj = reference == null
               ? value.toValue()
               : value.toCastValue(reference);
     } catch (EdmPrimitiveTypeException e) {
@@ -458,7 +455,7 @@ public final class CoreUtils {
                       Thread.currentThread().getContextClassLoader(),
                       new Class<?>[] {getter.getReturnType()},
                       ComplexInvocationHandler.getInstance(
-                              client, property.getName(), getter.getReturnType(), typeHandler));
+                      client, property.getName(), getter.getReturnType(), typeHandler));
 
               populate(client, typeHandler, complex, Property.class, property.getValue().asComplex().iterator());
               setPropertyValue(bean, getter, complex);
@@ -483,7 +480,7 @@ public final class CoreUtils {
                           Thread.currentThread().getContextClassLoader(),
                           new Class<?>[] {collItemClass},
                           ComplexInvocationHandler.getInstance(
-                                  client, property.getName(), collItemClass, typeHandler));
+                          client, property.getName(), collItemClass, typeHandler));
 
                   populate(client, typeHandler, collItem, Property.class, value.asComplex().iterator());
                   collection.add(collItem);
@@ -527,7 +524,7 @@ public final class CoreUtils {
               Thread.currentThread().getContextClassLoader(),
               new Class<?>[] {internalRef},
               ComplexInvocationHandler.getInstance(
-                      client, value.asComplex(), internalRef, entityHandler));
+              client, value.asComplex(), internalRef, entityHandler));
     } else if (value.isCollection()) {
       final ArrayList<Object> collection = new ArrayList<Object>();
 
@@ -542,7 +539,7 @@ public final class CoreUtils {
                   Thread.currentThread().getContextClassLoader(),
                   new Class<?>[] {internalRef},
                   ComplexInvocationHandler.getInstance(
-                          client, itemValue.asComplex(), internalRef, entityHandler));
+                  client, itemValue.asComplex(), internalRef, entityHandler));
 
           collection.add(collItem);
         }
@@ -625,8 +622,8 @@ public final class CoreUtils {
         if (ns != null && ann != null
                 && value.getTypeName().replaceAll("^Collection\\(", "").replaceAll("\\)$", "").
                 equals(new FullQualifiedName(ns.value(), annType.isAssignableFrom(EnumType.class)
-                                ? EnumType.class.cast(ann).name()
-                                : ComplexType.class.cast(ann).name()).toString())) {
+                ? EnumType.class.cast(ann).name()
+                : ComplexType.class.cast(ann).name()).toString())) {
           return clazz;
         }
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/pojogen-maven-plugin/src/main/resources/entitySet.vm
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/resources/entitySet.vm b/ext/pojogen-maven-plugin/src/main/resources/entitySet.vm
index 825ebd2..3bde5fa 100644
--- a/ext/pojogen-maven-plugin/src/main/resources/entitySet.vm
+++ b/ext/pojogen-maven-plugin/src/main/resources/entitySet.vm
@@ -52,9 +52,11 @@ import javax.xml.datatype.Duration;
   #set( $type = "" )
 #end
 
+#set ( $javaEntityType = $utility.getJavaType($entitySet.EntityType) )
+
 @org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "$entitySet.Name")
 public interface $utility.capitalize($entitySet.Name) 
-  extends AbstractEntitySet<$utility.getJavaType($entitySet.EntityType), $type, $utility.getJavaType($entitySet.EntityType)Collection> {
+  extends org.apache.olingo.ext.proxy.api.CollectionQuery<$javaEntityType, ${javaEntityType}Collection>, AbstractEntitySet<$javaEntityType, $type, ${javaEntityType}Collection> {
 
 #foreach( $dos in $utility.getDescendantsOrSelf($utility.getEdmType($entitySet)) )
     #set( $djt = $utility.getJavaType($dos) )

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
index 9cb2b52..73e1e63 100644
--- a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
+++ b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
@@ -31,7 +31,6 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
 import org.apache.olingo.ext.proxy.api.annotations.Property;
 import org.apache.olingo.ext.proxy.api.annotations.Operation;
 import org.apache.olingo.ext.proxy.api.annotations.Parameter;
-import org.apache.olingo.ext.proxy.api.Annotatable;
 import org.apache.olingo.ext.proxy.api.AbstractOpenType;
 import org.apache.olingo.ext.proxy.api.OperationType;
 import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
@@ -60,7 +59,12 @@ import org.apache.olingo.commons.api.edm.geo.Polygon;
         isAbstract = $entityType.Abstract#if($entityType.getBaseType()),
         baseType = "$entityType.getBaseType().getFullQualifiedName().toString()"#end)
 public interface $utility.capitalize($entityType.Name) 
-  extends Annotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{elseif}( $entityType.isOpenType() )AbstractOpenType#{else}java.io.Serializable#end {
+  extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($entityType.Name)>#end#{if}( $entityType.isOpenType() ),AbstractOpenType#end {
+
+#if( $entityType.getBaseType() )
+  @Override
+  $utility.capitalize($entityType.Name) load();
+#end
 
 #set( $keys = [] )
 #foreach($key in $entityType.KeyPropertyRefs)
@@ -200,7 +204,7 @@ public interface $utility.capitalize($entityType.Name)
     #set($property = $entityType.getProperty($propertyName))
         @org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty(name = "$property.Name",
                    type = "$property.Type.FullQualifiedName.toString()")
-        Annotatable get$utility.capitalize($property.Name)Annotations();
+        org.apache.olingo.ext.proxy.api.Annotatable get$utility.capitalize($property.Name)Annotations();
 
 #end
 
@@ -210,7 +214,7 @@ public interface $utility.capitalize($entityType.Name)
 
         @org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty(name = "$property.Name", 
                   type = "$type")
-        Annotatable get$utility.capitalize($property.Name)Annotations();
+        org.apache.olingo.ext.proxy.api.Annotatable get$utility.capitalize($property.Name)Annotations();
 #end
     }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm b/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm
index 3984259..6dcb92e 100644
--- a/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm
+++ b/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm
@@ -19,7 +19,12 @@
 @org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
 @org.apache.olingo.ext.proxy.api.annotations.ComplexType(name = "$complexType.Name")
 public interface $utility.capitalize($complexType.Name) 
-    extends #if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}java.io.Serializable#end {
+    extends org.apache.olingo.ext.proxy.api.StructuredType,#if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($complexType.Name)>#end {
+
+#if( $entityType.getBaseType() )
+  @Override
+  $utility.capitalize($complexType.Name) load();
+#end
 
 #set( $complexProps = [] )
 #foreach($propertyName in $complexType.PropertyNames)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm b/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm
index 8c15f88..0f5765f 100644
--- a/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm
+++ b/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm
@@ -22,7 +22,12 @@
         isAbstract = $complexType.Abstract#if($complexType.getBaseType()),
         baseType = "$complexType.getBaseType().getFullQualifiedName().toString()"#end)
 public interface $utility.capitalize($complexType.Name) 
-    extends #if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString()),#{end}#if( $complexType.isOpenType() )AbstractOpenType,#{end}java.io.Serializable {
+    extends org.apache.olingo.ext.proxy.api.StructuredType,#if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($complexType.Name)>#{end}#if( $complexType.isOpenType() ),AbstractOpenType#{end} {
+
+#if( $entityType.getBaseType() )
+  @Override
+  $utility.capitalize($complexType.Name) load();
+#end
 
 #set( $complexProps = [] )
 #set( $contained = [] )

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm b/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm
index cb45e6a..69d5c37 100644
--- a/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm
+++ b/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm
@@ -26,5 +26,5 @@
 #end
 
 @org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "$singleton.Name")
-public interface $utility.capitalize($singleton.Name) extends AbstractSingleton<$utility.getJavaType($singleton.EntityType), $type, $utility.getJavaType($singleton.EntityType)Collection> {
+public interface $utility.capitalize($singleton.Name) extends org.apache.olingo.ext.proxy.api.SingleQuery<$utility.getJavaType($singleton.EntityType)>,AbstractSingleton<$utility.getJavaType($singleton.EntityType), $type, $utility.getJavaType($singleton.EntityType)Collection> {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6587302a/fit/src/main/java/org/apache/olingo/fit/V3ActionOverloading.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V3ActionOverloading.java b/fit/src/main/java/org/apache/olingo/fit/V3ActionOverloading.java
index 9dd3130..01ba3bf 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V3ActionOverloading.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V3ActionOverloading.java
@@ -153,7 +153,7 @@ public class V3ActionOverloading extends V3Services {
   }
 
   @POST
-  @Path("/Product({entityId})/RetrieveProduct")
+  @Path("/Product({entityId})/{path:.*RetrieveProduct}")
   public Response productBoundRetrieveProduct(
       @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
       @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
@@ -197,7 +197,7 @@ public class V3ActionOverloading extends V3Services {
   }
 
   @POST
-  @Path("/OrderLine(OrderId={orderId},ProductId={productId})/RetrieveProduct")
+  @Path("/OrderLine(OrderId={orderId},ProductId={productId})/{path:.*RetrieveProduct}")
   public Response orderLineBoundRetrieveProduct(
       @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
       @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,