[OLINGO-315] handle the case of zero container in EDM schema

This commit is contained in:
challenh 2014-06-06 17:03:58 +08:00
parent 8ad297f9af
commit 80c2f83acc
1 changed files with 17 additions and 16 deletions

View File

@ -347,7 +347,7 @@ public abstract class AbstractODataBinder implements CommonODataBinder {
if (contextURL.getDerivedEntity() == null) {
for (EdmSchema schema : edm.getSchemas()) {
final EdmEntityContainer container = schema.getEntityContainer();
if(container != null) {
EdmBindingTarget bindingTarget = container.getEntitySet(contextURL.getEntitySetOrSingletonOrType());
if (bindingTarget == null) {
bindingTarget = container.getSingleton(contextURL.getEntitySetOrSingletonOrType());
@ -365,6 +365,7 @@ public abstract class AbstractODataBinder implements CommonODataBinder {
}
}
}
}
if (type == null) {
type = new EdmTypeInfo.Builder().setEdm(edm).
setTypeExpression(contextURL.getEntitySetOrSingletonOrType()).build().getType();