Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] XMLChoiceCollectionMappingn that maps the same xpath to different classes?

Hi.

Is it possible to create a mapping using XMLChoiceCollectionMappingn
that maps the same xpath to different classes?

Something like:

XMLChoiceCollectionMapping references = new XMLChoiceCollectionMapping();
references.addChoiceElement("ex:exchangeObjectReference",
BuildingActivityReference.class);
references.addChoiceElement("ex:exchangeObjectReference",
TaxationUnitActivityReference.class);

where it would first try to map it as a BuildingActivityReference, if
that doesn't work, try a TaxationUnitActivityReference.

Since the addChoiceElement call stores things in a Map, I guess this
isn't supported. Or should I use some other type of mapping? Or does
anyone have any suggestions of how I could implement this myself?

Thanks!

 /Magnus Heino


Back to the top