本文整理了Java中org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext
类的一些代码示例,展示了WriteEntryCallbackContext
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriteEntryCallbackContext
类的具体详情如下:
包路径:org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext
类名称:WriteEntryCallbackContext
[英]Context given if the target of an expand is an entry. It contains the source entity set, the navigation property pointing to the entry which has to be expanded, the current expand select tree node and the data of the source entry.
[中]如果扩展的目标是一个条目,则指定上下文。它包含源实体集、指向必须展开的条目的导航属性、当前展开选择树节点和源条目的数据。
代码示例来源:origin: org.apache.olingo/olingo-odata2-jpa-processor-core
throws ODataApplicationException {
WriteEntryCallbackResult result = new WriteEntryCallbackResult();
Map<String, Object> entry = context.getEntryData();
Map<String, Object> edmPropertyValueMap = null;
List<EdmNavigationProperty> currentNavPropertyList = null;
Map<String, ExpandSelectTreeNode> navigationLinks = null;
JPAEntityParser jpaResultParser = new JPAEntityParser();
EdmNavigationProperty currentNavigationProperty = context.getNavigationProperty();
try {
Object inlinedEntry = entry.get(currentNavigationProperty.getName());
if (nextEntitySet == null) {
nextEntitySet = context.getSourceEntitySet().getRelatedEntitySet(currentNavigationProperty);
navigationLinks = context.getCurrentExpandSelectTreeNode().getLinks();
if (navigationLinks.size() > 0) {
currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
List<EdmNavigationProperty> nextNavProperty =
getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
if (nextNavProperty != null) {
currentNavPropertyList.addAll(nextNavProperty);
代码示例来源:origin: com.sap.cloud.servicesdk/odata-v2-lib
WriteEntryCallbackContext context = new WriteEntryCallbackContext();
context.setSourceEntitySet(eia.getEntitySet());
context.setCurrentWriteProperties(properties);
context.setNavigationProperty(navProp);
context.setEntryData(data);
ExpandSelectTreeNode subNode = properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
context.setCurrentExpandSelectTreeNode(subNode);
代码示例来源:origin: com.sap.cloud.servicesdk.prov/odata-core
Map<String, Object> entry = context.getEntryData();
EdmNavigationProperty navigationProperty = context.getNavigationProperty();
代码示例来源:origin: io.cronapp/olingo-odata2-annotation-processor-core
@Override
public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
throws ODataApplicationException {
try {
final EdmEntityType entityType =
context.getSourceEntitySet().getRelatedEntitySet(context.getNavigationProperty()).getEntityType();
WriteEntryCallbackResult result = new WriteEntryCallbackResult();
Object relatedData;
try {
relatedData = readRelatedData(context);
} catch (final ODataNotFoundException e) {
relatedData = null;
}
if (relatedData == null) {
result.setEntryData(Collections.<String, Object> emptyMap());
} else {
result.setEntryData(getStructuralTypeValueMap(relatedData, entityType));
EntityProviderWriteProperties inlineProperties =
EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).callbacks(
getCallbacks(relatedData, entityType)).expandSelectTree(context.getCurrentExpandSelectTreeNode())
.build();
result.setInlineProperties(inlineProperties);
}
return result;
} catch (final ODataException e) {
throw new ODataApplicationException(e.getLocalizedMessage(), Locale.ROOT, e);
}
}
代码示例来源:origin: org.apache.olingo/olingo-odata2-core-incubating
final EdmEntitySet inlineEntitySet = entitySet.getRelatedEntitySet(navigationProperty);
WriteCallbackContext context = isFeed ? new WriteFeedCallbackContext() : new WriteEntryCallbackContext();
context.setSourceEntitySet(entitySet);
context.setNavigationProperty(navigationProperty);
代码示例来源:origin: org.apache.olingo/olingo-odata2-annotation-processor-core-incubating
@Override
public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
throws ODataApplicationException {
try {
final EdmEntityType entityType =
context.getSourceEntitySet().getRelatedEntitySet(context.getNavigationProperty()).getEntityType();
WriteEntryCallbackResult result = new WriteEntryCallbackResult();
Object relatedData;
try {
relatedData = readRelatedData(context);
} catch (final ODataNotFoundException e) {
relatedData = null;
}
if (relatedData == null) {
result.setEntryData(Collections.<String, Object> emptyMap());
} else {
result.setEntryData(getStructuralTypeValueMap(relatedData, entityType));
EntityProviderWriteProperties inlineProperties =
EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).callbacks(
getCallbacks(relatedData, entityType)).expandSelectTree(context.getCurrentExpandSelectTreeNode())
.build();
result.setInlineProperties(inlineProperties);
}
return result;
} catch (final ODataException e) {
throw new ODataApplicationException(e.getLocalizedMessage(), Locale.ROOT, e);
}
}
代码示例来源:origin: com.sap.cloud.servicesdk/odata-v2-lib
final EdmEntitySet inlineEntitySet = entitySet.getRelatedEntitySet(navigationProperty);
WriteCallbackContext context = isFeed ? new WriteFeedCallbackContext() : new WriteEntryCallbackContext();
context.setSourceEntitySet(entitySet);
context.setNavigationProperty(navigationProperty);
代码示例来源:origin: org.apache.olingo/olingo-odata2-core
WriteEntryCallbackContext context = new WriteEntryCallbackContext();
context.setSourceEntitySet(eia.getEntitySet());
context.setCurrentWriteProperties(properties);
context.setNavigationProperty(navProp);
context.setEntryData(data);
ExpandSelectTreeNode subNode = properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
context.setCurrentExpandSelectTreeNode(subNode);
代码示例来源:origin: org.apache.olingo/olingo-odata2-annotation-processor-core
@Override
public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
throws ODataApplicationException {
try {
final EdmEntityType entityType =
context.getSourceEntitySet().getRelatedEntitySet(context.getNavigationProperty()).getEntityType();
WriteEntryCallbackResult result = new WriteEntryCallbackResult();
Object relatedData;
try {
relatedData = readRelatedData(context);
} catch (final ODataNotFoundException e) {
relatedData = null;
}
if (relatedData == null) {
result.setEntryData(Collections.<String, Object> emptyMap());
} else {
result.setEntryData(getStructuralTypeValueMap(relatedData, entityType));
EntityProviderWriteProperties inlineProperties =
EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).callbacks(
getCallbacks(relatedData, entityType)).expandSelectTree(context.getCurrentExpandSelectTreeNode())
.build();
result.setInlineProperties(inlineProperties);
}
return result;
} catch (final ODataException e) {
throw new ODataApplicationException(e.getLocalizedMessage(), Locale.ROOT, e);
}
}
代码示例来源:origin: io.cronapp/olingo-odata2-jpa-processor-core
throws ODataApplicationException {
WriteEntryCallbackResult result = new WriteEntryCallbackResult();
Map<String, Object> entry = context.getEntryData();
Map<String, Object> edmPropertyValueMap = null;
List<EdmNavigationProperty> currentNavPropertyList = null;
Map<String, ExpandSelectTreeNode> navigationLinks = null;
JPAEntityParser jpaResultParser = new JPAEntityParser(oDataJPAContext, null);
EdmNavigationProperty currentNavigationProperty = context.getNavigationProperty();
try {
Object inlinedEntry = entry.get(currentNavigationProperty.getName());
if (nextEntitySet == null) {
nextEntitySet = context.getSourceEntitySet().getRelatedEntitySet(currentNavigationProperty);
navigationLinks = context.getCurrentExpandSelectTreeNode().getLinks();
if (navigationLinks.size() > 0) {
currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
List<EdmNavigationProperty> nextNavProperty =
getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
if (nextNavProperty != null) {
currentNavPropertyList.addAll(nextNavProperty);
代码示例来源:origin: org.apache.olingo/olingo-odata2-core
final EdmEntitySet inlineEntitySet = entitySet.getRelatedEntitySet(navigationProperty);
WriteCallbackContext context = isFeed ? new WriteFeedCallbackContext() : new WriteEntryCallbackContext();
context.setSourceEntitySet(entitySet);
context.setNavigationProperty(navigationProperty);
代码示例来源:origin: org.apache.olingo/olingo-odata2-core-incubating
WriteEntryCallbackContext context = new WriteEntryCallbackContext();
context.setSourceEntitySet(eia.getEntitySet());
context.setNavigationProperty(navProp);
context.setEntryData(data);
ExpandSelectTreeNode subNode = properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
context.setCurrentExpandSelectTreeNode(subNode);
内容来源于网络,如有侵权,请联系作者删除!