第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在olingo中讀取具有復(fù)雜屬性的實(shí)體集合?

如何在olingo中讀取具有復(fù)雜屬性的實(shí)體集合?

米脂 2023-12-13 14:52:30
我大致遵循apache olingo 頁面上的本教程。我想讀取具有復(fù)雜屬性的實(shí)體的集合。設(shè)置提供程序,訪問時(shí)得到以下輸出http://localhost:8080/api/odata/$metadata:<?xml version="1.0" encoding="UTF-8"?><edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">    <edmx:DataServices>        <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="My.Namespace">            <EntityType Name="MyEntity">                <Key>                    <PropertyRef Name="id"/>                </Key>                <Property Name="id" Type="Edm.String"></Property>                <Property Name="name" Type="Edm.String"></Property>                <Property Name="description" Type="Edm.String"></Property>                <Property Name="complexProp" Type="My.Namespace.MyComplexType"></Property>            </EntityType>            <ComplexType Name="MyComplexType">                <Property Name="id" Type="Edm.String"></Property>                <Property Name="name" Type="Edm.String"></Property>            </ComplexType>            <EntityContainer Name="Container">                <EntitySet Name="MyEntities" EntityType="My.Namespace.MyEntity"></EntitySet>            </EntityContainer>        </Schema>    </edmx:DataServices></edmx:Edmx>這對我來說似乎沒問題(是嗎?)。但是當(dāng)我嘗試讀取我的實(shí)體訪問集合時(shí)http://localhost:8080/api/odata/MyEntities,我收到了返回消息Cannot find type with name: My.Namespace.MyComplexType當(dāng)在序列化器上調(diào)用時(shí),單步執(zhí)行代碼會(huì)發(fā)現(xiàn)readEntityCollection處理器方法中拋出了期望。entityCollection我一定錯(cuò)過了一個(gè)重要的觀點(diǎn),因?yàn)樵谖铱磥磉@My.Namespace.MyComplexType是明確定義的。
查看完整描述

1 回答

?
飲歌長嘯

TA貢獻(xiàn)1951條經(jīng)驗(yàn) 獲得超3個(gè)贊

雖然異常是在處理器中拋出的,但該錯(cuò)誤與序列化沒有任何關(guān)系。

MyComplexType無法找到復(fù)雜類型,因?yàn)?onlygetEntityType(final FullQualifiedName entityTypeName)在 EdmProvider 中被覆蓋,但沒有被覆蓋getComplexType(final FullQualifiedName complexTypeName)。olingo似乎通過調(diào)用這些方法來搜索類型。

重寫此方法后,所有數(shù)據(jù)均正確顯示。


查看完整回答
反對 回復(fù) 2023-12-13
  • 1 回答
  • 0 關(guān)注
  • 152 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)