So, if I understood, you need different mapping for two instances of same class.
I don't think this is possible, it is not even logical, if you think it over.
OR mapping is based on class structures and relations between classes and class properties, not on instances and instance properties.
I don't think this is hibernate annotations problem, that kind of mapping isn't possible in Hibernate at all. Somebody correct me if I 'm wrong.
So, I think that only solution for situation you have is to define two different classes for each value object. Something like this:
Code:
public class MyEntity {
private DomesticCatRegistry domesticCatRegistry;
private ForeignCatRegistry foreignCatRegistry;
}
@Embeddable
public class DomesticCatRegistry {
@CollectionOfElements
private List<String> names;
....
}
@Embeddable
public class ForeignCatRegistry {
@CollectionOfElements
private List<String> names;
....
}