Zum Hauptinhalt gehen

Programmatische Erstellung von Data Source Einträgen

Kommentare

1 Kommentar

  • Zendesk API User
    Author: korayyersel - 10/30/2014 12:46

    Ich habe eine andere Vorgehensweise angewendet und es hat geklappt. Statt in Haupttabelle Entity die Kind-Entitties als Array / PersistenList zu speichern habe ich in Kind-Tabelle ein Entity erstellt und Parent Entity in entsprechendes Feld als Value gespeichert:

    ||||| Einträge in zweite Tabelle (Contents) erstellen |||||

    IDProvider contentsIDProvider = contentStore.getStoreElement("requests_contents", IDProvider.UidType.CONTENTSTORE);

    Content2 contentsContent2 = (Content2) contentsIDProvider;

    Session contentsSession =contentsContent2.getSchema().getSession();

    for(String contentId : contentIds){

    Entity newContentEntity =contentsSession.createEntity(contentsContent2.getEntityType().getName());

    ...

    contentsContent2.lock(newContentEntity);

    contentsContent2.setLock(true, false);

    ...

    newContentEntity.setValue("contentId",contentId);

    newContentEntity.setValue("requests", newRequestEntity);

    ...

    contentsSession.commit();

    contentsContent2.save();

    ...

    contentsContent2.unlock(newContentEntity);

    contentsContent2.setLock(false, false);

    }

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.