gpt4 book ai didi

sap-commerce-cloud - 如何带条件导出数据

转载 作者:行者123 更新时间:2023-12-02 08:46:15 26 4
gpt4 key购买 nike

我需要导出模型的一些实例,但我不想要全部。我只需要具有特定属性的那个。

我可以通过代码做到这一点,我想知道如何使用 Impex 做到这一点?

最佳答案

您可以通过其他方式导出实例:

第 1 步:

进入HMC界面,选择脚本生成器tool System->Tools->Script Generator ,然后生成 ImpEx 脚本模型,并选择要导出的实例类型脚本,如下所示:

"#% impex.setTargetFile( ""Customer.csv"" );"  // 1. where to export
insert_update Customer;&Item;@password[translator=de.hybris.platform.impex.jalo.translators.UserPasswordTranslator];CN;CodeNaf(code);DN;Europe1PriceFactory_UDG(code,itemtype(code));Europe1PriceFactory_UPG(code,itemtype(code));Europe1PriceFactory_UTG(code,itemtype(code));accountOrigine(&Item);accountVerificationType;addresses(&Item);authentificationDate[dateformat=dd.MM.yyyy hh:mm:ss];authorizedToUnlockPages[allownull=true];birthDate[dateformat=dd.MM.yyyy hh:mm:ss];carts(code);codeAPE;codeRCS;codeSiret;company;companyType(code,itemtype(code));creationtime[forceWrite=true,dateformat=dd.MM.yyyy hh:mm:ss];customerID;dateOfBirth[dateformat=dd.MM.yyyy hh:mm:ss];defaultPaymentAddress(&Item);defaultPaymentInfo(&Item);defaultShipmentAddress(&Item);description;domain;emailAlias;encodedPassword;enseigne(code)[allownull=true];erosId;europe1Discounts(&Item);firstname;fraudStatus(code,itemtype(code));hmcLoginDisabled;interestAreaList(code,itemtype(code));isprofessionnel;lastLogin[dateformat=dd.MM.yyyy hh:mm:ss];lastname;ldapaccount[allownull=true];ldaplogin;ldapsearchbase;locationType(code,itemtype(code));loginDisabled[allownull=true];modifiedtime[dateformat=dd.MM.yyyy hh:mm:ss];name;nbChild;nbGodSon;orders(code,versionID);origin;originalUid;owner(&Item)[allownull=true];password;passwordAnswer;passwordEncoding;passwordQuestion;paymentInfos(&Item);previewCatalogVersions(catalog(id),version);profilePicture(catalogVersion(catalog(id),version),code);recevedDocs;sessionCurrency(isocode);sessionLanguage(isocode);subscriptionTelContact(&Item);title(code);token;type(code,itemtype(code));uid[unique=true,allownull=true];userprofile(&Item);verificationDate[dateformat=dd.MM.yyyy hh:mm:ss];verificationflag // 2. how to export
"#% impex.exportItems( ""Customer"" , false );" // 3. what to export

为了让您更清楚地了解您要寻找的内容,我将重点关注第三行

#% impex.exportItems( ""Customer"" , false );" // 3. what to export

因此您可以以不同的方式使用exportItems方法:

  • 导出项目(按项目集):

    public void exportItems( Collection<Item> items )
    public void exportItems( String[] pklist )

这些方法导出给定的项目,这些项目可以作为 PK(字符串)列表传递,也可以直接用作项目集合。

  • 导出项目(按类型代码):

    public void exportItems( String typecode )
    public void exportItems( String typecode, int count )
    public void exportItems( String typecode, boolean inclSubTypes )
    public void exportItems( String typecode, int count, boolean inclSubTypes )

  • 通过FlexibleSearch导出项目:

    public void exportItemsFlexibleSearch( String query )
    public void exportItemsFlexibleSearch( String query, Map values, List resultClasses, final boolean failOnUnknownFields, final boolean dontNeedTotal, int start, int count )<br/>
    public void exportItemsFlexibleSearch( String query, int count )

注意:导出器 API 默认情况下使用搜索结果分页。因此,要获得准确的结果,您的FlexibleSearch 查询必须包含 ORDER BY子句示例:

impex.exportItemsFlexibleSearch(""select {PK} from {Customer} where {uid}='anonymous' ORDER BY {pk}"")

如果您有权访问help.hybris,请检查:

如果您只能访问 wiki:

第 2 步:

进入HAC界面,ImpEx Export ,然后输入您的脚本并导出您的项目。

关于sap-commerce-cloud - 如何带条件导出数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48950413/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com