[OLINGO-365] Better handling of derived types in entity and complex type collections
This commit is contained in:
parent
82a73c5771
commit
4ead5f41b8
|
@ -91,6 +91,8 @@ public abstract class AbstractService<C extends CommonEdmEnabledODataClient<?>>
|
|||
this.context = new Context();
|
||||
}
|
||||
|
||||
public abstract Class<?> getEntityTypeClass(String name);
|
||||
|
||||
public abstract Class<?> getComplexTypeClass(String name);
|
||||
|
||||
public abstract Class<?> getEnumTypeClass(String name);
|
||||
|
|
|
@ -93,7 +93,6 @@ public abstract class AbstractCollectionInvocationHandler<T extends Serializable
|
|||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Collection<T> execute() {
|
||||
if (this.uri != null) {
|
||||
final Triple<List<T>, URI, List<ODataAnnotation>> res = fetchPartial(this.uri.build(), itemRef);
|
||||
|
|
|
@ -129,23 +129,31 @@ public abstract class AbstractEntityCollectionInvocationHandler<
|
|||
final List<T> res = new ArrayList<T>(entities.size());
|
||||
|
||||
for (CommonODataEntity entity : entities) {
|
||||
Class<?> actualRef = null;
|
||||
if (entity.getTypeName() != null) {
|
||||
actualRef = service.getEntityTypeClass(entity.getTypeName().toString());
|
||||
}
|
||||
if (actualRef == null) {
|
||||
actualRef = typeRef;
|
||||
}
|
||||
|
||||
final EntityInvocationHandler handler =
|
||||
this instanceof EntitySetInvocationHandler
|
||||
? EntityInvocationHandler.getInstance(
|
||||
entity,
|
||||
EntitySetInvocationHandler.class.cast(this),
|
||||
typeRef)
|
||||
actualRef)
|
||||
: EntityInvocationHandler.getInstance(
|
||||
entity,
|
||||
targetEntitySetURI,
|
||||
typeRef,
|
||||
actualRef,
|
||||
service);
|
||||
|
||||
final EntityInvocationHandler handlerInTheContext = getContext().entityContext().getEntity(handler.getUUID());
|
||||
|
||||
res.add((T) Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {typeRef},
|
||||
new Class<?>[] {actualRef},
|
||||
handlerInTheContext == null ? handler : handlerInTheContext));
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.ImmutableTriple;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.apache.olingo.client.api.communication.request.retrieve.ODataPropertyRequest;
|
||||
|
@ -110,7 +111,15 @@ public class ComplexCollectionInvocationHandler<T extends ComplexType<?>>
|
|||
final CommonODataProperty property = res.getBody();
|
||||
if (property != null && property.hasCollectionValue()) {
|
||||
for (ODataValue item : (ODataCollectionValue<ODataValue>) property.getValue()) {
|
||||
resItems.add((T) getComplex(property.getName(), item, typeRef, null, null, true));
|
||||
Class<?> actualRef = null;
|
||||
if (StringUtils.isNotBlank(item.getTypeName())) {
|
||||
actualRef = service.getComplexTypeClass(item.getTypeName());
|
||||
}
|
||||
if (actualRef == null) {
|
||||
actualRef = typeRef;
|
||||
}
|
||||
|
||||
resItems.add((T) getComplex(property.getName(), item, actualRef, null, null, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -101,9 +101,9 @@ public class PrimitiveCollectionInvocationHandler<T extends Serializable>
|
|||
|
||||
final ODataRetrieveResponse<org.apache.olingo.commons.api.domain.v4.ODataProperty> res = req.execute();
|
||||
|
||||
List<T> resItems = new ArrayList<T>();
|
||||
final List<T> resItems = new ArrayList<T>();
|
||||
|
||||
org.apache.olingo.commons.api.domain.v4.ODataProperty property = res.getBody();
|
||||
final org.apache.olingo.commons.api.domain.v4.ODataProperty property = res.getBody();
|
||||
if (property != null && !property.hasNullValue()) {
|
||||
for (ODataValue item : property.getCollectionValue()) {
|
||||
resItems.add((T) item.asPrimitive().toValue());
|
||||
|
|
|
@ -247,6 +247,7 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo {
|
|||
namespaces.add(schema.getNamespace().toLowerCase());
|
||||
}
|
||||
|
||||
final Map<String, String> entityTypeNames = new HashMap<String, String>();
|
||||
final Map<String, String> complexTypeNames = new HashMap<String, String>();
|
||||
final Map<String, String> enumTypeNames = new HashMap<String, String>();
|
||||
final Map<String, String> termNames = new HashMap<String, String>();
|
||||
|
@ -298,6 +299,9 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo {
|
|||
}
|
||||
|
||||
for (EdmEntityType entity : schema.getEntityTypes()) {
|
||||
final String className = utility.capitalize(entity.getName());
|
||||
entityTypeNames.put(entity.getFullQualifiedName().toString(), typesPkg + "." + className);
|
||||
|
||||
objs.clear();
|
||||
objs.put("entityType", entity);
|
||||
|
||||
|
@ -328,10 +332,8 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo {
|
|||
}
|
||||
}
|
||||
|
||||
parseObj(typesBaseDir, typesPkg, "entityType",
|
||||
utility.capitalize(entity.getName()) + ".java", objs);
|
||||
parseObj(typesBaseDir, typesPkg, "entityCollection",
|
||||
utility.capitalize(entity.getName()) + "Collection.java", objs);
|
||||
parseObj(typesBaseDir, typesPkg, "entityType", className + ".java", objs);
|
||||
parseObj(typesBaseDir, typesPkg, "entityCollection", className + "Collection.java", objs);
|
||||
}
|
||||
|
||||
// write container and top entity sets into the base package
|
||||
|
@ -366,6 +368,7 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo {
|
|||
objs.clear();
|
||||
objs.put("metadata", new String(Base64.encodeBase64(baos.toByteArray()), "UTF-8"));
|
||||
objs.put("metadataETag", metadata.getMiddle());
|
||||
objs.put("entityTypes", entityTypeNames);
|
||||
objs.put("complexTypes", complexTypeNames);
|
||||
objs.put("enumTypes", enumTypeNames);
|
||||
objs.put("terms", termNames);
|
||||
|
|
|
@ -100,6 +100,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -112,6 +114,9 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
#foreach ($entityType in $entityTypes.entrySet())
|
||||
entityTypes.put("$entityType.key", ${entityType.value}.class);
|
||||
#end
|
||||
#foreach ($complexType in $complexTypes.entrySet())
|
||||
complexTypes.put("$complexType.key", ${complexType.value}.class);
|
||||
#end
|
||||
|
@ -124,6 +129,11 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,6 +112,38 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetail.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.License", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.License.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReview.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Customer", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Customer.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes_Simple", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialTypes", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.DiscontinuedProduct", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.DiscontinuedProduct.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Driver", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Driver.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Login", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Login.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.PageView", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageView.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadata.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLogin.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.SpecialEmployee.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Car", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPageView", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPageView.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.MappedEntityType", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityType.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachment.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Employee", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Employee.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine2", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Computer", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Computer.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Message", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Message.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhoto.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Product", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Product.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Contractor.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Person", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Person.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Order", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Order.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSAToken.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions", org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions.class);
|
||||
|
@ -120,6 +154,11 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,10 +112,18 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV3.Row", org.apache.olingo.fit.proxy.v3.opentype.microsoft.test.odata.services.opentypesservicev3.types.Row.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV3.RowIndex", org.apache.olingo.fit.proxy.v3.opentype.microsoft.test.odata.services.opentypesservicev3.types.RowIndex.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV3.IndexedRow", org.apache.olingo.fit.proxy.v3.opentype.microsoft.test.odata.services.opentypesservicev3.types.IndexedRow.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV3.ContactDetails", org.apache.olingo.fit.proxy.v3.opentype.microsoft.test.odata.services.opentypesservicev3.types.ContactDetails.class);
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,9 +112,29 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmDateTime", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmDateTime.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmDouble", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmDouble.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmString", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmString.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.Folder", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.Folder.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmByte", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmByte.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmGuid", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmGuid.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmTime", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmTime.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmDateTimeOffset", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmDateTimeOffset.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmInt64", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmInt64.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmBoolean", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmBoolean.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmInt16", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmInt16.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmDecimal", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmDecimal.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmSingle", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmSingle.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmBinary", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmBinary.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.PrimitiveKeysService.EdmInt32", org.apache.olingo.fit.proxy.v3.primitivekeys.microsoft.test.odata.services.primitivekeysservice.types.EdmInt32.class);
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,6 +112,38 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetail.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.License", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.License.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ProductReview.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes_Simple", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Customer", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialTypes", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.DiscontinuedProduct", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.DiscontinuedProduct.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Driver", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Driver.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Login", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Login.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.PageView", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.PageView.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.LastLogin.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadata.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.SpecialEmployee.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPageView", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ProductPageView.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Car", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Car.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.MappedEntityType", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityType.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachment.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Employee", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine2", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Computer", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Computer.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Message", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Message.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhoto.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Product", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Contractor", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Contractor.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Person", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Person.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.Order", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Order.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.RSAToken.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexWithAllPrimitiveTypes", org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComplexWithAllPrimitiveTypes.class);
|
||||
|
@ -121,6 +155,11 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,10 +112,25 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("ODataDemo.Customer", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Customer.class);
|
||||
entityTypes.put("ODataDemo.PersonDetail", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.PersonDetail.class);
|
||||
entityTypes.put("ODataDemo.ProductDetail", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.ProductDetail.class);
|
||||
entityTypes.put("ODataDemo.Employee", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Employee.class);
|
||||
entityTypes.put("ODataDemo.Product", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Product.class);
|
||||
entityTypes.put("ODataDemo.Advertisement", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Advertisement.class);
|
||||
entityTypes.put("ODataDemo.Category", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Category.class);
|
||||
entityTypes.put("ODataDemo.Person", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Person.class);
|
||||
entityTypes.put("ODataDemo.Supplier", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Supplier.class);
|
||||
entityTypes.put("ODataDemo.FeaturedProduct", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.FeaturedProduct.class);
|
||||
complexTypes.put("ODataDemo.Address", org.apache.olingo.fit.proxy.v4.demo.odatademo.types.Address.class);
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,12 +112,20 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV4.Row", org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV4.IndexedRow", org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.IndexedRow.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV4.RowIndex", org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.RowIndex.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV4.AccountInfo", org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.AccountInfo.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV4.ContactDetails", org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.ContactDetails.class);
|
||||
enumTypes.put("Microsoft.Test.OData.Services.OpenTypesServiceV4.Color", org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Color.class);
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
|
@ -98,6 +98,8 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
return getInstance(ODataServiceVersion.V40, serviceRoot, transactional);
|
||||
}
|
||||
|
||||
private final Map<String, Class<?>> entityTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> complexTypes = new HashMap<String, Class<?>>();
|
||||
|
||||
private final Map<String, Class<?>> enumTypes = new HashMap<String, Class<?>>();
|
||||
|
@ -110,6 +112,28 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
super(compressedMetadata, metadataETag,version, serviceRoot, transactional);
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CreditCardPI.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Account", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Account.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.ProductDetail", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.ProductDetail.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Order", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Order.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Statement", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Statement.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Subscription", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Subscription.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Person", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.GiftCard", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.GiftCard.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.OrderDetail", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.OrderDetail.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Product", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Product.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PaymentInstrument.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Customer", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Club", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Club.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.ProductReview", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.ProductReview.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Department", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Department.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Asset", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Asset.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Employee", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Employee.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.StoredPI", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.StoredPI.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Company", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.CreditRecord", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CreditRecord.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.LabourUnion", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.LabourUnion.class);
|
||||
entityTypes.put("Microsoft.Test.OData.Services.ODataWCFService.PublicCompany", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PublicCompany.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.ODataWCFService.Address", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.ODataWCFService.CompanyAddress", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CompanyAddress.class);
|
||||
complexTypes.put("Microsoft.Test.OData.Services.ODataWCFService.AccountInfo", org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.AccountInfo.class);
|
||||
|
@ -121,6 +145,11 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS
|
|||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getEntityTypeClass(final String name) {
|
||||
return entityTypes.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComplexTypeClass(final String name) {
|
||||
return complexTypes.get(name);
|
||||
|
|
Loading…
Reference in New Issue