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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 HyperJaxb3 自定義抽象 complexType 的元素

使用 HyperJaxb3 自定義抽象 complexType 的元素

搖曳的薔薇 2022-07-27 11:26:14
我正在將 XSD 模式轉(zhuǎn)換為帶有 HyperJaxb3 的 Hibernate 的 Java 注釋 bean。到目前為止,我設(shè)法生成了 Java 對象,但是我需要自定義 OperableType 的備注字段,因為默認生成的長度是 255,我需要將其擴展到 4000。這是相關(guān) xsd 模式的片段:<xs:complexType name="OperableType" abstract="true">    <xs:annotation>        <xs:documentation xml:lang="en">OperableType contains all the elements and attributes common to all the operables. This is an abstract type, so no element of this type will be present in the XML.        The logical ID is a unique logical identifier of a sanctioned entity, of a regulation or of a detail of a sanction entity. This information is also provided to external actors for help, especially when entity multiple aliases make it difficult the identification task. For entities imported from previous database, the old value is retained.</xs:documentation>    </xs:annotation>    <xs:sequence>        <xs:element name="remark" type="fsdexport:UnlimitedTextType" minOccurs="0" maxOccurs="unbounded"/>        <xs:element name="additionalInformation" type="fsdexport:AdditionalInfoType" minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>    <xs:attribute name="logicalId" type="xs:long" use="required"/></xs:complexType><xs:simpleType name="UnlimitedTextType">    <xs:restriction base="xs:string"/></xs:simpleType>我無法修改 XSD 架構(gòu)或收到的 XML 文件,因此我需要自定義綁定以使其正常工作。我嘗試使用此綁定    <jxb:bindings node="xs:complexType[@name='OperableType']">        <jxb:bindings node="xs:sequence//xs:element[@name='remark']">            <hj:basic>                <orm:column length="4000" />            </hj:basic>        </jxb:bindings>    </jxb:bindings>但它不會修改生成代碼中的長度。@ElementCollection@OrderColumn(name = "HJINDEX")@Column(name = "HJVALUE", length = 255)@CollectionTable(name = "OPERABLE_TYPE_REMARK", joinColumns = {    @JoinColumn(name = "HJID")})public List<String> getRemark() {我還嘗試使用 'hj:default-single-property' 來自定義 UnlimitedTextType,但我也沒有設(shè)法讓它工作。
查看完整描述

1 回答

?
倚天杖

TA貢獻1828條經(jīng)驗 獲得超3個贊

從源頭尋求幫助后, https://github.com/highsource/hyperjaxb3/issues/54,我得到了答案:


<jxb:bindings node="xs:complexType[@name='OperableType']">

    <jxb:bindings node="xs:sequence//xs:element[@name='remark']">

        <hj:element-collection>

            <orm:column length="4000" />

        </hj:element-collection>

    </jxb:bindings>

</jxb:bindings>

關(guān)鍵是你使用 hj:element-collection 而不是 hj:basic 作為 xml 序列。


查看完整回答
反對 回復(fù) 2022-07-27
  • 1 回答
  • 0 關(guān)注
  • 113 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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