Search in sources :

Example 1 with Entry

use of org.odata4j.format.Entry in project teiid by teiid.

the class ODataUpdateExecution method buildPayload.

private String buildPayload(String entitySet, final List<OProperty<?>> props, EdmDataServices edm) {
    // this is remove the teiid specific model name from the entity type name.
    final EdmEntitySet ees = ODataEntitySchemaBuilder.removeModelName(edm.getEdmEntitySet(entitySet));
    Entry entry = new Entry() {

        public String getUri() {
            return null;
        }

        public OEntity getEntity() {
            return OEntities.createRequest(ees, props, null);
        }
    };
    StringWriter sw = new StringWriter();
    // $NON-NLS-1$
    FormatWriter<Entry> fw = FormatWriterFactory.getFormatWriter(Entry.class, null, "ATOM", null);
    fw.write(null, sw, entry);
    return sw.toString();
}
Also used : Entry(org.odata4j.format.Entry) StringWriter(java.io.StringWriter) EdmEntitySet(org.odata4j.edm.EdmEntitySet)

Aggregations

StringWriter (java.io.StringWriter)1 EdmEntitySet (org.odata4j.edm.EdmEntitySet)1 Entry (org.odata4j.format.Entry)1