Class CsdlMerger
edmx:Reference schemas.
Documents are merged oldest-first: where multiple versions define the same type,
property, enum member, operation, or container element, the newest version's
descriptions, annotations, and revisions win, while elements present only in older
versions (such as v11's Reserve/Release or encryption at rest) are
kept. An operation parameter that exists in only a subset of the versions defining the
operation, or that carries Core.OptionalParameter, becomes nullable (optional).
-
Method Summary
Modifier and TypeMethodDescriptionstatic CsdlDocumentmerge(List<CsdlDocument> documents) Merges CSDL documents ordered oldest-first, newest-last.static CsdlDocumentresolveReferences(CsdlDocument document, Function<String, Optional<CsdlDocument>> resolver) Resolves local (non-HTTP)edmx:Referenceelements indocumentusingresolver, appending type-only schemas for the referenced namespaces not already present indocument.
-
Method Details
-
merge
Merges CSDL documents ordered oldest-first, newest-last.- Parameters:
documents- the documents to merge (at least one)- Returns:
- the merged document, carrying the newest document's OData version and
Core.SchemaVersion - Throws:
IllegalArgumentException- ifdocumentsis empty
-
resolveReferences
public static CsdlDocument resolveReferences(CsdlDocument document, Function<String, Optional<CsdlDocument>> resolver) Resolves local (non-HTTP)edmx:Referenceelements indocumentusingresolver, appending type-only schemas for the referenced namespaces not already present indocument.When a referenced schema defines its own
EntityContainer(a separate OData service such asibm.tm1s.api.v1), only the transitive closure of entity, complex, and enum types referenced bydocumentis included — avoiding name collisions (such astm1s.Sessionvstm1.Session) and keeping another service's operations and container out of this service's model. When a referenced schema has noEntityContainer(an extension schema such asibm.odata.mpu.v1), all of its types and enums are included, without its operations.- Parameters:
document- the document whose references to resolveresolver- resolves a reference URI (e.g.ibm.tm1s.api.v1.xml) to a parsed document, or empty if unavailable- Returns:
- a document with the resolved type-only schemas appended
-