You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/07/26 12:22:00 UTC

[13/32] git commit: [OLINGO-366] provided operation invokers

[OLINGO-366] provided operation invokers


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

Branch: refs/heads/OLINGO-377-FIT
Commit: abb47659e4ff7ac077c1c4580abf4a74c7039e2d
Parents: e0b787e
Author: fmartelli <fa...@gmail.com>
Authored: Thu Jul 24 16:30:25 2014 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Thu Jul 24 16:30:25 2014 +0200

----------------------------------------------------------------------
 .../olingo/ext/proxy/api/AbstractEntitySet.java |   5 +-
 .../olingo/ext/proxy/api/AbstractSingleton.java |   2 +-
 .../olingo/ext/proxy/api/CollectionQuery.java   |  57 +---
 .../olingo/ext/proxy/api/CommonQuery.java       |  20 +-
 .../olingo/ext/proxy/api/ComplexCollection.java |   5 +-
 .../olingo/ext/proxy/api/ComplexType.java       |   2 +-
 .../olingo/ext/proxy/api/EntityCollection.java  |   5 +-
 .../apache/olingo/ext/proxy/api/EntitySet.java  |  59 ++++
 .../olingo/ext/proxy/api/EntitySetQuery.java    |  46 ---
 .../apache/olingo/ext/proxy/api/EntityType.java |   2 +-
 .../olingo/ext/proxy/api/GenericCollection.java |  41 +++
 .../apache/olingo/ext/proxy/api/Invoker.java    |  24 ++
 .../olingo/ext/proxy/api/OperationExecutor.java |   2 +-
 .../ext/proxy/api/PrimitiveCollection.java      |  39 +--
 .../proxy/api/PrimitiveCollectionInvoker.java   |  23 ++
 .../org/apache/olingo/ext/proxy/api/Search.java |   3 +-
 .../olingo/ext/proxy/api/SingleQuery.java       |  34 ---
 .../ext/proxy/api/StructuredCollection.java     |  43 +++
 .../proxy/api/StructuredCollectionInvoker.java  |  23 ++
 .../proxy/api/StructuredCollectionQuery.java    |  60 ++++
 .../olingo/ext/proxy/api/StructuredInvoker.java |  23 ++
 .../olingo/ext/proxy/api/StructuredQuery.java   |  38 +++
 .../olingo/ext/proxy/api/StructuredType.java    |  15 +-
 .../proxy/api/StruncturedCollectionQuery.java   |  40 ---
 .../ext/proxy/api/annotations/Operation.java    |   2 +
 ...stractEntityCollectionInvocationHandler.java |   5 +-
 .../commons/AbstractInvocationHandler.java      | 232 +--------------
 .../AbstractStructuredInvocationHandler.java    |  26 +-
 .../ComplexCollectionInvocationHandler.java     |   5 +-
 .../EntityCollectionInvocationHandler.java      |  11 +-
 .../EntityContainerInvocationHandler.java       |   8 +-
 .../commons/EntitySetInvocationHandler.java     |  22 +-
 .../ext/proxy/commons/EntitySetIterator.java    |   2 +-
 .../ext/proxy/commons/InvokerHandler.java       | 292 +++++++++++++++++++
 .../commons/OperationInvocationHandler.java     |  38 ++-
 .../olingo/ext/proxy/commons/SearchImpl.java    |   4 +-
 .../olingo/ext/proxy/utils/CoreUtils.java       |  23 +-
 .../olingo/ext/proxy/utils/ProxyUtils.java      | 139 +++++++++
 .../olingo/ext/pojogen/AbstractUtility.java     |   5 +
 .../src/main/resources/complexCollection.vm     |  48 +--
 .../src/main/resources/complexType.vm           |   9 +
 .../src/main/resources/container.vm             |  60 +++-
 .../src/main/resources/entityCollection.vm      |  48 +--
 .../src/main/resources/entitySet.vm             |  11 +-
 .../src/main/resources/entityType.vm            |  56 +---
 .../src/main/resources/operation.vm             | 112 +++++++
 .../src/main/resources/v30/complexType.vm       |   2 +-
 .../src/main/resources/v40/complexType.vm       |   2 +-
 .../proxy/v3/ActionOverloadingTestITCase.java   |  11 +-
 .../olingo/fit/proxy/v3/AsyncTestITCase.java    |   1 +
 .../fit/proxy/v3/EntityRetrieveTestITCase.java  |   1 +
 .../fit/proxy/v3/EntitySetTestITCase.java       |   1 +
 .../olingo/fit/proxy/v3/FilterTestITCase.java   |   1 +
 .../olingo/fit/proxy/v3/InvokeTestITCase.java   |  17 +-
 .../fit/proxy/v3/MediaEntityTestITCase.java     |   1 +
 .../fit/proxy/v3/PrimitiveKeysTestITCase.java   |   1 +
 .../olingo/fit/proxy/v3/PropertyTestITCase.java |   1 +
 .../fit/proxy/v3/actionoverloading/Service.java |   1 +
 .../AllGeoCollectionTypesSet.java               |   6 +-
 .../astoriadefaultservice/AllGeoTypesSet.java   |   6 +-
 .../services/astoriadefaultservice/Car.java     |   6 +-
 .../astoriadefaultservice/Computer.java         |   6 +-
 .../astoriadefaultservice/ComputerDetail.java   |   6 +-
 .../astoriadefaultservice/Customer.java         |   6 +-
 .../astoriadefaultservice/CustomerInfo.java     |   6 +-
 .../astoriadefaultservice/DefaultContainer.java |  21 +-
 .../services/astoriadefaultservice/Driver.java  |   6 +-
 .../astoriadefaultservice/LastLogin.java        |   6 +-
 .../services/astoriadefaultservice/License.java |   6 +-
 .../services/astoriadefaultservice/Login.java   |   6 +-
 .../astoriadefaultservice/MappedEntityType.java |   6 +-
 .../services/astoriadefaultservice/Message.java |   6 +-
 .../MessageAttachment.java                      |   6 +-
 .../services/astoriadefaultservice/Order.java   |   6 +-
 .../astoriadefaultservice/OrderLine.java        |   6 +-
 .../astoriadefaultservice/PageView.java         |   6 +-
 .../services/astoriadefaultservice/Person.java  |   6 +-
 .../astoriadefaultservice/PersonMetadata.java   |   6 +-
 .../services/astoriadefaultservice/Product.java |   6 +-
 .../astoriadefaultservice/ProductDetail.java    |   6 +-
 .../astoriadefaultservice/ProductPhoto.java     |   6 +-
 .../astoriadefaultservice/ProductReview.java    |   6 +-
 .../astoriadefaultservice/RSAToken.java         |   6 +-
 .../astoriadefaultservice/package-info.java     |   1 +
 .../astoriadefaultservice/types/Aliases.java    |   5 +-
 .../types/AliasesCollection.java                |   4 +-
 .../types/AllSpatialCollectionTypes.java        |   4 +-
 .../AllSpatialCollectionTypesCollection.java    |   4 +-
 .../types/AllSpatialCollectionTypes_Simple.java |   4 +-
 ...SpatialCollectionTypes_SimpleCollection.java |   4 +-
 .../types/AllSpatialTypes.java                  |   4 +-
 .../types/AllSpatialTypesCollection.java        |   4 +-
 .../astoriadefaultservice/types/AuditInfo.java  |   5 +-
 .../types/AuditInfoCollection.java              |   4 +-
 .../types/BackOrderLine.java                    |   6 +-
 .../types/BackOrderLine2.java                   |   6 +-
 .../types/BackOrderLine2Collection.java         |   4 +-
 .../types/BackOrderLineCollection.java          |   4 +-
 .../astoriadefaultservice/types/Car.java        |   4 +-
 .../types/CarCollection.java                    |   4 +-
 .../types/ComplexToCategory.java                |   5 +-
 .../types/ComplexToCategoryCollection.java      |   4 +-
 .../astoriadefaultservice/types/Computer.java   |   4 +-
 .../types/ComputerCollection.java               |   4 +-
 .../types/ComputerDetail.java                   |   4 +-
 .../types/ComputerDetailCollection.java         |   4 +-
 .../types/ConcurrencyInfo.java                  |   5 +-
 .../types/ConcurrencyInfoCollection.java        |   4 +-
 .../types/ContactDetails.java                   |   5 +-
 .../types/ContactDetailsCollection.java         |   4 +-
 .../astoriadefaultservice/types/Contractor.java |  11 +-
 .../types/ContractorCollection.java             |   4 +-
 .../astoriadefaultservice/types/Customer.java   |   4 +-
 .../types/CustomerCollection.java               |   4 +-
 .../types/CustomerInfo.java                     |   4 +-
 .../types/CustomerInfoCollection.java           |   4 +-
 .../astoriadefaultservice/types/Dimensions.java |   5 +-
 .../types/DimensionsCollection.java             |   4 +-
 .../types/DiscontinuedProduct.java              |   6 +-
 .../types/DiscontinuedProductCollection.java    |   4 +-
 .../astoriadefaultservice/types/Driver.java     |   4 +-
 .../types/DriverCollection.java                 |   4 +-
 .../astoriadefaultservice/types/Employee.java   |  18 +-
 .../types/EmployeeCollection.java               |  15 +-
 .../astoriadefaultservice/types/LastLogin.java  |   4 +-
 .../types/LastLoginCollection.java              |   4 +-
 .../astoriadefaultservice/types/License.java    |   4 +-
 .../types/LicenseCollection.java                |   4 +-
 .../astoriadefaultservice/types/Login.java      |   4 +-
 .../types/LoginCollection.java                  |   4 +-
 .../types/MappedEntityType.java                 |   4 +-
 .../types/MappedEntityTypeCollection.java       |   4 +-
 .../astoriadefaultservice/types/Message.java    |   4 +-
 .../types/MessageAttachment.java                |   4 +-
 .../types/MessageAttachmentCollection.java      |   4 +-
 .../types/MessageCollection.java                |   4 +-
 .../astoriadefaultservice/types/MessageKey.java |   1 +
 .../astoriadefaultservice/types/Order.java      |   4 +-
 .../types/OrderCollection.java                  |   4 +-
 .../astoriadefaultservice/types/OrderLine.java  |  13 +-
 .../types/OrderLineCollection.java              |   4 +-
 .../types/OrderLineKey.java                     |   1 +
 .../astoriadefaultservice/types/PageView.java   |   4 +-
 .../types/PageViewCollection.java               |   4 +-
 .../astoriadefaultservice/types/Person.java     |  11 +-
 .../types/PersonCollection.java                 |   4 +-
 .../types/PersonMetadata.java                   |   4 +-
 .../types/PersonMetadataCollection.java         |   4 +-
 .../astoriadefaultservice/types/Phone.java      |   5 +-
 .../types/PhoneCollection.java                  |   4 +-
 .../astoriadefaultservice/types/Product.java    |  13 +-
 .../types/ProductCollection.java                |   4 +-
 .../types/ProductDetail.java                    |   4 +-
 .../types/ProductDetailCollection.java          |   4 +-
 .../types/ProductPageView.java                  |   4 +-
 .../types/ProductPageViewCollection.java        |   4 +-
 .../types/ProductPhoto.java                     |   4 +-
 .../types/ProductPhotoCollection.java           |   4 +-
 .../types/ProductPhotoKey.java                  |   1 +
 .../types/ProductReview.java                    |   4 +-
 .../types/ProductReviewCollection.java          |   4 +-
 .../types/ProductReviewKey.java                 |   1 +
 .../astoriadefaultservice/types/RSAToken.java   |   4 +-
 .../types/RSATokenCollection.java               |   4 +-
 .../types/SpecialEmployee.java                  |  18 +-
 .../types/SpecialEmployeeCollection.java        |  15 +-
 .../types/package-info.java                     |   1 +
 .../olingo/fit/proxy/v3/opentype/Service.java   |   1 +
 .../opentypesservicev3/DefaultContainer.java    |   9 +-
 .../odata/services/opentypesservicev3/Row.java  |   6 +-
 .../services/opentypesservicev3/RowIndex.java   |   6 +-
 .../opentypesservicev3/package-info.java        |   1 +
 .../types/ContactDetails.java                   |   5 +-
 .../types/ContactDetailsCollection.java         |   4 +-
 .../opentypesservicev3/types/IndexedRow.java    |   4 +-
 .../types/IndexedRowCollection.java             |   4 +-
 .../services/opentypesservicev3/types/Row.java  |   4 +-
 .../opentypesservicev3/types/RowCollection.java |   4 +-
 .../opentypesservicev3/types/RowIndex.java      |   4 +-
 .../types/RowIndexCollection.java               |   4 +-
 .../opentypesservicev3/types/package-info.java  |   1 +
 .../fit/proxy/v3/primitivekeys/Service.java     |   1 +
 .../primitivekeysservice/EdmBinarySet.java      |   6 +-
 .../primitivekeysservice/EdmBooleanSet.java     |   6 +-
 .../primitivekeysservice/EdmByteSet.java        |   6 +-
 .../EdmDateTimeOffsetSet.java                   |   6 +-
 .../primitivekeysservice/EdmDateTimeSet.java    |   6 +-
 .../primitivekeysservice/EdmDecimalSet.java     |   6 +-
 .../primitivekeysservice/EdmDoubleSet.java      |   6 +-
 .../primitivekeysservice/EdmGuidSet.java        |   6 +-
 .../primitivekeysservice/EdmInt16Set.java       |   6 +-
 .../primitivekeysservice/EdmInt32Set.java       |   6 +-
 .../primitivekeysservice/EdmInt64Set.java       |   6 +-
 .../primitivekeysservice/EdmSingleSet.java      |   6 +-
 .../primitivekeysservice/EdmStringSet.java      |   6 +-
 .../primitivekeysservice/EdmTimeSet.java        |   6 +-
 .../services/primitivekeysservice/Folders.java  |   6 +-
 .../primitivekeysservice/TestContext.java       |   9 +-
 .../primitivekeysservice/package-info.java      |   1 +
 .../primitivekeysservice/types/EdmBinary.java   |   4 +-
 .../types/EdmBinaryCollection.java              |   4 +-
 .../primitivekeysservice/types/EdmBoolean.java  |   4 +-
 .../types/EdmBooleanCollection.java             |   4 +-
 .../primitivekeysservice/types/EdmByte.java     |   4 +-
 .../types/EdmByteCollection.java                |   4 +-
 .../primitivekeysservice/types/EdmDateTime.java |   4 +-
 .../types/EdmDateTimeCollection.java            |   4 +-
 .../types/EdmDateTimeOffset.java                |   4 +-
 .../types/EdmDateTimeOffsetCollection.java      |   4 +-
 .../primitivekeysservice/types/EdmDecimal.java  |   4 +-
 .../types/EdmDecimalCollection.java             |   4 +-
 .../primitivekeysservice/types/EdmDouble.java   |   4 +-
 .../types/EdmDoubleCollection.java              |   4 +-
 .../primitivekeysservice/types/EdmGuid.java     |   4 +-
 .../types/EdmGuidCollection.java                |   4 +-
 .../primitivekeysservice/types/EdmInt16.java    |   4 +-
 .../types/EdmInt16Collection.java               |   4 +-
 .../primitivekeysservice/types/EdmInt32.java    |   4 +-
 .../types/EdmInt32Collection.java               |   4 +-
 .../primitivekeysservice/types/EdmInt64.java    |   4 +-
 .../types/EdmInt64Collection.java               |   4 +-
 .../primitivekeysservice/types/EdmSingle.java   |   4 +-
 .../types/EdmSingleCollection.java              |   4 +-
 .../primitivekeysservice/types/EdmString.java   |   4 +-
 .../types/EdmStringCollection.java              |   4 +-
 .../primitivekeysservice/types/EdmTime.java     |   4 +-
 .../types/EdmTimeCollection.java                |   4 +-
 .../primitivekeysservice/types/Folder.java      |   4 +-
 .../types/FolderCollection.java                 |   4 +-
 .../types/package-info.java                     |   1 +
 .../fit/proxy/v3/staticservice/Service.java     |   1 +
 .../AllGeoCollectionTypesSet.java               |   6 +-
 .../astoriadefaultservice/AllGeoTypesSet.java   |   6 +-
 .../services/astoriadefaultservice/Car.java     |   6 +-
 .../astoriadefaultservice/Computer.java         |   6 +-
 .../astoriadefaultservice/ComputerDetail.java   |   6 +-
 .../astoriadefaultservice/Customer.java         |   6 +-
 .../astoriadefaultservice/CustomerInfo.java     |   6 +-
 .../astoriadefaultservice/DefaultContainer.java |  56 ++--
 .../services/astoriadefaultservice/Driver.java  |   6 +-
 .../astoriadefaultservice/LastLogin.java        |   6 +-
 .../services/astoriadefaultservice/License.java |   6 +-
 .../services/astoriadefaultservice/Login.java   |   6 +-
 .../astoriadefaultservice/MappedEntityType.java |   6 +-
 .../services/astoriadefaultservice/Message.java |   6 +-
 .../MessageAttachment.java                      |   6 +-
 .../services/astoriadefaultservice/Order.java   |   6 +-
 .../astoriadefaultservice/OrderLine.java        |   6 +-
 .../astoriadefaultservice/PageView.java         |   6 +-
 .../services/astoriadefaultservice/Person.java  |   6 +-
 .../astoriadefaultservice/PersonMetadata.java   |   6 +-
 .../services/astoriadefaultservice/Product.java |   6 +-
 .../astoriadefaultservice/ProductDetail.java    |   6 +-
 .../astoriadefaultservice/ProductPhoto.java     |   6 +-
 .../astoriadefaultservice/ProductReview.java    |   6 +-
 .../astoriadefaultservice/RSAToken.java         |   6 +-
 .../astoriadefaultservice/package-info.java     |   1 +
 .../astoriadefaultservice/types/Aliases.java    |   5 +-
 .../types/AliasesCollection.java                |   4 +-
 .../types/AllSpatialCollectionTypes.java        |   4 +-
 .../AllSpatialCollectionTypesCollection.java    |   4 +-
 .../types/AllSpatialCollectionTypes_Simple.java |   4 +-
 ...SpatialCollectionTypes_SimpleCollection.java |   4 +-
 .../types/AllSpatialTypes.java                  |   4 +-
 .../types/AllSpatialTypesCollection.java        |   4 +-
 .../astoriadefaultservice/types/AuditInfo.java  |   5 +-
 .../types/AuditInfoCollection.java              |   4 +-
 .../types/BackOrderLine.java                    |   4 +-
 .../types/BackOrderLine2.java                   |   4 +-
 .../types/BackOrderLine2Collection.java         |   4 +-
 .../types/BackOrderLineCollection.java          |   4 +-
 .../astoriadefaultservice/types/Car.java        |   4 +-
 .../types/CarCollection.java                    |   4 +-
 .../types/ComplexToCategory.java                |   5 +-
 .../types/ComplexToCategoryCollection.java      |   4 +-
 .../types/ComplexWithAllPrimitiveTypes.java     |   5 +-
 .../ComplexWithAllPrimitiveTypesCollection.java |   4 +-
 .../astoriadefaultservice/types/Computer.java   |  13 +-
 .../types/ComputerCollection.java               |   4 +-
 .../types/ComputerDetail.java                   |  11 +-
 .../types/ComputerDetailCollection.java         |   4 +-
 .../types/ConcurrencyInfo.java                  |   5 +-
 .../types/ConcurrencyInfoCollection.java        |   4 +-
 .../types/ContactDetails.java                   |   5 +-
 .../types/ContactDetailsCollection.java         |   4 +-
 .../astoriadefaultservice/types/Contractor.java |   4 +-
 .../types/ContractorCollection.java             |   4 +-
 .../astoriadefaultservice/types/Customer.java   |   4 +-
 .../types/CustomerCollection.java               |   4 +-
 .../types/CustomerInfo.java                     |   4 +-
 .../types/CustomerInfoCollection.java           |   4 +-
 .../astoriadefaultservice/types/Dimensions.java |   5 +-
 .../types/DimensionsCollection.java             |   4 +-
 .../types/DiscontinuedProduct.java              |   6 +-
 .../types/DiscontinuedProductCollection.java    |   4 +-
 .../astoriadefaultservice/types/Driver.java     |   4 +-
 .../types/DriverCollection.java                 |   4 +-
 .../astoriadefaultservice/types/Employee.java   |  11 +-
 .../types/EmployeeCollection.java               |  15 +-
 .../astoriadefaultservice/types/LastLogin.java  |   4 +-
 .../types/LastLoginCollection.java              |   4 +-
 .../astoriadefaultservice/types/License.java    |   4 +-
 .../types/LicenseCollection.java                |   4 +-
 .../astoriadefaultservice/types/Login.java      |   4 +-
 .../types/LoginCollection.java                  |   4 +-
 .../types/MappedEntityType.java                 |   4 +-
 .../types/MappedEntityTypeCollection.java       |   4 +-
 .../astoriadefaultservice/types/Message.java    |   4 +-
 .../types/MessageAttachment.java                |   4 +-
 .../types/MessageAttachmentCollection.java      |   4 +-
 .../types/MessageCollection.java                |   4 +-
 .../astoriadefaultservice/types/MessageKey.java |   1 +
 .../astoriadefaultservice/types/Order.java      |   4 +-
 .../types/OrderCollection.java                  |   4 +-
 .../astoriadefaultservice/types/OrderLine.java  |   4 +-
 .../types/OrderLineCollection.java              |   4 +-
 .../types/OrderLineKey.java                     |   1 +
 .../astoriadefaultservice/types/PageView.java   |   4 +-
 .../types/PageViewCollection.java               |   4 +-
 .../astoriadefaultservice/types/Person.java     |   4 +-
 .../types/PersonCollection.java                 |   4 +-
 .../types/PersonMetadata.java                   |   4 +-
 .../types/PersonMetadataCollection.java         |   4 +-
 .../astoriadefaultservice/types/Phone.java      |   5 +-
 .../types/PhoneCollection.java                  |   4 +-
 .../astoriadefaultservice/types/Product.java    |  11 +-
 .../types/ProductCollection.java                |   4 +-
 .../types/ProductDetail.java                    |   4 +-
 .../types/ProductDetailCollection.java          |   4 +-
 .../types/ProductPageView.java                  |   4 +-
 .../types/ProductPageViewCollection.java        |   4 +-
 .../types/ProductPhoto.java                     |   4 +-
 .../types/ProductPhotoCollection.java           |   4 +-
 .../types/ProductPhotoKey.java                  |   1 +
 .../types/ProductReview.java                    |   4 +-
 .../types/ProductReviewCollection.java          |   4 +-
 .../types/ProductReviewKey.java                 |   1 +
 .../astoriadefaultservice/types/RSAToken.java   |   4 +-
 .../types/RSATokenCollection.java               |   4 +-
 .../types/SpecialEmployee.java                  |   6 +-
 .../types/SpecialEmployeeCollection.java        |   4 +-
 .../types/package-info.java                     |   1 +
 .../fit/proxy/v4/APIBasicDesignTestITCase.java  |  43 ++-
 .../olingo/fit/proxy/v4/AsyncTestITCase.java    |   1 +
 .../proxy/v4/AuthEntityCreateTestITCase.java    |   1 +
 .../proxy/v4/AuthEntityRetrieveTestITCase.java  |   1 +
 .../v4/BoundOperationInvokeTestITCase.java      |  30 +-
 .../fit/proxy/v4/EntityRetrieveTestITCase.java  |   1 +
 .../fit/proxy/v4/EntitySetTestITCase.java       |   1 +
 .../olingo/fit/proxy/v4/FilterTestITCase.java   |   1 +
 .../fit/proxy/v4/KeyAsSegmentTestITCase.java    |   1 +
 ...TransactionalAuthEntityCreateTestITCase.java |   1 +
 .../NonTransactionalEntityCreateTestITCase.java |   1 +
 .../NonTransactionalEntityUpdateTestITCase.java |   1 +
 .../NonTransactionalMediaEntityTestITCase.java  |   1 +
 .../olingo/fit/proxy/v4/OpenTypeTestITCase.java |   1 +
 .../v4/OperationImportInvokeTestITCase.java     |  29 +-
 .../olingo/fit/proxy/v4/PropertyTestITCase.java |   1 +
 .../fit/proxy/v4/SingletonTestITCase.java       |   1 +
 .../v4/UnauthorizedEntityCreateTestITCase.java  |   1 +
 .../olingo/fit/proxy/v4/demo/Service.java       |   1 +
 .../proxy/v4/demo/odatademo/Advertisements.java |   6 +-
 .../fit/proxy/v4/demo/odatademo/Categories.java |   6 +-
 .../proxy/v4/demo/odatademo/DemoService.java    |  14 +-
 .../proxy/v4/demo/odatademo/PersonDetails.java  |   6 +-
 .../fit/proxy/v4/demo/odatademo/Persons.java    |   6 +-
 .../proxy/v4/demo/odatademo/ProductDetails.java |   6 +-
 .../fit/proxy/v4/demo/odatademo/Products.java   |   6 +-
 .../fit/proxy/v4/demo/odatademo/Suppliers.java  |   6 +-
 .../proxy/v4/demo/odatademo/package-info.java   |   1 +
 .../proxy/v4/demo/odatademo/types/Address.java  |   5 +-
 .../demo/odatademo/types/AddressCollection.java |   4 +-
 .../v4/demo/odatademo/types/Advertisement.java  |   4 +-
 .../types/AdvertisementCollection.java          |   4 +-
 .../proxy/v4/demo/odatademo/types/Category.java |   4 +-
 .../odatademo/types/CategoryCollection.java     |   4 +-
 .../proxy/v4/demo/odatademo/types/Customer.java |   4 +-
 .../odatademo/types/CustomerCollection.java     |   4 +-
 .../proxy/v4/demo/odatademo/types/Employee.java |   4 +-
 .../odatademo/types/EmployeeCollection.java     |   4 +-
 .../demo/odatademo/types/FeaturedProduct.java   |   6 +-
 .../types/FeaturedProductCollection.java        |   4 +-
 .../proxy/v4/demo/odatademo/types/Person.java   |   4 +-
 .../demo/odatademo/types/PersonCollection.java  |   4 +-
 .../v4/demo/odatademo/types/PersonDetail.java   |   4 +-
 .../odatademo/types/PersonDetailCollection.java |   4 +-
 .../proxy/v4/demo/odatademo/types/Product.java  |  13 +-
 .../demo/odatademo/types/ProductCollection.java |   4 +-
 .../v4/demo/odatademo/types/ProductDetail.java  |   4 +-
 .../types/ProductDetailCollection.java          |   4 +-
 .../proxy/v4/demo/odatademo/types/Supplier.java |   4 +-
 .../odatademo/types/SupplierCollection.java     |   4 +-
 .../v4/demo/odatademo/types/package-info.java   |   1 +
 .../olingo/fit/proxy/v4/opentype/Service.java   |   1 +
 .../opentypesservicev4/DefaultContainer.java    |   9 +-
 .../odata/services/opentypesservicev4/Row.java  |   6 +-
 .../services/opentypesservicev4/RowIndex.java   |   6 +-
 .../opentypesservicev4/package-info.java        |   1 +
 .../opentypesservicev4/types/AccountInfo.java   |   5 +-
 .../types/AccountInfoCollection.java            |   4 +-
 .../opentypesservicev4/types/Color.java         |   1 +
 .../types/ContactDetails.java                   |   5 +-
 .../types/ContactDetailsCollection.java         |   4 +-
 .../opentypesservicev4/types/IndexedRow.java    |   4 +-
 .../types/IndexedRowCollection.java             |   4 +-
 .../services/opentypesservicev4/types/Row.java  |   4 +-
 .../opentypesservicev4/types/RowCollection.java |   4 +-
 .../opentypesservicev4/types/RowIndex.java      |   4 +-
 .../types/RowIndexCollection.java               |   4 +-
 .../opentypesservicev4/types/package-info.java  |   1 +
 .../fit/proxy/v4/staticservice/Service.java     |   1 +
 .../services/odatawcfservice/Accounts.java      |   6 +-
 .../services/odatawcfservice/Customers.java     |   6 +-
 .../services/odatawcfservice/Departments.java   |   6 +-
 .../services/odatawcfservice/Employees.java     |   6 +-
 .../odatawcfservice/InMemoryEntities.java       |  75 +++--
 .../services/odatawcfservice/OrderDetails.java  |   6 +-
 .../odata/services/odatawcfservice/Orders.java  |   6 +-
 .../odata/services/odatawcfservice/People.java  |   6 +-
 .../odatawcfservice/ProductDetails.java         |   6 +-
 .../odatawcfservice/ProductReviews.java         |   6 +-
 .../services/odatawcfservice/Products.java      |   6 +-
 .../services/odatawcfservice/StoredPIs.java     |   6 +-
 .../odatawcfservice/SubscriptionTemplates.java  |   6 +-
 .../services/odatawcfservice/package-info.java  |   1 +
 .../odatawcfservice/types/AccessLevel.java      |   1 +
 .../services/odatawcfservice/types/Account.java |  35 ++-
 .../types/AccountCollection.java                |   4 +-
 .../odatawcfservice/types/AccountInfo.java      |   5 +-
 .../types/AccountInfoCollection.java            |   4 +-
 .../services/odatawcfservice/types/Address.java |   5 +-
 .../types/AddressCollection.java                |   4 +-
 .../services/odatawcfservice/types/Asset.java   |   4 +-
 .../odatawcfservice/types/AssetCollection.java  |   4 +-
 .../services/odatawcfservice/types/Club.java    |   4 +-
 .../odatawcfservice/types/ClubCollection.java   |   4 +-
 .../services/odatawcfservice/types/Color.java   |   1 +
 .../services/odatawcfservice/types/Company.java |  20 +-
 .../odatawcfservice/types/CompanyAddress.java   |   5 +-
 .../types/CompanyAddressCollection.java         |   4 +-
 .../odatawcfservice/types/CompanyCategory.java  |   1 +
 .../types/CompanyCollection.java                |   4 +-
 .../odatawcfservice/types/CreditCardPI.java     |   8 +-
 .../types/CreditCardPICollection.java           |   4 +-
 .../odatawcfservice/types/CreditRecord.java     |   4 +-
 .../types/CreditRecordCollection.java           |   4 +-
 .../odatawcfservice/types/Customer.java         |   6 +-
 .../types/CustomerCollection.java               |   4 +-
 .../odatawcfservice/types/Department.java       |   4 +-
 .../types/DepartmentCollection.java             |   4 +-
 .../odatawcfservice/types/Employee.java         |   6 +-
 .../types/EmployeeCollection.java               |   4 +-
 .../odatawcfservice/types/GiftCard.java         |  13 +-
 .../types/GiftCardCollection.java               |   4 +-
 .../odatawcfservice/types/HomeAddress.java      |   5 +-
 .../types/HomeAddressCollection.java            |   4 +-
 .../services/odatawcfservice/types/IsBoss.java  |   1 +
 .../odatawcfservice/types/LabourUnion.java      |   4 +-
 .../types/LabourUnionCollection.java            |   4 +-
 .../services/odatawcfservice/types/Order.java   |   4 +-
 .../odatawcfservice/types/OrderCollection.java  |   4 +-
 .../odatawcfservice/types/OrderDetail.java      |   4 +-
 .../types/OrderDetailCollection.java            |   4 +-
 .../odatawcfservice/types/OrderDetailKey.java   |   1 +
 .../types/PaymentInstrument.java                |   8 +-
 .../types/PaymentInstrumentCollection.java      |   4 +-
 .../services/odatawcfservice/types/Person.java  |  20 +-
 .../odatawcfservice/types/PersonCollection.java |   4 +-
 .../services/odatawcfservice/types/Product.java |  20 +-
 .../types/ProductCollection.java                |  17 +-
 .../odatawcfservice/types/ProductDetail.java    |  13 +-
 .../types/ProductDetailCollection.java          |   4 +-
 .../odatawcfservice/types/ProductDetailKey.java |   1 +
 .../odatawcfservice/types/ProductReview.java    |   4 +-
 .../types/ProductReviewCollection.java          |   4 +-
 .../odatawcfservice/types/ProductReviewKey.java |   1 +
 .../odatawcfservice/types/PublicCompany.java    |  10 +-
 .../types/PublicCompanyCollection.java          |   4 +-
 .../odatawcfservice/types/Statement.java        |   4 +-
 .../types/StatementCollection.java              |   4 +-
 .../odatawcfservice/types/StoredPI.java         |   4 +-
 .../types/StoredPICollection.java               |   4 +-
 .../odatawcfservice/types/Subscription.java     |   4 +-
 .../types/SubscriptionCollection.java           |   4 +-
 .../odatawcfservice/types/package-info.java     |   1 +
 .../invoke/v4/ODataInvokeRequestImpl.java       |   8 +-
 486 files changed, 2813 insertions(+), 1281 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractEntitySet.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractEntitySet.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractEntitySet.java
index 8bf3aa2..57ad175 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractEntitySet.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractEntitySet.java
@@ -19,12 +19,13 @@
 package org.apache.olingo.ext.proxy.api;
 
 import java.io.Serializable;
+import java.util.Collection;
 
 /**
  * Interface for synchronous CRUD operations on an EntitySet.
  */
 public interface AbstractEntitySet<
-        T extends EntityType, KEY extends Serializable, EC extends EntityCollection<T>>
+        T extends EntityType<?>, KEY extends Serializable, EC extends Collection<T>>
         extends Iterable<T>, Serializable {
 
   boolean add(final T entity);
@@ -104,5 +105,5 @@ public interface AbstractEntitySet<
    * @param reference
    * @return the new search instance
    */
-  <S extends T, SEC extends EntityCollection<S>> Search<S, SEC> createSearch(Class<SEC> reference);
+  <S extends T, SEC extends EntityCollection<S, ?, ?>> Search<S, SEC> createSearch(Class<SEC> reference);
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractSingleton.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractSingleton.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractSingleton.java
index f035292..5351a60 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractSingleton.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractSingleton.java
@@ -21,6 +21,6 @@ package org.apache.olingo.ext.proxy.api;
 import java.io.Serializable;
 
 public interface AbstractSingleton<
-        T extends EntityType, KEY extends Serializable, EC extends EntityCollection<T>>
+        T extends EntityType<?>, KEY extends Serializable, EC extends EntityCollection<T, ?, ?>>
         extends Serializable {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/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
index d66cbbd..1c75af6 100644
--- 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
@@ -18,62 +18,7 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-import java.util.Collection;
-import java.util.concurrent.Future;
-import org.apache.olingo.client.api.uri.URIFilter;
-
-public interface CollectionQuery<
-        T extends StructuredType, EC extends Collection<T>, CT extends CollectionQuery<T, EC, ?>>
-        extends CommonQuery<CollectionQuery<T, EC, CT>> {
-
-  /**
-   * Returns all instances.
-   *
-   * @return all instances
-   */
-  EC execute();
-
-  /**
-   * Asynchronously returns all instances.
-   *
-   * @return future handle on all instances
-   */
-  Future<EC> executeAsync();
-
-  /**
-   * Sets the <tt>$filter</tt> expression.
-   * <br/>
-   * Any of available operators and functions can be embodied here.
-   *
-   * @param filter the <tt>$filter</tt> expression.
-   * @return the same query instance.
-   */
-  CT filter(String filter);
-
-  /**
-   * Sets the filter generating the <tt>$filter</tt> expression.
-   *
-   * @param filter filter instance (to be obtained via factory): note that <tt>build()</tt> method will be immediately
-   * invoked.
-   * @return the same query instance.
-   */
-  CT filter(URIFilter filter);
-
-  /**
-   * Sets the <tt>$orderBy</tt> expression.
-   *
-   * @param sort sort options.
-   * @return the same query instance.
-   */
-  CT orderBy(Sort... sort);
-
-  /**
-   * Sets the <tt>$orderBy</tt> expression.
-   *
-   * @param orderBy the <tt>$orderBy</tt> expression.
-   * @return the same query instance.
-   */
-  CT orderBy(String orderBy);
+public interface CollectionQuery<CT extends CollectionQuery<?>> extends CommonQuery {
 
   /**
    * Sets the maximum number of results to retrieve (<tt>$top</tt>).

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CommonQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CommonQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CommonQuery.java
index 939d34b..4caf3ca 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CommonQuery.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/CommonQuery.java
@@ -18,28 +18,12 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-public interface CommonQuery<T> {
-
-  /**
-   * Sets <tt>$expand</tt> expression.
-   *
-   * @param expand <tt>$expand</tt> expression items.
-   * @return the same query instance.
-   */
-  T expand(String... expand);
-
-  /**
-   * Sets <tt>$select</tt> expression.
-   *
-   * @param select <tt>$select</tt> expression items.
-   * @return the same query instance.
-   */
-  T select(String... select);
+public interface CommonQuery {
 
   /**
    * Remove all query options.
    *
    * @return the same query instance.
    */
-  T clearQueryOptions();
+  void clearQueryOptions();
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexCollection.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexCollection.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexCollection.java
index 2f381a1..38a6ef1 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexCollection.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexCollection.java
@@ -18,8 +18,9 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-import java.io.Serializable;
 import java.util.Collection;
 
-public interface ComplexCollection<T extends ComplexType> extends Collection<T>, Serializable {
+public interface ComplexCollection<
+        T extends StructuredType<?>, EC extends Collection<T>, CT extends StructuredCollection<T, EC, ?>>
+        extends StructuredCollection<T, EC, CT> {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexType.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexType.java
index 37d5b2d..50ef723 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexType.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ComplexType.java
@@ -18,5 +18,5 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-public interface ComplexType extends StructuredType {
+public interface ComplexType<T extends StructuredType<?>> extends StructuredType<T> {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityCollection.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityCollection.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityCollection.java
index 449c3e6..587b9f1 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityCollection.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityCollection.java
@@ -18,8 +18,9 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-import java.io.Serializable;
 import java.util.Collection;
 
-public interface EntityCollection<T extends EntityType> extends Collection<T>, Serializable {
+public interface EntityCollection<
+        T extends StructuredType<?>, EC extends Collection<T>, CT extends StructuredCollection<T, EC, ?>>
+        extends StructuredCollection<T, EC, CT> {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySet.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySet.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySet.java
new file mode 100644
index 0000000..a6cf16d
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySet.java
@@ -0,0 +1,59 @@
+/*
+ * 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.util.Collection;
+import java.util.concurrent.Future;
+
+public interface EntitySet<T extends EntityType<?>, EC extends Collection<T>> {
+
+  /**
+   * Returns all instances of the given subtype.
+   *
+   * @param <S>
+   * @param <SEC>
+   * @param reference entity collection class to be returned
+   * @return all entities of the given subtype
+   */
+  <S extends T, SEC extends EntityCollection<S, ?, ?>> SEC execute(Class<SEC> reference);
+
+  /**
+   * Asynchronously returns all instances of the given subtype.
+   *
+   * @param <S>
+   * @param <SEC>
+   * @param reference entity collection class to be returned
+   * @return future handle on all entities of the given subtype
+   */
+  <S extends T, SEC extends EntityCollection<S, ?, ?>> Future<SEC> executeAsync(Class<SEC> reference);
+
+  /**
+   * Returns all instances.
+   *
+   * @return all instances
+   */
+  EC execute();
+
+  /**
+   * Asynchronously returns all instances.
+   *
+   * @return future handle on all instances
+   */
+  Future<EC> executeAsync();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySetQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySetQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySetQuery.java
deleted file mode 100644
index 31a72ee..0000000
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntitySetQuery.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.util.concurrent.Future;
-
-public interface EntitySetQuery<
-        T extends EntityType, EC extends EntityCollection<T>, CT extends EntitySetQuery<T, EC, ?>>
-        extends CollectionQuery<T, EC, CT> {
-
-  /**
-   * Returns all instances of the given subtype.
-   *
-   * @param <S>
-   * @param <SEC>
-   * @param reference entity collection class to be returned
-   * @return all entities of the given subtype
-   */
-  <S extends T, SEC extends EntityCollection<S>> SEC execute(Class<SEC> reference);
-
-  /**
-   * Asynchronously returns all instances of the given subtype.
-   *
-   * @param <S>
-   * @param <SEC>
-   * @param reference entity collection class to be returned
-   * @return future handle on all entities of the given subtype
-   */
-  <S extends T, SEC extends EntityCollection<S>> Future<SEC> executeAsync(Class<SEC> reference);
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityType.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityType.java
index 84336c1..45f375d 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityType.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EntityType.java
@@ -18,5 +18,5 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
-public interface EntityType extends StructuredType {
+public interface EntityType<T extends StructuredType<?>> extends StructuredType<T> {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/GenericCollection.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/GenericCollection.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/GenericCollection.java
new file mode 100644
index 0000000..94ccafb
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/GenericCollection.java
@@ -0,0 +1,41 @@
+/*
+ * 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;
+import java.util.Collection;
+import java.util.concurrent.Future;
+
+public interface GenericCollection<T extends Serializable, C extends Collection<T>>
+        extends Collection<T>, Serializable {
+
+  /**
+   * Returns all instances.
+   *
+   * @return all instances
+   */
+  C execute();
+
+  /**
+   * Asynchronously returns all instances.
+   *
+   * @return future handle on all instances
+   */
+  Future<C> executeAsync();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Invoker.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Invoker.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Invoker.java
new file mode 100644
index 0000000..520cdea
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Invoker.java
@@ -0,0 +1,24 @@
+/*
+ * 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 Invoker<T> {
+
+  T execute();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/OperationExecutor.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/OperationExecutor.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/OperationExecutor.java
index 6914e7a..6010d11 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/OperationExecutor.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/OperationExecutor.java
@@ -21,7 +21,7 @@ package org.apache.olingo.ext.proxy.api;
 import java.io.Serializable;
 
 /**
- * Interface for synchronous CRUD operations on an EntitySet.
+ * Interface for operation executions.
  */
 public interface OperationExecutor extends Serializable {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollection.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollection.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollection.java
index 93d479e..4ec4a54 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollection.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollection.java
@@ -20,39 +20,10 @@ package org.apache.olingo.ext.proxy.api;
 
 import java.io.Serializable;
 import java.util.Collection;
-import java.util.concurrent.Future;
 
-public interface PrimitiveCollection<T extends Serializable> extends Collection<T>, Serializable {
-
-  /**
-   * Returns all instances.
-   *
-   * @return all instances
-   */
-  PrimitiveCollection<T> execute();
-
-  /**
-   * Asynchronously returns all instances.
-   *
-   * @return future handle on all instances
-   */
-  Future<PrimitiveCollection<T>> executeAsync();
-
-  /**
-   * Sets the maximum number of results to retrieve (<tt>$top</tt>).
-   *
-   * @param top maximum number of results to retrieve
-   * @return the same query instance.
-   * @throws IllegalArgumentException if the argument is negative
-   */
-  PrimitiveCollection<T> top(int top) throws IllegalArgumentException;
-
-  /**
-   * Sets the position of the first result to retrieve (<tt>$skip</tt>).
-   *
-   * @param skip position of the first result, numbered from 0
-   * @return the same query instance.
-   * @throws IllegalArgumentException if the argument is negative
-   */
-  PrimitiveCollection<T> skip(int skip) throws IllegalArgumentException;
+public interface PrimitiveCollection<T extends Serializable>
+        extends GenericCollection<T, PrimitiveCollection<T>>,
+        CollectionQuery<PrimitiveCollection<T>>,
+        Collection<T>,
+        Serializable {
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollectionInvoker.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollectionInvoker.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollectionInvoker.java
new file mode 100644
index 0000000..7c5683f
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PrimitiveCollectionInvoker.java
@@ -0,0 +1,23 @@
+/*
+ * 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 PrimitiveCollectionInvoker<T extends CollectionQuery<?>>
+        extends CollectionQuery<PrimitiveCollectionInvoker<T>>, Invoker<T> {
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Search.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Search.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Search.java
index 3d0a56a..2359653 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Search.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/Search.java
@@ -21,6 +21,7 @@ package org.apache.olingo.ext.proxy.api;
 import org.apache.olingo.client.api.uri.v4.URISearch;
 
 import java.io.Serializable;
+import java.util.Collection;
 
 /**
  * Interface used to control search execution.
@@ -28,7 +29,7 @@ import java.io.Serializable;
  * @param <T> search result type
  * @param <EC>
  */
-public interface Search<T extends EntityType, EC extends EntityCollection<T>> extends Serializable {
+public interface Search<T extends EntityType<?>, EC extends Collection<T>> extends Serializable {
 
   /**
    * Sets the <tt>$search</tt> expression for this search.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/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
deleted file mode 100644
index 40c2a4c..0000000
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/SingleQuery.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.util.concurrent.Future;
-
-public interface SingleQuery<T extends StructuredType> extends CommonQuery<T> {
-
-  /**
-   * @return structured type instance
-   */
-  T load();
-
-  /**
-   * @return future handle on structured type instance
-   */
-  Future<T> loadAsync();
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollection.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollection.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollection.java
new file mode 100644
index 0000000..ad30dcc
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollection.java
@@ -0,0 +1,43 @@
+/*
+ * 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.util.Collection;
+
+/**
+ * Marker interface for Entity and complex type.
+ */
+public interface StructuredCollection<
+        T extends StructuredType<?>, EC extends Collection<T>, CT extends StructuredCollection<T, EC, ?>>
+        extends GenericCollection<T, EC>, java.io.Serializable {
+
+  /**
+   * Explicit paging result handling.
+   *
+   * @return next page.
+   */
+  CT nextPage();
+
+  /**
+   * Checks for next page existence.
+   *
+   * @return <<tt>TRUE</tt> whether a next page exist; <tt>FALSE</tt> otherwise.
+   */
+  boolean hasNextPage();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionInvoker.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionInvoker.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionInvoker.java
new file mode 100644
index 0000000..a8b217d
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionInvoker.java
@@ -0,0 +1,23 @@
+/*
+ * 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 StructuredCollectionInvoker<CT extends StructuredCollectionQuery<?>>
+        extends StructuredCollectionQuery<StructuredCollectionInvoker<CT>>, Invoker<CT> {
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionQuery.java
new file mode 100644
index 0000000..9868a18
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredCollectionQuery.java
@@ -0,0 +1,60 @@
+/*
+ * 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 org.apache.olingo.client.api.uri.URIFilter;
+
+public interface StructuredCollectionQuery<CT extends StructuredCollectionQuery<?>>
+        extends StructuredQuery<CT>, CollectionQuery<CT> {
+
+  /**
+   * Sets the <tt>$filter</tt> expression.
+   * <br/>
+   * Any of available operators and functions can be embodied here.
+   *
+   * @param filter the <tt>$filter</tt> expression.
+   * @return the same query instance.
+   */
+  CT filter(String filter);
+
+  /**
+   * Sets the filter generating the <tt>$filter</tt> expression.
+   *
+   * @param filter filter instance (to be obtained via factory): note that <tt>build()</tt> method will be immediately
+   * invoked.
+   * @return the same query instance.
+   */
+  CT filter(URIFilter filter);
+
+  /**
+   * Sets the <tt>$orderBy</tt> expression.
+   *
+   * @param sort sort options.
+   * @return the same query instance.
+   */
+  CT orderBy(Sort... sort);
+
+  /**
+   * Sets the <tt>$orderBy</tt> expression.
+   *
+   * @param orderBy the <tt>$orderBy</tt> expression.
+   * @return the same query instance.
+   */
+  CT orderBy(String orderBy);
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredInvoker.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredInvoker.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredInvoker.java
new file mode 100644
index 0000000..b31f52c
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredInvoker.java
@@ -0,0 +1,23 @@
+/*
+ * 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 StructuredInvoker<T extends StructuredQuery<?>>
+        extends StructuredQuery<StructuredInvoker<T>>, Invoker<T> {
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredQuery.java
new file mode 100644
index 0000000..8a94fcd
--- /dev/null
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredQuery.java
@@ -0,0 +1,38 @@
+/*
+ * 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 StructuredQuery<T extends CommonQuery> extends CommonQuery {
+
+  /**
+   * Sets <tt>$expand</tt> expression.
+   *
+   * @param expand <tt>$expand</tt> expression items.
+   * @return the same query instance.
+   */
+  T expand(String... expand);
+
+  /**
+   * Sets <tt>$select</tt> expression.
+   *
+   * @param select <tt>$select</tt> expression items.
+   * @return the same query instance.
+   */
+  T select(String... select);
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/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
index d1c7083..106c53e 100644
--- 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
@@ -18,10 +18,23 @@
  */
 package org.apache.olingo.ext.proxy.api;
 
+import java.io.Serializable;
+import java.util.concurrent.Future;
+
 /**
  * Marker interface for Entity and complex type.
  */
-public interface StructuredType extends java.io.Serializable {
+public interface StructuredType<T> extends Serializable {
+
+  /**
+   * @return structured type instance
+   */
+  T load();
+
+  /**
+   * @return future handle on structured type instance
+   */
+  Future<T> loadAsync();
 
   /**
    * Delete object.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StruncturedCollectionQuery.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StruncturedCollectionQuery.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StruncturedCollectionQuery.java
deleted file mode 100644
index bd0db91..0000000
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StruncturedCollectionQuery.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.util.Collection;
-
-public interface StruncturedCollectionQuery<
-        T extends StructuredType, EC extends Collection<T>, CT extends StruncturedCollectionQuery<T, EC, ?>>
-        extends CollectionQuery<T, EC, CT> {
-
-  /**
-   * Explicit paging result handling.
-   *
-   * @return next page.
-   */
-  CT nextPage();
-
-  /**
-   * Checks for next page existence.
-   *
-   * @return <<tt>TRUE</tt> whether a next page exist; <tt>FALSE</tt> otherwise.
-   */
-  boolean hasNextPage();
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java
index 66b7b30..0611b79 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Operation.java
@@ -34,6 +34,8 @@ public @interface Operation {
 
   String name();
 
+  Class<?> referenceType() default Void.class;
+
   /**
    * Operation type, function or action.
    *

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractEntityCollectionInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractEntityCollectionInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractEntityCollectionInvocationHandler.java
index 2e58212..9a15c78 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractEntityCollectionInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractEntityCollectionInvocationHandler.java
@@ -42,7 +42,8 @@ import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
 import org.apache.olingo.ext.proxy.api.EntityType;
 import org.apache.olingo.ext.proxy.utils.ClassUtils;
 
-public abstract class AbstractEntityCollectionInvocationHandler<T extends EntityType, EC extends EntityCollection<T>>
+public abstract class AbstractEntityCollectionInvocationHandler<
+        T extends EntityType<?>, EC extends EntityCollection<T, ?, ?>>
         extends AbstractCollectionInvocationHandler<T, EC> {
 
   private static final long serialVersionUID = 98078202642671727L;
@@ -79,7 +80,7 @@ public abstract class AbstractEntityCollectionInvocationHandler<T extends Entity
 
   @SuppressWarnings("unchecked")
   public AbstractEntityCollectionInvocationHandler(
-          final Class<? extends EntityCollection<T>> ref,
+          final Class<? extends EntityCollection<T, ?, ?>> ref,
           final AbstractService<?> service,
           final URI targetEntitySetURI,
           final CommonURIBuilder<?> uri) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/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 2f5276d..cde3fc7 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
@@ -22,48 +22,26 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Proxy;
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
-import org.apache.olingo.client.api.communication.request.invoke.ODataNoContent;
-import org.apache.olingo.client.api.http.HttpMethod;
 import org.apache.olingo.client.api.uri.CommonURIBuilder;
-import org.apache.olingo.commons.api.domain.CommonODataEntity;
-import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
-import org.apache.olingo.commons.api.domain.CommonODataProperty;
-import org.apache.olingo.commons.api.domain.ODataInvokeResult;
 import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.commons.api.edm.EdmFunction;
-import org.apache.olingo.commons.api.edm.EdmOperation;
-import org.apache.olingo.commons.api.edm.EdmReturnType;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.commons.core.edm.EdmTypeInfo;
 import org.apache.olingo.ext.proxy.AbstractService;
-import org.apache.olingo.ext.proxy.api.ComplexCollection;
 import org.apache.olingo.ext.proxy.api.ComplexType;
-import org.apache.olingo.ext.proxy.api.OperationType;
-import org.apache.olingo.ext.proxy.api.PrimitiveCollection;
 import org.apache.olingo.ext.proxy.api.annotations.EntitySet;
-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.annotations.Singleton;
 import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
 import org.apache.olingo.ext.proxy.context.Context;
-import org.apache.olingo.ext.proxy.utils.ClassUtils;
 import org.apache.olingo.ext.proxy.utils.CoreUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -109,213 +87,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
     return getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(this, args);
   }
 
-  @SuppressWarnings({"unchecked", "rawtypes"})
-  protected Object getEntityCollectionProxy(
-          final Class<?> typeRef,
-          final Class<?> typeCollectionRef,
-          final URI targetEntitySetURI,
-          final CommonODataEntitySet entitySet,
-          final URI uri,
-          final boolean checkInTheContext) {
-
-    final List<Object> items = new ArrayList<Object>();
-
-    if (entitySet != null) {
-      for (CommonODataEntity entityFromSet : entitySet.getEntities()) {
-        items.add(getEntityProxy(entityFromSet, uri, typeRef, null, checkInTheContext));
-      }
-    }
-
-    return Proxy.newProxyInstance(
-            Thread.currentThread().getContextClassLoader(),
-            new Class<?>[] {typeCollectionRef},
-            new EntityCollectionInvocationHandler(service, items, typeCollectionRef, targetEntitySetURI,
-            uri == null ? null : getClient().newURIBuilder(uri.toASCIIString())));
-  }
-
-  protected Object getEntitySetProxy(
-          final Class<?> typeRef,
-          final URI uri) {
-
-    return Proxy.newProxyInstance(
-            Thread.currentThread().getContextClassLoader(),
-            new Class<?>[] {typeRef},
-            EntitySetInvocationHandler.getInstance(typeRef, service, uri));
-  }
-
-  protected Object getEntityProxy(
-          final CommonODataEntity entity,
-          final URI entitySetURI,
-          final Class<?> type,
-          final String eTag,
-          final boolean checkInTheContext) {
-
-    EntityInvocationHandler handler = EntityInvocationHandler.getInstance(entity, entitySetURI, type, service);
-
-    if (StringUtils.isNotBlank(eTag)) {
-      // override ETag into the wrapped object.
-      handler.setETag(eTag);
-    }
-
-    if (checkInTheContext && getContext().entityContext().isAttached(handler)) {
-      handler = getContext().entityContext().getEntity(handler.getUUID());
-      handler.setEntity(entity);
-    }
-
-    return Proxy.newProxyInstance(
-            Thread.currentThread().getContextClassLoader(),
-            new Class<?>[] {type},
-            handler);
-  }
-
-  @SuppressWarnings("unchecked")
-  private <RES extends ODataInvokeResult> Class<RES> getResultReference(final EdmReturnType returnType) {
-    Class<RES> result;
-
-    if (returnType == null) {
-      result = (Class<RES>) ODataNoContent.class;
-    } else {
-      if (returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) {
-        result = (Class<RES>) CommonODataEntitySet.class;
-      } else if (!returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) {
-        result = (Class<RES>) CommonODataEntity.class;
-      } else {
-        result = (Class<RES>) CommonODataProperty.class;
-      }
-    }
-
-    return result;
-  }
-
-  @SuppressWarnings({"unchecked", "rawtypes"})
-  protected Object invokeOperation(
-          final Operation annotation,
-          final Method method,
-          final LinkedHashMap<Parameter, Object> parameters,
-          final URI target,
-          final EdmOperation edmOperation)
-          throws InstantiationException, IllegalAccessException, NoSuchMethodException,
-          IllegalArgumentException, InvocationTargetException {
-
-    // 1. invoke params (if present)
-    final Map<String, ODataValue> parameterValues = new LinkedHashMap<String, ODataValue>();
-    if (!parameters.isEmpty()) {
-      for (Map.Entry<Parameter, Object> parameter : parameters.entrySet()) {
-
-        if (!parameter.getKey().nullable() && parameter.getValue() == null) {
-          throw new IllegalArgumentException(
-                  "Parameter " + parameter.getKey().name() + " is not nullable but a null value was provided");
-        }
-
-        final EdmTypeInfo type = new EdmTypeInfo.Builder().
-                setEdm(getClient().getCachedEdm()).setTypeExpression(parameter.getKey().type()).build();
-
-        final ODataValue paramValue = parameter.getValue() == null
-                ? null
-                : CoreUtils.getODataValue(getClient(), type, parameter.getValue());
-
-        parameterValues.put(parameter.getKey().name(), paramValue);
-      }
-    }
-
-    // 2. IMPORTANT: flush any pending change *before* invoke if this operation is side effecting
-    if (annotation.type() == OperationType.ACTION) {
-      service.getPersistenceManager().flush();
-    }
-
-    // 3. invoke
-    final ODataInvokeResult result = getClient().getInvokeRequestFactory().getInvokeRequest(
-            edmOperation instanceof EdmFunction ? HttpMethod.GET : HttpMethod.POST,
-            target,
-            getResultReference(edmOperation.getReturnType()),
-            parameterValues).
-            execute().getBody();
-
-    // 4. process invoke result
-    if (StringUtils.isBlank(annotation.returnType())) {
-      return ClassUtils.returnVoid();
-    }
-
-    final EdmTypeInfo edmType = new EdmTypeInfo.Builder().
-            setEdm(getClient().getCachedEdm()).setTypeExpression(annotation.returnType()).build();
-
-    if (edmType.isEntityType()) {
-      if (edmType.isCollection()) {
-        final ParameterizedType collType = (ParameterizedType) method.getReturnType().getGenericInterfaces()[0];
-        final Class<?> collItemType = (Class<?>) collType.getActualTypeArguments()[0];
-        return getEntityCollectionProxy(
-                collItemType,
-                method.getReturnType(),
-                null,
-                (CommonODataEntitySet) result,
-                target,
-                false);
-      } else {
-        return getEntityProxy(
-                (CommonODataEntity) result,
-                null,
-                method.getReturnType(),
-                null,
-                false);
-      }
-    } else {
-      Object res;
-
-      final Class<?> ref = ClassUtils.getTypeClass(method.getReturnType());
-      final CommonODataProperty property = (CommonODataProperty) result;
-
-      if (property == null || property.hasNullValue()) {
-        res = null;
-      } else if (edmType.isCollection()) {
-        if (edmType.isComplexType()) {
-          final Class<?> itemRef = ClassUtils.extractTypeArg(ref, ComplexCollection.class);
-          final List items = new ArrayList();
-
-          for (ODataValue item : property.getValue().asCollection()) {
-            items.add(getComplex(
-                    property.getName(),
-                    item,
-                    itemRef,
-                    null,
-                    null,
-                    true));
-          }
-
-          res = Proxy.newProxyInstance(
-                  Thread.currentThread().getContextClassLoader(),
-                  new Class<?>[] {ref}, new ComplexCollectionInvocationHandler(
-                  service,
-                  items,
-                  itemRef,
-                  null));
-        } else {
-          final List items = new ArrayList();
-
-          for (ODataValue item : property.getValue().asCollection()) {
-            items.add(item.asPrimitive().toValue());
-          }
-
-          res = Proxy.newProxyInstance(
-                  Thread.currentThread().getContextClassLoader(),
-                  new Class<?>[] {PrimitiveCollection.class}, new PrimitiveCollectionInvocationHandler(
-                  service,
-                  items,
-                  null,
-                  null));
-        }
-      } else {
-        if (edmType.isComplexType()) {
-          res = getComplex(property.getName(), property.getValue().asComplex(), ref, null, null, false);
-        } else {
-          res = CoreUtils.getObjectFromODataValue(property.getValue(), method.getGenericReturnType(), service);
-        }
-      }
-
-      return res;
-    }
-  }
-
-  protected ComplexType getComplex(
+  protected ComplexType<?> getComplex(
           final String name,
           final ODataValue value,
           final Class<?> ref,
@@ -349,7 +121,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
 
     complexHandler.setEntityHandler(handler);
 
-    final ComplexType res = ComplexType.class.cast(Proxy.newProxyInstance(
+    final ComplexType<?> res = ComplexType.class.cast(Proxy.newProxyInstance(
             Thread.currentThread().getContextClassLoader(),
             new Class<?>[] {actualRef}, complexHandler));
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/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 0d68965..72cf7ec 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
@@ -22,7 +22,6 @@ import java.io.InputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
 import java.net.URI;
@@ -63,6 +62,7 @@ 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.apache.olingo.ext.proxy.utils.ProxyUtils;
 
 public abstract class AbstractStructuredInvocationHandler extends AbstractInvocationHandler {
 
@@ -166,7 +166,6 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
       return proxy;
     } else if ("loadAsync".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
       return service.getClient().getConfiguration().getExecutor().submit(new Callable<Object>() {
-
         @Override
         public Object call() throws Exception {
           load();
@@ -292,10 +291,10 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
           res = Proxy.newProxyInstance(
                   Thread.currentThread().getContextClassLoader(),
                   new Class<?>[] {EdmStreamValue.class}, new EdmStreamValueHandler(
-                          baseURI == null
-                          ? null
-                          : getClient().newURIBuilder(baseURI.toASCIIString()).appendPropertySegment(name).build(),
-                          service));
+                  baseURI == null
+                  ? null
+                  : getClient().newURIBuilder(baseURI.toASCIIString()).appendPropertySegment(name).build(),
+                  service));
 
           streamedPropertyCache.put(name, EdmStreamValue.class.cast(res));
         }
@@ -444,8 +443,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
     final Class<?> type = getter.getReturnType();
     final Class<?> collItemType;
     if (EntityCollection.class.isAssignableFrom(type)) {
-      final Type[] eCollParams = ((ParameterizedType) type.getGenericInterfaces()[0]).getActualTypeArguments();
-      collItemType = (Class<?>) eCollParams[0];
+      collItemType = ClassUtils.extractTypeArg(type, EntityCollection.class, ComplexCollection.class);
     } else {
       collItemType = type;
     }
@@ -457,7 +455,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
 
     if (link instanceof ODataInlineEntity) {
       // return entity
-      navPropValue = getEntityProxy(
+      navPropValue = ProxyUtils.getEntityProxy(
+              service,
               ((ODataInlineEntity) link).getEntity(),
               targetEntitySetURI,
               type,
@@ -465,7 +464,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
               false);
     } else if (link instanceof ODataInlineEntitySet) {
       // return entity set
-      navPropValue = getEntityCollectionProxy(
+      navPropValue = ProxyUtils.getEntityCollectionProxy(
+              service,
               collItemType,
               type,
               targetEntitySetURI,
@@ -477,7 +477,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
       final URI targetURI = URIUtils.getURI(getEntityHandler().getEntityURI(), property.name());
 
       if (EntityCollection.class.isAssignableFrom(type)) {
-        navPropValue = getEntityCollectionProxy(
+        navPropValue = ProxyUtils.getEntityCollectionProxy(
+                service,
                 collItemType,
                 type,
                 targetEntitySetURI,
@@ -485,7 +486,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
                 targetURI,
                 true);
       } else if (AbstractEntitySet.class.isAssignableFrom(type)) {
-        navPropValue = getEntitySetProxy(type, targetURI); // cannot be used standard target entity set URI
+        navPropValue =
+                ProxyUtils.getEntitySetProxy(service, type, targetURI); // cannot be used standard target entity set URI
       } else {
         final EntityUUID uuid = new EntityUUID(targetEntitySetURI, collItemType, null);
         LOG.debug("Ask for '{}({})'", collItemType.getSimpleName(), null);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/abb47659/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexCollectionInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexCollectionInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexCollectionInvocationHandler.java
index 84514ac..1fe242b 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexCollectionInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexCollectionInvocationHandler.java
@@ -40,9 +40,8 @@ import org.apache.olingo.ext.proxy.AbstractService;
 import org.apache.olingo.ext.proxy.api.ComplexCollection;
 import org.apache.olingo.ext.proxy.api.ComplexType;
 
-public class ComplexCollectionInvocationHandler<T extends ComplexType>
-        extends AbstractCollectionInvocationHandler<T, ComplexCollection<T>>
-        implements ComplexCollection<T> {
+public class ComplexCollectionInvocationHandler<T extends ComplexType<?>>
+        extends AbstractCollectionInvocationHandler<T, ComplexCollection<T, ?, ?>> {
 
   private static final long serialVersionUID = 98078202642671756L;