org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext.getNavigationProperty()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext.getNavigationProperty()方法的一些代码示例,展示了WriteEntryCallbackContext.getNavigationProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriteEntryCallbackContext.getNavigationProperty()方法的具体详情如下:
包路径:org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext
类名称:WriteEntryCallbackContext
方法名:getNavigationProperty

WriteEntryCallbackContext.getNavigationProperty介绍

暂无

代码示例

代码示例来源:origin: com.sap.cloud.servicesdk.prov/odata-core

  1. EdmNavigationProperty navigationProperty = context.getNavigationProperty();

代码示例来源:origin: org.apache.olingo/olingo-odata2-jpa-processor-core

  1. Map<String, ExpandSelectTreeNode> navigationLinks = null;
  2. JPAEntityParser jpaResultParser = new JPAEntityParser();
  3. EdmNavigationProperty currentNavigationProperty = context.getNavigationProperty();
  4. try {
  5. Object inlinedEntry = entry.get(currentNavigationProperty.getName());
  6. currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
  7. List<EdmNavigationProperty> nextNavProperty =
  8. getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
  9. if (nextNavProperty != null) {
  10. currentNavPropertyList.addAll(nextNavProperty);

代码示例来源:origin: io.cronapp/olingo-odata2-jpa-processor-core

  1. Map<String, ExpandSelectTreeNode> navigationLinks = null;
  2. JPAEntityParser jpaResultParser = new JPAEntityParser(oDataJPAContext, null);
  3. EdmNavigationProperty currentNavigationProperty = context.getNavigationProperty();
  4. try {
  5. Object inlinedEntry = entry.get(currentNavigationProperty.getName());
  6. currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
  7. List<EdmNavigationProperty> nextNavProperty =
  8. getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
  9. if (nextNavProperty != null) {
  10. currentNavPropertyList.addAll(nextNavProperty);

代码示例来源:origin: org.apache.olingo/olingo-odata2-annotation-processor-core

  1. @Override
  2. public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
  3. throws ODataApplicationException {
  4. try {
  5. final EdmEntityType entityType =
  6. context.getSourceEntitySet().getRelatedEntitySet(context.getNavigationProperty()).getEntityType();
  7. WriteEntryCallbackResult result = new WriteEntryCallbackResult();
  8. Object relatedData;
  9. try {
  10. relatedData = readRelatedData(context);
  11. } catch (final ODataNotFoundException e) {
  12. relatedData = null;
  13. }
  14. if (relatedData == null) {
  15. result.setEntryData(Collections.<String, Object> emptyMap());
  16. } else {
  17. result.setEntryData(getStructuralTypeValueMap(relatedData, entityType));
  18. EntityProviderWriteProperties inlineProperties =
  19. EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).callbacks(
  20. getCallbacks(relatedData, entityType)).expandSelectTree(context.getCurrentExpandSelectTreeNode())
  21. .build();
  22. result.setInlineProperties(inlineProperties);
  23. }
  24. return result;
  25. } catch (final ODataException e) {
  26. throw new ODataApplicationException(e.getLocalizedMessage(), Locale.ROOT, e);
  27. }
  28. }

代码示例来源:origin: io.cronapp/olingo-odata2-annotation-processor-core

  1. @Override
  2. public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
  3. throws ODataApplicationException {
  4. try {
  5. final EdmEntityType entityType =
  6. context.getSourceEntitySet().getRelatedEntitySet(context.getNavigationProperty()).getEntityType();
  7. WriteEntryCallbackResult result = new WriteEntryCallbackResult();
  8. Object relatedData;
  9. try {
  10. relatedData = readRelatedData(context);
  11. } catch (final ODataNotFoundException e) {
  12. relatedData = null;
  13. }
  14. if (relatedData == null) {
  15. result.setEntryData(Collections.<String, Object> emptyMap());
  16. } else {
  17. result.setEntryData(getStructuralTypeValueMap(relatedData, entityType));
  18. EntityProviderWriteProperties inlineProperties =
  19. EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).callbacks(
  20. getCallbacks(relatedData, entityType)).expandSelectTree(context.getCurrentExpandSelectTreeNode())
  21. .build();
  22. result.setInlineProperties(inlineProperties);
  23. }
  24. return result;
  25. } catch (final ODataException e) {
  26. throw new ODataApplicationException(e.getLocalizedMessage(), Locale.ROOT, e);
  27. }
  28. }

代码示例来源:origin: org.apache.olingo/olingo-odata2-annotation-processor-core-incubating

  1. @Override
  2. public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
  3. throws ODataApplicationException {
  4. try {
  5. final EdmEntityType entityType =
  6. context.getSourceEntitySet().getRelatedEntitySet(context.getNavigationProperty()).getEntityType();
  7. WriteEntryCallbackResult result = new WriteEntryCallbackResult();
  8. Object relatedData;
  9. try {
  10. relatedData = readRelatedData(context);
  11. } catch (final ODataNotFoundException e) {
  12. relatedData = null;
  13. }
  14. if (relatedData == null) {
  15. result.setEntryData(Collections.<String, Object> emptyMap());
  16. } else {
  17. result.setEntryData(getStructuralTypeValueMap(relatedData, entityType));
  18. EntityProviderWriteProperties inlineProperties =
  19. EntityProviderWriteProperties.serviceRoot(getContext().getPathInfo().getServiceRoot()).callbacks(
  20. getCallbacks(relatedData, entityType)).expandSelectTree(context.getCurrentExpandSelectTreeNode())
  21. .build();
  22. result.setInlineProperties(inlineProperties);
  23. }
  24. return result;
  25. } catch (final ODataException e) {
  26. throw new ODataApplicationException(e.getLocalizedMessage(), Locale.ROOT, e);
  27. }
  28. }

相关文章