Search code examples
javatoplink

Does toplink reflect changes in the order


Does top link reflect the changes if the ordering of the elements have changed? I have the below mapping :

ManyToManyMapping dummyMapping = new ManyToManyMapping();
dummyMapping.setAttributeName("dummy");
dummyMapping.setReferenceClass(Dummy.class);
dummyMapping.useBasicIndirection();
//aggregationProvidersMapping.useCollectionClass(java.util.ArrayList.class);
dummyMapping.setRelationTableName("DUMMY");
dummyMapping.addSourceRelationKeyFieldName("dummy1.ID", "dummy2.ID");
dummyMapping.addTargetRelationKeyFieldName("dummy1.ORGID", "dummy2.id");
descriptor.addMapping(dummyMapping);
  1. What is the default collection class used if I don't specify any class via the "useCollectionClass"?

  2. "dummy" is using a ArrayList and hence the ordering of the elements is maintained. If the ordering of the elements within the "dummy" attribute has changed, [no additions or deletions], does toplink reflect these changes to the DB ?


Solution

  • For a ManyToManyMapping ,there is no way in which the order can be stored. I resolved this solution by changing to OneToManyMapping.