Skip to content

Commit

Permalink
more sdo fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <[email protected]>
  • Loading branch information
lukasj committed Sep 7, 2021
1 parent d801704 commit 328b3dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ private XMLDescriptor getRootDescriptor() {

XMLCompositeObjectMapping mapping = new XMLCompositeObjectMapping();
mapping.setReferenceClass(Child.class);
mapping.getInverseReferenceMapping().setAttributeName("container");
if (mapping.getInverseReferenceMapping() != null) {
mapping.getInverseReferenceMapping().setAttributeName("container");
}
mapping.setAttributeName("childProperty");
mapping.setXPath("tns:child");
xmlDescriptor.addMapping(mapping);

XMLCompositeCollectionMapping mapping2 = new XMLCompositeCollectionMapping();
mapping2.setReferenceClass(Child.class);
mapping2.getInverseReferenceMapping().setAttributeName("container");
if (mapping.getInverseReferenceMapping() != null) {
mapping2.getInverseReferenceMapping().setAttributeName("container");
}
mapping2.setAttributeName("childCollectionProperty");
mapping2.setXPath("tns:child-many");
mapping2.getContainerPolicy().setContainerClass(ArrayList.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ private XMLDescriptor getRootDescriptor() {

XMLCompositeObjectMapping mapping = new XMLCompositeObjectMapping();
mapping.setReferenceClass(Child.class);
mapping.getInverseReferenceMapping().setAttributeName("container");
if (mapping.getInverseReferenceMapping() != null) {
mapping.getInverseReferenceMapping().setAttributeName("container");
}
mapping.setAttributeName("childProperty");
mapping.setXPath("tns:child");
xmlDescriptor.addMapping(mapping);

XMLCompositeCollectionMapping mapping2 = new XMLCompositeCollectionMapping();
mapping2.setReferenceClass(Child.class);
mapping2.getInverseReferenceMapping().setAttributeName("container");
if (mapping.getInverseReferenceMapping() != null) {
mapping2.getInverseReferenceMapping().setAttributeName("container");
}
mapping2.setAttributeName("childCollectionProperty");
mapping2.setXPath("tns:child-many");
mapping2.getContainerPolicy().setContainerClass(ArrayList.class);
Expand Down

0 comments on commit 328b3dd

Please sign in to comment.